-
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
Fix i18n picker layout #56485
Fix i18n picker layout #56485
Conversation
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-15460 |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~16 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~75 bytes added 📈 [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 (~45 bytes added 📈 [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. |
Nice catch! Do we know why it failed only some times? |
Tested. Looks good to me. Nice catch by @Robertght though! |
Honestly, I have no idea! The default props should mean that the layout is broken all the time. I kind of wonder if the very first time you open it, it's loading a cached version from a while ago, and then after the refresh, it loads the new version?? From what I can tell, gutenboarding is broken all of the time, just not the account switcher
Nice, I'll come up with a fix |
Changes proposed in this Pull Request
The i18n picker layout can become broken. I noticed that language picker is written with
flex
components from@wordpress/components
. That package was updated from v13.x to v17.x in the React 17 PR. I notice this line in the changelog from the v14 release:Flex, FlexBlock, and FlexItem components have been re-written from the ground up (#31297).
Looking at the rendered markup for the language picker, it looked like it was getting incorrect values for
flex-grow
andflex-direction
. From the source code, it looks like the default value forexpanded
istrue
anddirection
is set torow
. Since we do not set these props, the layout was broken. After setting them tofalse
andcolumn
, the layout appears to be fixed.Also, I had to override the type for the flex component because definitely typed is out of date. I was unable to fix it by using yarn patches, or by removing definitely typed. So we might have to do more work in the future to properly resolve the type problem.
resolves #56372
Testing instructions
me/account
. Change the language./new
. Open the language picker at the top right of the page.see #56372 for examples of what it looked like broken.