-
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
Move localizeUrl to new i18n-utils package #46998
Conversation
Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com D52130-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing the Editing Toolkit Plugin for more info: PCYsg-ly5-p2 |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~345 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. |
3f535db
to
8cc8e05
Compare
Parts of this The remaining parts make more sense to be part of My thinking is maybe to split i18n-utils up between the two existing packages and drop the notion of a new one. Does this sound ok or is there still a push to drop |
8cc8e05
to
5bd01df
Compare
That makes sense and I think moving them into |
dfde4bf
to
d9b57d2
Compare
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 so far. I realise it's still a WIP, just left a couple notes. Let me know if there's anything I can help with.
...ting-toolkit/editing-toolkit-plugin/editor-site-launch/src/launch-steps/final-step/index.tsx
Outdated
Show resolved
Hide resolved
5d089ec
to
4f022ca
Compare
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 haven't quite finished my review yet: I can't seem to build calypso locally, and it also looks like there's a change where the new package isn't doing some sort of lazy load of something out of the config and I want to get to the bottom of that.
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.
wp-desktop ci passing, closing review
06541ab
to
3dc3538
Compare
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 👍
This sort of non-side-by-side refactor is quite hard to do safely, caught a sloppy copy paste bug testing random links in the UI: |
Are #localizeUrl unit tests in lib/i18n-utils now redundant? If so, let's remove them in a follow-up PR before they start failing. Edit: Please ignore my comment above, I was looking at an outdated version of the file. |
Changes proposed in this Pull Request
localizeUrl
function to a new package inpackages/i18n-utils
Testing instructions
localizeUrl tests were included in the move:
Manual testing involves checking
localizeUrl
usage still works as expected for example:https://automattic.com/privacy
should be localized (e.g.https://automattic.com/fr/privacy
) but should point to the original english url for any other language.