Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domains: Remove unused domains/kracken-ui/max-characters-filter feature flag #95564

Conversation

leonardost
Copy link
Contributor

Proposed Changes

This PR removes the domains/kracken-ui/max-characters-filter feature flag which was always false and only present in development.json. The feature flag was introduced in #24718, where it was split from domains/kracken-ui/filters, and then it was disabled in #52874.

That flag gated a max length option when searching for domains. When provided, that option adds a max_characters parameter to the suggestion endpoint, which limits the length of the resulting domain name suggestions.

Markup on 2024-10-18 at 20:27:32

Why are these changes being made?

Removing obsolete and dead code.

Testing Instructions

Since this is only removing dead code, nothing should have changed, but please test:

  • Code inspection
  • Go to a domain search page (either in /start or searching for a domain for an existing site)
  • Use the search filter and ensure it's working normally

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@leonardost leonardost requested a review from a team as a code owner October 21, 2024 19:03
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 21, 2024
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/remove-domains-kracken-ui-max-characters-filter-feature-flag on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Oct 21, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~348 bytes removed 📉 [gzipped])

name                  parsed_size           gzip_size
videopress-flow           -1448 B  (-0.1%)     -348 B  (-0.1%)
update-design-flow        -1448 B  (-0.1%)     -348 B  (-0.1%)
sensei-flow               -1448 B  (-0.2%)     -348 B  (-0.2%)
link-in-bio-tld-flow      -1448 B  (-0.1%)     -348 B  (-0.1%)
domains                   -1448 B  (-0.1%)     -348 B  (-0.1%)
copy-site-flow            -1448 B  (-0.2%)     -348 B  (-0.2%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~348 bytes removed 📉 [gzipped])

name                             parsed_size           gzip_size
async-load-signup-steps-domains      -1448 B  (-0.3%)     -348 B  (-0.2%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

} = this.props;
const isValid = /^-?\d*$/.test( maxCharacters );
return ! isValid ? [ translate( 'Value must be a whole number' ) ] : null;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method only checked if maxCharacters is an integer, so it can be removed.

return ! isValid && showOverallValidationError
? [ this.props.translate( 'Please correct any errors above' ) ]
: null;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since getMaxCharactersValidationErrors only returned null, isValid was always true and this method always returned null, so it can be removed too.

@@ -41,7 +38,6 @@ export class DropdownFilters extends Component {

state = {
showPopover: false,
showOverallValidationError: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only ever changed to true when hasValidationErrors returned true, which doesn't happen anymore. So this state property can be removed.

@leonardost leonardost force-pushed the update/remove-domains-kracken-ui-max-characters-filter-feature-flag branch from e378922 to 5e69387 Compare October 21, 2024 21:33
@leonardost leonardost merged commit d352a67 into trunk Oct 24, 2024
11 checks passed
@leonardost leonardost deleted the update/remove-domains-kracken-ui-max-characters-filter-feature-flag branch October 24, 2024 21:31
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants