Repository navigation
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3620 +/- ##
=========================================
Coverage ? 88.28%
=========================================
Files ? 194
Lines ? 13620
Branches ? 3142
=========================================
Hits ? 12024
Misses ? 1596
Partials ? 0Continue to review full report at Codecov.
|
|
Hmm ok, so would doing this by default be non-backwards compatible? |
|
This is backward compatible but for those who use RequireJS or other certain AMD loaders, the extra params are useless so people may not want to have them in the results. So make it optional should be fine I think. |
|
As far as I understand the amd specs it says something like:
This all applies when there are no dependencies afaics, but we always set dependencies. Ah by some further investigation I now understand that some loaders are doing some lazy loading, so in that case we might just enable this by default without option. As the useless params would/could be stripped by minifiers later anyway, if desired. Or is there any problem you see with having this enabled by default? @Justineo The reasoning here is that we want to avoid options if it is avoidable, to not make babel a more complex config monster. :) |
|
@danez whether to strip "useless" params seem to differ among different minifiers. I can't find how to let Google Closure Compiler keep unused function params, while UglifyJS has an option ( |
…n certain AMD implementations
f36c1f0 to
0708b4b
Compare
0708b4b to
0122d69
Compare
|
Hi guys, how can I get this PR merged? |
85c2bbc to
d2a7eef
Compare
Package: babel-plugin-transform-es2015-modules-amd
Related issue: https://phabricator.babeljs.io/T7382
Currently the code above is transformed into:
For AMD implemetations, it is explicitly allowed to not execute the module factory of
fooin this kind of situation (https://github.com/amdjs/amdjs-api/wiki/AMD#dependencies-):So
foo's factory may never have chance to be called in certain AMD-compatible loaders.I've added an
addBareSourceParamsoption forbabel-plugin-transform-es2015-modules-amd, which will append params corresponding to those bare imports to the module's param list.The output looks like this with this option set to
true: