-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 operator not transpiled #3052
Comments
Discussed this in the forum. In essence, Svelte tries to do modern-ish JS without having too strong an opinion about legacy ES. Closing as the solution listed above is what Babel is built for. It is surprising that Edge only half supports spread. Putting this in the ticket in case one of the other devs wants to revisit: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#Browser_compatibility |
It's probably worth discussing whether MS Edge should be supported out of the box. For all its faults it is probably considered a modern browser. Or is compilation to a more widely supported ES version simply a requirement for Svelte? |
It would be great to show in the README that Edge is not supported by default and include the code to fix it in the roll-up config. Or just transpile it. I don't see potential issues doing this. So far that is the only issue I found in Edge. |
I've been maintaining a "discover as I go" IE11 and Edge compatible build here: https://github.com/antony/sapper-ie What I'd like to do ideally is:
Sadly my rollup knowledge isn't enough to figure out exactly how to get the polyfills to bundle before any other code, including shimport, so this is something I would need a pointer for. |
This is where the competitive bar is in 2019. |
So, |
To be honest I think Svelte should support Edge out of the box to be a commerically viable (i.e. something you can "sell" to a business stakeholder / tech decision maker) alternative to React / Vue. It's a temporary measure because when the Chromium version of Edge is fully available then we can revert the transpilation and make it an edge case. I love modern JS but sometimes the sensible path is the one which fosters wider adoption. |
This may all be moot now that general release of the "brand new" Edge featuring all of Chromium's guts is right around the corner: https://blogs.windows.com/msedgedev/2019/11/04/edge-chromium-release-candidate-get-ready/ |
@dkondrad yes and no. Whilst most will hopefully auto-upgrade, there will still be people stuck on Edge browsers. Whilst Svelte is a web-project, it should work on the web. The web is unfortunately still plagued by garbage like (Legacy) Edge and IE. Babel is a complex system which requires considerable effort and knowledge to get working. I believe full legacy Edge compatibility can be reached simply by adding a single Buble transform to the rollup/webpack config. Alternately it would be a worthwhile thing to compile away, IMHO. |
Closing in favour of #558 |
I am using the latest Svelte library but I noticed a spread operator is not being transpiled. This works okay for most browsers but it is failing in MS Edge. This is the code (
on_destroy.push(...new_on_destroy);
):For now I am also including svelte in the babel configuration section to make it work. Something like this:
I am not totally sure if there is something I can do to fix this or if we need to include a fix on Svelte. Any ideas? Thank you in advance.
The text was updated successfully, but these errors were encountered: