-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Use ES6 modules instead of AMD #45
Comments
I've been talking with PJ that we definitely need to start transpiling all the code (so including tests and test tools), because:
As a second stage of this ticket we will add tests to the current pipeline. |
Notes for me (I'll explain them later if I decide to go for this):
|
It seems that I managed to transform the code into a set of ES6 modules with Gulp+Babel taking care of transpilation. Unfortunately, couple of things didn't work due to issues in other libraries:
Other than that, architecturally, there is one more step to do – transforming tests to ES6 modules as well. Without that we'll have multiple problems when referencing dev code in the tests and tests tools. I encounter serious issues when I wanted to load e.g. a piece of dev code in a test tool. Plus, we must make the test work in non-fully-ES6-compatible browsers anyway. So this will be an important step as well. Most likely I'll work on this right after fixing the watcher. And the last step – documentation. I made a huge amount of changes in the code, changed some concepts and made some decision based on the previous research. All this needs to be transformed into docs. Otherwise, in a couple of weeks we will start making the same mistakes which I did along the road :D. |
The discussion was started in ckeditor/ckeditor5-design#73 whether we shouldn't use ES6 modules rather than AMD. So far the discussion is not concluded, but there were three reasons why we started investigating using ES6 modules:
I'll conclude my research later on, because I found it very interesting (and not straightforward).
The plan for now is to use Babel to transpile ES6 modules to AMD (for browsers) or CJS (for Node) in a way which will also allow to use ES6 modules natively in the future.
The text was updated successfully, but these errors were encountered: