Re:Intl
by zbraniecki on Tuesday June 01, 2021 @10:24PM
(#27364076)
I'm one of the leaders of the ICU4X project which is a Rust implementation of ECMA-402 aiming to back client-side solutions.
We hope to eventually back SpiderMonkey (Firefox JS engine) implementation with it, but we also want to target WASM and in result expose it as a polyfill for any browser to use.
I don't know if by the time ICU4X is 1.0 IE11 will still matter, but it may be possible to compile it to asm.js and run in IE11 maybe?
Re:Intl
by heinrich5991 on Tuesday June 01, 2021 @03:37PM
(#27360118)
Most stuff can be polyfilled. Is this not one of these?
Re:Intl
by fiddlerwoaroof on Tuesday June 01, 2021 @03:43PM
(#27360201)
The locale data for the polyfills can add a lot to bundle size.
https://cdn.polyfill.io/v3/url-builder/ is pretty great for this, it'll detect the browser user agent and send down the right polyfill. Ie on modern browsers it'll send down an empty response.
Re:Intl
by capableweb on Tuesday June 01, 2021 @07:43PM
(#27362909)
Well, great sometimes. Not great if you don't trust a random 3rd party to host essential client-side code for you or if you don't feel like running yet another, maybe unsupported in the future, service for the next X years.
Re:Intl
by Svenskunganka on Wednesday June 02, 2021 @12:48AM
(#27364952)
You can always self-host it: https://github.com/financial-times/polyfill-service
True. We have an "if IE then emit polyfill.io <script> tag" call in the backend, which limits the security surface area to IE and also prevents an otherwise unnecessary extra HTTP request (we only use it for Intl). We feel that's a reasonable middle ground.
If I'd use it for all polyfills (which we should maybe consider!), we'd likely self-host the service.
Well, you either need to format dates or you don't. The idea that you won't use Intl because the IE11 polyfill adds to much to your bundle size is a bit of a head scratcher.
Re:Intl
by fiddlerwoaroof on Tuesday June 01, 2021 @05:25PM
(#27361542)
The issue is whether it’s worth spending that bundle size on an obsolete browser. If not, it could be reasonable to do some naive formatting on IE11 and show a message mentioning that the browser is unsupported and things may render incorrectly.
Re:Intl
by Dylan16807 on Tuesday June 01, 2021 @09:37PM
(#27363790)
Your IE11 polyfills don't have to be in the same bundle as everything else.
https://caniuse.com/?search=Intl
Hopefully, more people will follow suit and ban IE11 when O365 no longer supports it: https://docs.microsoft.com/en-us/lifecycle/announcements/int...