-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Nav Unification: uses experiment to set a feature flag #47527
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~1078 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~8835 bytes removed 📉 [gzipped])
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 (~3739 bytes removed 📉 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
I made a simple config enable/disable API here w/ proof it works: #47535 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and with the treatment active I seemed to be getting the Nav Unification without having to provide a flag in the URL like before (I assume this is what I'm testing?). When I turned the treatment off it went back to the Nav we currently have in Production for users. This seemed correct.
That said I noticed some oddities.
x2 Plugins
links
Not sure why this is happening, but it's happening for both Calypso and WPAdmin and there are x2 Plugins entries in the API response
(Ignore) Transfering to WPAdmin didn't match design wise
Update this was due to outdated testing instructions. With new instructions this works!
Not sure what's happening here but when I click on Feedback
(or any items that takes me to WPAdmin) i get a totally different UI.
I have the diff D52906-code applied to my SB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope you don't mind I added some unit tests.
Also wondering if you should update your helpers to throw some helpful warnings when we are in DEV environment mode? You'd need to add tests for these scenarios as well.
* @api public | ||
*/ | ||
const enable = ( data ) => ( feature ) => { | ||
if ( data.features ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In dev mode should we consider throwing a warning in the console
when the feature being enabled/disabled is not currently defined such as
if ( 'development' === process.env.NODE_ENV ) {
throw new ReferenceError(
`Could not find config value for key '${ key }'\n` +
"Please make sure that if you need it then it has a default value assigned in 'config/_shared.json'"
);
}
This is what the primary config
does already when you're trying to get a top level key
. We could consider same for features as a developer aid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the diff that resolves the duplicate menus. Since this is handled in D52906-code and this PR works, @getdave how would you feel approving this one? Here are the Check code style results that fails
and these are the lines in question wp-calypso/client/lib/create-config/index.js Lines 58 to 88 in d673712
I am not sure how these can be resolved (and they existed prior to this PR), any thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving on the basis that this worked last thing yesterday and @cpapazoglou advises that's he's fixed the duplicate Plugins
menu item issue in the associated diff.
4a48705
to
37fa923
Compare
Deployed r217327-wpcom |
Changes proposed in this Pull Request
Since that nav-unification project is touching many different parts of the code (eg search for
nav-unification
) it wouldn't make sense trying to create different components in order to utilise the experiment componentwp-calypso/client/components/experiment/readme.md
Lines 19 to 37 in a87658f
Also, changes have to kick in really soon cause they are affecting the whole layout (masterbar, navbar).
layout
componentTesting instructions
nav_unification
experiment and click ontreatment
(paYJgx-Zj-p2#comment-1406)Builds together with D52906-code, please test accordingly.
Fixes #47044