Skip to content
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

Spread in object literals not supported in Edge (any version) #431

Closed
gucci-on-fleek opened this issue Oct 21, 2019 · 5 comments
Closed

Comments

@gucci-on-fleek
Copy link

Spread in object literals is not currently supported in any version of the Microsoft Edge browser. Tested in Edge 18.18362 on Windows 10 1903 and in Edge 15.15254. According to #133, and CHANGELOG.md, Edge ≥ 15 should be supported. The error in the browser console is:

SCRIPT1028: SCRIPT1028: Expected identifier, string or number

The file that caused the error is resource.js. The only other instance of a spread in an object is in reference_test.js which is unlikely to be ever used in the browser. Microsoft Edge is the only major browser to not support a spread operator in an object literal, but MDN still calls the feature experimental.

@Pike
Copy link
Contributor

Pike commented Oct 21, 2019

Are you using the compat build? Per https://www.npmjs.com/package/@fluent/bundle#compatibility, only the compat builds have the browser support matrix.

@gucci-on-fleek
Copy link
Author

gucci-on-fleek commented Oct 26, 2019

Yep, switching to @fluent/bundle/compat solved the problem. Thank you!

You might want to clarify the docs a little bit though, since this affects the current version of Edge, not just "legacy" browsers. Maybe change the npm description to something like this:

Compatibility

fluent requires the following…
For legacy browsers and Microsoft Edge, the compat build has been transpiled using …

This would hopefully clarify that Edge needs special support.

@kellda
Copy link

kellda commented Jul 5, 2020

Spread in object literals are now supported from Edge 79 on, according to MDN and caniuse.

However, this still makes many sites just show a blank page on Edge up to 18. Since these versions are still quite used, it would be good to turn on compat build be default or at least strongly advise using it.

@stasm
Copy link
Contributor

stasm commented Jul 6, 2020

I removed the compat builds in the latest releases of all @fluent packages from last week. The code that we now ship is transpiled by TypeScript to ES2018. See in #472 and #479. It was a maintenance burden to support legacy browsers and to ship multiple builds.

It also didn't feel right that we would be making the decision about the support matrix in the compat builds. I believe the decision should instead be made by developers using fluent.js. I'd recommend transpiling node_modules selectively to replace the compat builds.

@stasm
Copy link
Contributor

stasm commented Jul 8, 2020

I'm going to close this issue. Please see my comment above for the rationale and for a possible fix if you need to support legacy browsers. Thanks!

@stasm stasm closed this as completed Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants