Repository navigation
Self host on babel6 - #3438
Self host on babel6#3438
Conversation
| npm install | ||
| ./node_modules/.bin/lerna bootstrap | ||
| # remove all existing babel-runtimes and use the top-level babel-runtime | ||
| rm -rf packages/*/node_modules/babel-runtime |
There was a problem hiding this comment.
I think we could do a PR to lerna later so we can get rid of this (modify bootstrap to ignore modules in a config)
There was a problem hiding this comment.
Sure, that'd be pretty straightforward to do
There was a problem hiding this comment.
Do we already have an issue for this?
3d16e71 to
f4888ca
Compare
|
Failing issue atm is let buildExportAll = template(`
Object.keys(OBJECT).forEach(function (key) {
if (key === "default") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return OBJECT[key];
}
});
});
`); |
f4888ca to
fd2d14a
Compare
|
Extracting all exports from https://github.com/babel/babel/blob/master/packages/babel-core/src/api/node.js and https://github.com/babel/babel/blob/master/packages/babel-types/src/index.js Ok I just ran something like |
/home/travis/build/babel/babel/packages/babel-types/lib/index.js:353
var is = t[/*istanbul ignore next*/"is" + type] = function (node, opts) {
^
TypeError: Cannot set property isImmutable of #<Object> which has only a getter
at registerType (/home/travis/build/babel/babel/packages/babel-types/lib/index.js:353:51)
at /home/travis/build/babel/babel/packages/babel-types/lib/index.js:401:3Same error as https://phabricator.babeljs.io/T2438#73533. Seems to be related to using Object.defineProperty instead of just setting exports.x = y in babel5 plus some kind of hoisting Ok seems like its because |
b831716 to
b45e42e
Compare
Current coverage is 99.89%@@ master #3438 diff @@
==========================================
Files 197 194 -3
Lines 23784 20767 -3017
Methods 1374 1517 +143
Messages 0 0
Branches 3186 2761 -425
==========================================
- Hits 23784 20745 -3039
- Misses 0 22 +22
Partials 0 0
|
|
Woo, green |
|
@hzoo Any chance this could land soon? The inability for npm to dedupe Babel dependencies has a huge impact on size and startup performance. |
|
have to add the equivalent of loose mode, and to keep us from bumping to babel 7 add back default module export behavior Yep sorry I want to land this ASAP - in particular the issue is how we want to transform - just depend on es2015 loose (or figure out what we need) and to prob implement the add modules plugin internally |
1493b3b to
daad259
Compare
24f8175 to
0ca833b
Compare
| "babel-plugin-transform-flow-strip-types": "^6.3.13", | ||
| "babel-runtime": "^6.0.0", | ||
| "babel-preset-es2015": "^6.6.0", | ||
| "babel-preset-es2015-loose": "^7.0.0", |
There was a problem hiding this comment.
No reason to depend on es2015 and es2015-loose
There was a problem hiding this comment.
Seems like that is the way the preset is working now https://github.com/bkonkle/babel-preset-es2015-loose/blob/master/README.md - (we don't have to use it either)
There was a problem hiding this comment.
Options: use loose preset, add each plugin and specify loose mode for each, or land something like #3331 (preset options + loose mode option in es2015)
|
Kinda nervous about the exports thing, it appears the add module exports plugin will override any other exports. I don't want any public facing APIs to accidentally break. |
|
The reason it was added is because without it all of our modules would need to use |
0ca833b to
d657649
Compare
|
Hey, any chance of adding the es3-transforms? At least for babel-runtime (somehow, is it enought to add to this array?), which currently has to be sent through es3ify for IE8 compat. Also, congrats on finally landing this! |
|
@hzoo Thanks for your working! |
We should do this*
The 114 files changed is mostly from the 2nd commit (4c23b01) - which changes all babel-runtime's in each package to be babel-runtime@6. Otherwise it should be straightforward to review