-
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
Retry: Remove node's url from lib/i18n-utils #38683
Conversation
Also adds a new `getUrlFromParts` to `lib/url`.
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~1962 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~164 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. 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. |
Thanks @sgomes for taking it from here! |
Now handles origin and searchParams appropriately, too.
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.
Thank you for coming up with a fix, @akirk! 🙇
Your code looks good! I added some extra improvements as I wrote the tests and found bits missing.
const value = parts[ part ]; | ||
// Avoid some implementation bugs, e.g. https://bugs.webkit.org/show_bug.cgi?id=127958. | ||
if ( value && value !== result[ part ] ) { | ||
result[ part ] = value; |
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.
Note that I had to move the value to a constant to make TypeScript happy, otherwise it would complain about it possibly being undefined
, even though we were checking if ( parts[ part ] && ... )
🤷♂
Adding |
(Deleted some comments meant for another PR) |
The E2E failures appear to be unrelated, and the issue in #38668 does not appear to manifest in this version. |
Retry of #38560 with a workaround for the following Safari bug (see #38668).
Safari 13.0.4 returns:
"0"
, all other browsers return""
.This is an invalid implementation in Safari (almost 6 year old Webkit bug 127958) since the spec says:
The workaround it to simply only assign changed values, and not re-assign equal ones.