-
Notifications
You must be signed in to change notification settings - Fork 302
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
Amd and commonjs to es6 #131
Conversation
```sh sed -i "s|define.'[^']*',|define(|g" $(git grep --name-only -e "define[(]'[^']*',") npm install amd-to-es6 ./node_modules/.bin/amdtoes6 -d src/ -o src/ -b npm install esnext find src/ -type f -name "*.js" \ -not -name "*.min.js" -not -name "optimer_regular.js" \ -exec ./node_modules/.bin/esnext -I -w modules.commonjs {} \; ```
@@ -33,7 +33,7 @@ <h1 class="page-title">Source: ApiGlobe.js</h1> | |||
*/ | |||
|
|||
|
|||
define('Core/Commander/Interfaces/ApiInterface/ApiGlobe', [ | |||
define( [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this define
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an artifact of the sed
script being used to transform "named defines" to "unnamed defines" prior to running amdtoes6
(which doesn't support named defines). The sed
script modified that file, but amdtoes6
obviously didn't.
IMO, either we:
- ignore it, leave the commit like that; we'll eventually remove the generated doc from
master
anyway - remove
doc
frommaster
first, then rebase that change on top - exclude that file from the commit
There is a need for decision here, since we have mixed AMD and commonjs imports. Here's my vote:
ping @iTowns/core-devs |
@@ -29,6 +30,12 @@ | |||
"simd": "^2.0.0" | |||
}, | |||
"devDependencies": { | |||
"babel-cli": "^6.5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really not sure babel-cli
is needed.
AFAICT, the babel
executable is installed as part of babel-core
, and babel-cli
is meant to be installed globally (npm install -g babel-cli
) so it's available on your command-line anywhere, and will "sniff" the current module to actually call the locally-installed babel
(at node_modules/.bin/babel
) if it exists; defaulting to the globally-installed one otherwise.
May be related : mrdoob/three.js#9310 |
This has been merged. I think it's a great example to follow for itowns. I'm going to work on this done soon, unless:
@iTowns/reviewers : thoughts? |
I just updated #44 with code that appears to work (using I removed everything somehow related to publishing the module on the NPM registry (e.g. transforming ES6 to ES5 before publishing) |
+1 |
Hmm, |
This is #44 again.