-
Notifications
You must be signed in to change notification settings - Fork 58
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
[Iced3] ES2015 modules support #198
Comments
I've just noticed #194 but it doesn't seem to work… |
I'll try to cut a release today. We just haven't released in a bit. Thanks! |
Ah yes it has not been released yet and I have issues building it ( |
Ok, should be live in v111.1.1 That's a lot of 1s! Big thanks to @zapu who did all of the work. |
ES2015 imports are now working when using promises. @maxtaco Is a new release also needed for iced-runtime-3? |
I didn't think so. I wonder what is up. On Tuesday, November 15, 2016, Laurent Payot [email protected]
|
Weird, maybe installing iced-runtime-3 overwrites iced-coffee-script with a different version? |
It really shouldn't. I am st a conference today so might not get a chance On Tuesday, November 15, 2016, Michał Zochniak [email protected]
|
By the way I'm using |
Hm, but won't |
I'm importing "standard" js (Firebase modules). And I'm also struggling to get any result from Firebase |
async/defer is "just" a syntactic sugar for callback based asynchronous functions. So in theory you could try to do something like |
I will try to experiment with |
Thank you so much @zapu, it really helped! |
I still have the ES2015 import issue with await/defer, I get |
If you have top-level await/defer, it has to wrap your entire file in a function, which probably causes this error. Iced should probably handle this better, I overlooked the fact that this may be an issue. Is this the case here? |
Spot on. Yes after wrapping my await/defer in a function the imports issues are gone. But now if using ES2015 imports when I call my function I get:
|
What are your compile flags right now? Can you try something like |
I tried and it worked! The |
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 Thank you for going through all of this, I think there are few places that we can make improvements in Iced. |
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 ?
The text was updated successfully, but these errors were encountered: