c9 / architect

A simple yet powerful plugin system for large-scale node applications
MIT License
981 stars 129 forks source link

Question: Does this work for for latest Node with ES 6 support? #64

Open awidjaja opened 6 years ago

awidjaja commented 6 years ago

It seems there were no recent activities, I wonder if this project still active.

Does this work for for latest Node with ES 6 support? Is there a plan to upgrade to ES 6 module?

nightwing commented 6 years ago

This is still the core part of cloud9, and there are no plans to abandon it. The lack of activity is mainly caused by the fact that this is a simple module which works well.

There is no plan to switch to switch architect itself es6 modules at this point, since es6 module spec is severely lacking, and completely disregards bundling, performance, compatibility with commonjs, and common sense in general.

That said we would be interested to add support for loading apps that are using es6. What do you use now to load es6 modules? A transpiler or the flag for .mjs support in node.

awidjaja commented 6 years ago

the flag for .mjs support in node for production

note: Jest testmatch filter currently doesn't work (ignores .mjs extension). my work around is to rename all .mjs to .js and transpile them through babel for testing only 😢

will architect load ES6 modules?

nightwing commented 6 years ago

Checked the documentation for --experimental-modules flag https://nodejs.org/api/esm.html, and turns out there is currently no way to load .mjs files dynamically (because require is not allowed to work, and import() is not implemented yet). Without dynamic loading something like architect is not possible at all so we need to wait for now. I hope some saner proposal allowing to use require on es6 modules will be implemented instead of the current implementation.

awidjaja commented 6 years ago

with node version 10 going mainstream, may I know if there is a plan for architect to enable .mjs support?