Skip to content

Self host on babel6 - #3438

Merged
hzoo merged 7 commits into
babel:masterfrom
hzoo:self-host-on-babel6
May 2, 2016
Merged

hzoo merged 7 commits into
babel:masterfrom
hzoo:self-host-on-babel6

Conversation

@hzoo

@hzoo hzoo commented Mar 23, 2016 •

Copy link
Copy Markdown
Member

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

@hzoo hzoo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Mar 23, 2016
@hzoo hzoo added this to the 6.x milestone Mar 23, 2016
Comment thread Makefile
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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that'd be pretty straightforward to do

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we already have an issue for this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we do lerna/lerna#117

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great - that was quick!

@hzoo

hzoo commented Apr 11, 2016

Copy link
Copy Markdown
Member Author

Failing issue atm is import _Object$defineProperty from "babel-runtime/core-js/object/define-property"; due to the use of export * from './a' from

let buildExportAll = template(`
  Object.keys(OBJECT).forEach(function (key) {
    if (key === "default") return;
    Object.defineProperty(exports, key, {
      enumerable: true,
      get: function () {
        return OBJECT[key];
      }
    });
  });
`);

let buildExportAll = template(`
Object.keys(OBJECT).forEach(function (key) {
if (key === "default") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return OBJECT[key];
}
});
});
`);

@hzoo

hzoo commented Apr 15, 2016

Copy link
Copy Markdown
Member Author

@hzoo

hzoo commented Apr 15, 2016 •

Copy link
Copy Markdown
Member Author
/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:3

Same 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 Immutable is a visitor and we are exporting validators.js which has a method called isImmutable and now it is overriding but can’t due to object.defineProperty and we just overwrote it in babel 5. So we probably want to change the method name?

@hzoo
hzoo force-pushed the self-host-on-babel6 branch 3 times, most recently from b831716 to b45e42e Compare April 18, 2016 04:24
@codecov-io

codecov-io commented Apr 18, 2016 •

Copy link
Copy Markdown

Current coverage is 99.89%

Merging #3438 into master will increase coverage by -0.09%

@@             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           
  1. 8 files (not in diff) in ...ypes/lib/definitions were modified. more
    • Hits +4
  2. 7 files (not in diff) in ...ages/babel-types/lib were modified. more
    • Misses +1
    • Hits +290
  3. 3 files (not in diff) in ...l-traverse/lib/scope were modified. more
    • Misses +7
    • Hits -904
  4. 3 files (not in diff) in ...raverse/lib/path/lib were modified. more
    • Hits -101
  5. 3 files (not in diff) in ...e/lib/path/inference were modified. more
    • Hits +29
  6. 11 files (not in diff) in ...el-traverse/lib/path were modified. more
    • Misses +2
    • Hits +25
  7. 5 files (not in diff) in ...s/babel-traverse/lib were modified. more
    • Hits -75
  8. 2 files (not in diff) in ...s/babel-register/lib were modified. more
    • Hits -8
  9. 7 files (not in diff) in ...form-regenerator/lib were modified. more
    • Hits -15
  10. 4 files (not in diff) in ...s2015-parameters/lib were modified. more
    • Misses +1
    • Hits -109

Sunburst

Powered by Codecov. Last updated by f215448

@loganfsmyth

Copy link
Copy Markdown
Member

Woo, green

@sindresorhus

Copy link
Copy Markdown
Member

@hzoo Any chance this could land soon? The inability for npm to dedupe Babel dependencies has a huge impact on size and startup performance.

@hzoo

hzoo commented Apr 23, 2016 •

Copy link
Copy Markdown
Member Author

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

@hzoo
hzoo force-pushed the self-host-on-babel6 branch from 1493b3b to daad259 Compare April 25, 2016 00:02
@hzoo
hzoo force-pushed the self-host-on-babel6 branch from 24f8175 to 0ca833b Compare April 25, 2016 00:06
Comment thread package.json
"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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to depend on es2015 and es2015-loose

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hzoo hzoo Apr 25, 2016 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@jamiebuilds

Copy link
Copy Markdown
Contributor

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.

@hzoo

hzoo commented Apr 25, 2016 •

Copy link
Copy Markdown
Member Author

The reason it was added is because without it all of our modules would need to use .default to be consumed which is also a breaking change since most of them do an export default - but it's def a concern to use it

@hzoo hzoo removed the WIP label Apr 25, 2016
@SimenB

SimenB commented May 2, 2016 •

Copy link
Copy Markdown
Contributor

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!

@welefen

welefen commented May 4, 2016

Copy link
Copy Markdown

@hzoo Thanks for your working!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants