question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Iced3] ES2015 modules support

See original GitHub issue

Hello 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:open
  • Created 7 years ago
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
maxtacocommented, Nov 15, 2016

Ok, should be live in v111.1.1

That’s a lot of 1s!

Big thanks to @zapu who did all of the work.

1reaction
zapucommented, Nov 15, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found