[Iced3] ES2015 modules support
See original GitHub issueHello there, a little question.
Since version 1.11 CoffeeScript supports ES2015 import and export syntax by producing an import or export statement in the resulting output. We have to add a layer of transpiler like babel or target ES6 to make it work, just like Iced3. But in Iced3, with babel, when I use the import syntax I get error: reserved word 'import'
.
Is the IcedCoffeeScript codebase moving away from CoffeeScript on this point ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (4 by maintainers)
Top Results From Across the Web
JavaScript modules via script tag | Can I use... Support tables ...
Loading JavaScript module scripts (aka ES6 modules) using <script type="module"> Includes support for the nomodule attribute. Usage % of. all users, all tracked ......
Read more >JavaScript modules - MDN Web Docs
Use of native JavaScript modules is dependent on the import and export statements; these are supported in browsers as shown in the compatibility ......
Read more >Support ES2015 modules · Issue #945 · mozilla/rhino - GitHub
Big topic, see MDN Modules for some primer Depends on Support ES5 this handling in strict mode, as all module code is to...
Read more >16. Modules - Exploring JS
Their support for cyclic dependencies is better than CommonJS's. The ES6 module standard has two parts: Declarative syntax (for importing and exporting) ...
Read more >ES6 Modules in Chrome M61+ - Medium
Legacy browsers that do not support ES6 modules will ignore module code, and only load script tags with an empty type or type="text/javascript" ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, should be live in v111.1.1
That’s a lot of 1s!
Big thanks to @zapu who did all of the work.
Yes, but I just remembered that ES6 modules in CoffeeScript forces the bare option, because otherwise the whole code is wrapped in a top-level function anyways. So by doing ES6 import/export, it has to “undo” that behavior. I think there was even a discussion about this in CoffeeScript repo on GitHub. In our case, forcing bare also makes it not include the
require('iced-runtime')
in the code.Thank you for going through all of this, I think there are few places that we can make improvements in Iced.