Refactor Intl polyfills and remove from ES5 entrypoints #16349
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
This change drastically reduces the entrypoint sizes for the ES5 build by removing the FormatJS
Intl
polyfills and loading them with the same timing logic as the latest build. It also greatly simplifies use ofIntl
where desired by only requiring a single import. Steps are roughly:intl-polyfill
module, and just write code to import it before usingIntl
.And here's the result on the ES5 build:
And as a happy accident, the latest build entries go down a little too. This is because the connection mixin is no longer importing the
localize
module early:I mean... I knew that was going to happen. 🦊
This may actually fix the Webpack upgrade issue as well because that's reportedly related to conditional TLAs, which are eliminated here. I'll have to check that out.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: