Skip to content

Load Intl polyfills, if needed #3145

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

Merged
merged 2 commits into from
Dec 30, 2020
Merged

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Dec 30, 2020

It turns out a few Chinese browsers don't ship with an Intl API, and that causes several issues on Sentry.

This PR adds optional polyfills for the Intl APIs that are loaded if necessary before the app boots.

@rust-highfive
Copy link

r? @carols10cents

(rust-highfive has picked a reviewer for you, use r? to override)

@Turbo87
Copy link
Member Author

Turbo87 commented Dec 30, 2020

r? @pichfl

@pichfl
Copy link

pichfl commented Dec 30, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Dec 30, 2020

📌 Commit cfeff4d has been approved by pichfl

@bors
Copy link
Contributor

bors commented Dec 30, 2020

⌛ Testing commit cfeff4d with merge 16b8a27...

@bors
Copy link
Contributor

bors commented Dec 30, 2020

☀️ Test successful - checks-actions
Approved by: pichfl
Pushing 16b8a27 to master...

@bors bors merged commit 16b8a27 into rust-lang:master Dec 30, 2020
@Turbo87 Turbo87 deleted the intl-polyfills branch December 30, 2020 13:37
bors added a commit that referenced this pull request Jan 4, 2021
Replace `Intl.NumberFormat` usage

This PR should hopefully fix #3158.

I've not been able to reproduce the issue locally, but it looks like it's related to `Intl.NumberFormat` and the polyfill that #3145 introduced. Since we only need this code for number formatting, and we usually want to format in the user's browser locale we can instead use `.toLocaleString()`.

I've extracted an `intl` service for this, which makes it easier to test the `format-num` helper, and brings the implementation closer to the ember-intl addon.

r? `@pichfl`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants