-
Notifications
You must be signed in to change notification settings - Fork 83
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
Consider building as ES6 modules. #38
Comments
Awesome, I think this a great idea. I'll try to hack it out next week — On Sat, Dec 20, 2014 at 1:30 PM, Tomek Wiszniewski
|
I would close this in favour of #42. I think a complete move to es6 using 6to5 or traceur would be cleaner. |
I am punting on this for now. I know ES6 traction is picking up fast. Let's revisit this idea after a few months. Long answer here: #62 |
Sure will do 😸 |
Why
You've reached a conclusion in #17, that AMD is fairly compatible with CommonJS – you can use one within the other or transpile one to the other. That's not the case with ES6 modules. They are designed to be statically analysable (without executing the code) – so there are things impossible to transpile. Such as:
How
Looking by the simplicity of your modules, it should be easy to copy each file to
101/es6/
, replacing:module.exports = a;
withexport default a;
, andvar b = require('./b');
withimport b from './b';
.I've had a very rough go at this, because I needed two modules in an ES6 project. A simple search-and-replace did it in my case: tomekwi/101-es6.
The only problem
The problem is dependency on CommonJS modules (clone, keypather and deep-eql – we should be able to replace extend with 101/assign).
Possible solutions:
import clone from 'clone';
). Some compilers (6to5) can handle this as a temporary ES5-ES6 brigde.The text was updated successfully, but these errors were encountered: