-
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
react-i18n: Use I18n instances in context #39624
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~34 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. 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. |
a20d977
to
19b45ee
Compare
I've requested review in order to get early feedback as WordPress/gutenberg#20318 seems likely to move ahead with minimal changes. |
@@ -0,0 +1,157 @@ | |||
/* eslint-disable */ |
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.
This is duplicated from the upstream PR. It would come from the package and not exist here.
I've updated this with changes here removing Merged to #39627 for testing. The |
5fff854
to
7553179
Compare
7553179
to
789f2c5
Compare
789f2c5
to
6982859
Compare
3c979b8
to
cb93751
Compare
_nx: i18n._nx.bind( i18n ), | ||
_x: i18n._x.bind( i18n ), | ||
isRTL: i18n.isRTL.bind( i18n ), | ||
i18nLocale, |
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.
This may be very WordPress.com specific. I had an implementation that doesn't provide i18nLocale
, but this property is already used in Gutenboarding.
5ccde36
to
60dc646
Compare
Switched to use Rebased. #39627 is also updated. |
commit 60dc646 Author: Jon Surrell <jon.surrell@automattic.com> Date: Wed May 27 18:04:53 2020 +0200 Add declarationMap commit b388052 Author: Jon Surrell <jon.surrell@automattic.com> Date: Wed May 27 18:03:21 2020 +0200 Remove memize dep commit df6b9b2 Author: Jon Surrell <jon.surrell@automattic.com> Date: Wed May 27 17:56:32 2020 +0200 Use useMemo over memize commit 68b41e8 Author: Jon Surrell <jon.surrell@automattic.com> Date: Wed May 27 17:50:55 2020 +0200 Add `i18nLocale` to README commit 78df4e5 Author: Jon Surrell <jon.surrell@automattic.com> Date: Tue May 26 13:08:29 2020 +0200 Use localeData over locale commit c4ac3a3 Author: Jon Surrell <jon.surrell@automattic.com> Date: Fri May 22 13:41:08 2020 +0200 Revert tsconfig change commit 9a68361 Author: Jon Surrell <jon.surrell@automattic.com> Date: Fri May 22 13:30:09 2020 +0200 Use i18nLocale property name commit a5c49e3 Author: Jon Surrell <jon.surrell@automattic.com> Date: Fri May 22 12:44:26 2020 +0200 Add localeSlug from i18n data commit 2c16fe6 Author: Jon Surrell <jon.surrell@automattic.com> Date: Thu May 21 17:09:36 2020 +0200 Add isRTL commit 2695e21 Author: Jon Surrell <jon.surrell@automattic.com> Date: Thu May 21 17:07:32 2020 +0200 Replace with packaged i18n commit 548d17e Author: Jon Surrell <jon.surrell@automattic.com> Date: Wed Feb 26 14:13:22 2020 +0100 Add README commit 2622d26 Author: Jon Surrell <jon.surrell@automattic.com> Date: Mon Feb 24 12:28:13 2020 +0100 Use i18n instances commit 476039f Author: Jon Surrell <jon.surrell@automattic.com> Date: Mon Apr 20 15:12:48 2020 +0200 Upgrade @wordpress/i18n
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.
Looks good, thanks so much for getting this implemented! 👍
✅
Let's wait on #41207Use instances of
@wordpress/i18n
to manage reactive i18n: WordPress/gutenberg#20318TO DO:
wp-calypso/client/landing/gutenboarding/components/header/index.tsx
Line 37 in d9b9247
wp-calypso/client/landing/gutenboarding/components/header/index.tsx
Line 51 in d9b9247
Testing
/new
routes and make sure they work as expected./new
! Try different user locales and locales via URL + incognito.