[WIP]: ES6 Modules#735
Conversation
|
Other problem: I still need to see how to handle JSCS to accept ES6. Probably easy, I just still need to go that further. |
We're not running jshint and jscs against Although, with proper modules and dependencies actually defined, we should also be able to validate |
There was a problem hiding this comment.
Let's stick with fixed version numbers, drop the ^.
There was a problem hiding this comment.
wip. I'll fix that anyway.
One of my main ideas on converting our modules into the es6 format is to allow running jshint and jscs against Also, JSHint helped me a lot on fixing most of dependencies connections in this PR. |
There was a problem hiding this comment.
Why is this import down here?
There was a problem hiding this comment.
interdependency issue. Test need QUnit.config properly set. :(
|
Well, now I see what you're talking about. Having modules depend on core, while those modules are also imported by core, is pretty bad. I think we need to, eventually, get rid of all these circular dependencies. That said, overall it looks like we're on the right track. The import and export statements make sense and are easy enough to follow. |
There was a problem hiding this comment.
this file got a huge diff because the indentation level reduced here. To ignore the whitespace change, see this diff including the ?w=1 parameter.
|
Instead of jspm we should try to use esperanto, like we now do (or started doing) in PEP: jquery-archive/PEP#157 |
|
This is getting more complex than expected and than I desired. We have a lot of interdependencies that brings that complexity, I can make some inline comments to show it. running At least, |
There was a problem hiding this comment.
we don't have the window as the global reference with these modules, it's necessary to fix it.
There was a problem hiding this comment.
Does that only apply to window? What about setTimeout and other globals? How do you access the global scope correctly?
|
I believe it's better stop this PR for now, and treat some circular dependencies that will allow us to turn everything into ES6 Modules with something not such aggressive in the changes. The code isn't designed for modules, but I've identified a lot of good and bad things in this PR which I'll will help in future work. Some of the good parts:
Some parts still needed to improve:
|
This is a WIP.
I've tried to set everything in ES6 modules, which showed to be more difficult than I thought with all the interdependencies in our code.
Currently, we need to make every module true independent, with that we can achieve the desired progress in this PR.
Also, the Browserify with 6to5 plugins aren't working as I expected. Bundling things still get then to use a require system, which I'm not aiming.
I'll follow @jzaefferer's suggestion and try http://jspm.io/