Skip to content
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

Update babel monorepo to v7.0.0 #26497

Merged
merged 4 commits into from
Aug 29, 2018
Merged

Update babel monorepo to v7.0.0 #26497

merged 4 commits into from
Aug 29, 2018

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 4, 2018

This Pull Request renovates the package group "babel monorepo".

Release Notes


babel/babel

v7.0.0-rc.1

Compare Source
Same as rc.0 but fixes the peerDep issue #​8443. It's changed to just be ^7.0.0-0


v7.0.0-rc.0

Compare Source

v7.0.0-rc.0 (2018-08-09)

EDIT: This had an issue with peerDependencies so please use rc.1.

Alright finally at the end 🙂. Shouldn't have anymore breaking changes and going to wait some time to fix bugs/regressions

Summary: @babel/polyfill will not include proposal polyfills by default and fixed a regression.

💥 Breaking Change
  • babel-polyfill

Will add this to the upgrade guide/polyfill docs. I guess we could include a babel-upgrade for this too, not sure.

🐛 Bug Fix
Committers: 2

v7.0.0-beta.56

Compare Source

v7.0.0-beta.56 (2018-08-03)

Finally landing the last 2 changes before RC. Planning for monday, and then probably 1-2 weeks for regressions/bugs before final.. 🤞

💥 Breaking Change
🚀 New Feature
🐛 Bug Fix
📝 Documentation
Committers: 5


This PR has been generated by Renovate Bot.

@matticbot
Copy link
Contributor

@renovate renovate bot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Task Framework labels Aug 4, 2018
@renovate renovate bot force-pushed the renovate/babel-monorepo branch 3 times, most recently from a4f4c3e to bbf9367 Compare August 4, 2018 05:46
@blowery
Copy link
Contributor

blowery commented Aug 9, 2018

Some config updates required here for how we use the runtime

@blowery blowery requested a review from a team August 9, 2018 12:25
@blowery blowery self-assigned this Aug 9, 2018
@renovate renovate bot force-pushed the renovate/babel-monorepo branch from bbf9367 to f2762c4 Compare August 9, 2018 16:36
@renovate renovate bot changed the title Update babel monorepo to v7.0.0-beta.56 Update babel monorepo Aug 9, 2018
@renovate renovate bot force-pushed the renovate/babel-monorepo branch from f2762c4 to d451b93 Compare August 9, 2018 17:42
@blowery
Copy link
Contributor

blowery commented Aug 9, 2018

We need to pick up upgrades to everything else that depends on @babel/runtime to land this.

@babel/runtime used to include core-js as part of the package, but in b56, they split it out to @babel/runtime-corejs2. Packages like @wordpress/api-fetch have dependencies like "@babel/runtime": "^7.0.0-beta.52", which automatically moves to beta.56, which is now incompatible.

So we either need to pick up upgrades to all of the @wordpress/* packages that spec @babel/runtime-corejs2 as a dependency and use it that way, or an update to those packages that caps the dependency at beta.55.

See also WordPress/gutenberg#8727

cc @gziolo @dmsnell @aduth @youknowriad

@blowery
Copy link
Contributor

blowery commented Aug 9, 2018

Ah, looks like all the necessary upgrades were released in the last 24 hours! We'll have to move everything together for it to work.

Since we pin the version and @wordpress/* is using hat versions, we should be able to pull in all of those packages first, then land this. It'll mean we're doubling up on some packages for a bit, but not long.

@renovate renovate bot force-pushed the renovate/babel-monorepo branch 2 times, most recently from 81091b9 to a7241cf Compare August 9, 2018 18:53
@gziolo
Copy link
Member

gziolo commented Aug 9, 2018

Yes, we incremented version for almost all packages (all transpiled for sure) to prevent issues with Babel 7.0.0-beta.55 which introduced this split for corejs2. We had reports that it errors because we allow patch range which isn’t the best idea for betas. We pinned to .56 and will probably wait some time before we bump again.

@blowery
Copy link
Contributor

blowery commented Aug 9, 2018

We pinned to .56 and will probably wait some time before we bump again.

@gziolo rc.0 just came out :D

@gziolo
Copy link
Member

gziolo commented Aug 9, 2018

It’s fun business with all those deps 😅

@renovate renovate bot force-pushed the renovate/babel-monorepo branch from a7241cf to 92a4ff2 Compare August 9, 2018 19:35
@renovate renovate bot changed the title Update babel monorepo Update babel monorepo to v7.0.0-rc.0 Aug 9, 2018
@renovate renovate bot force-pushed the renovate/babel-monorepo branch from 92a4ff2 to 2f02099 Compare August 9, 2018 21:22
@renovate renovate bot changed the title Update babel monorepo to v7.0.0-rc.0 Update babel monorepo Aug 9, 2018
@renovate renovate bot force-pushed the renovate/babel-monorepo branch 2 times, most recently from decc934 to de9ea42 Compare August 10, 2018 00:59
@renovate renovate bot changed the title Update babel monorepo Update babel monorepo to v7.0.0-rc.1 Aug 10, 2018
@renovate renovate bot force-pushed the renovate/babel-monorepo branch 2 times, most recently from 2696ece to 7b2826d Compare August 10, 2018 19:45
@blowery blowery removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 10, 2018
@blowery blowery added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 10, 2018
@renovate
Copy link
Contributor Author

renovate bot commented Aug 10, 2018

PR has been edited

As this PR has been edited, Renovate will stop updating it in order to not cause any conflicts or other problems. If you wish to abandon your edits and have Renovate recreate this PR then you should rename this PR and then close it.

@jsnajdr jsnajdr changed the title Update babel monorepo to v7.0.0-rc.1 Update babel monorepo to v7.0.0 Aug 28, 2018
regenerator: false,
useESModules: false,
Copy link
Member

@gziolo gziolo Aug 28, 2018

Choose a reason for hiding this comment

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

Why not use Babel helpers with import/export syntax by enabling useESModules?

Copy link
Member

Choose a reason for hiding this comment

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

The useESModules: true indeed looks interesting: the Babel helpers (i.e., node_modules/@babel/runtime/helpers/esm/inherits.js) are then imported in a ES6 module rather than CommonJS version. There is negligible impact on build size though.

Copy link
Member

Choose a reason for hiding this comment

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

Right, given that polyfills are off, it probably doesn't matter.

@jsnajdr
Copy link
Member

jsnajdr commented Aug 28, 2018

I updated this PR to the stable 7.0.0 release today. ICFY diff:

chunk                                                                                                          stat_size           parsed_size            gzip_size
async-load-layout-guided-tours                                                                                    -187 B  (-0.1%)         +0 B                 +0 B
build                                                                                                               +2 B  (+0.0%)        +58 B   (+0.0%)      +11 B  (+0.0%)
manifest                                                                                                            +0 B                  +0 B                 +6 B  (+0.1%)
stats                                                                                                             -185 B  (-0.0%)         +0 B                 +0 B
theme                                                                                                              -35 B  (-0.1%)         +0 B                 +0 B
vendors~async-load-components-web-preview-component~async-load-design~async-load-design-blocks~async~e0d910d9    +2293 B  (+5.2%)      +2557 B   (+6.0%)     +491 B  (+3.3%)
vendors~async-load-design~async-load-design-blocks~async-load-design-playground~async-load-gutenberg~2306410c       -6 B  (-0.0%)         +0 B                 +0 B
vendors~async-load-design~async-load-design-blocks~async-load-design-playground~async-load-gutenberg~81da215c    +4023 B  (+0.5%)      +4436 B   (+1.6%)     +705 B  (+0.8%)
vendors~async-load-design~async-load-design-blocks~async-load-design-playground~async-load-gutenberg~d451e0fc     +129 B  (+0.0%)       +112 B   (+0.0%)      +20 B  (+0.0%)
vendors~async-load-design~async-load-design-playground~google-my-business~woocommerce                             +228 B  (+0.2%)         -1 B   (-0.0%)       -1 B  (-0.0%)
vendors~async-load-gutenberg-blocks~gutenberg-editor                                                              +446 B  (+0.0%)       +224 B   (+0.1%)      +64 B  (+0.1%)
vendors~async-load-reader-following-manage~async-load-reader-search-stream                                       +1855 B  (+0.8%)      +2576 B   (+2.6%)     +338 B  (+1.7%)
vendors~build                                                                                                    -9894 B  (-0.4%)     -11503 B   (-0.9%)    -1179 B  (-0.4%)
vendors~gutenberg-editor                                                                                         +2293 B  (+3.8%)      +2557 B  (+11.5%)     +417 B  (+7.4%)
vendors~post-editor~woocommerce                                                                                   +905 B  (+0.3%)      +1197 B   (+0.8%)     +171 B  (+0.4%)
vendors~settings-writing                                                                                         +3198 B  (+5.9%)      +3754 B  (+16.4%)     +523 B  (+7.8%)
woocommerce                                                                                                       -277 B  (-0.0%)         +0 B                 +0 B

@jsnajdr
Copy link
Member

jsnajdr commented Aug 28, 2018

There is one failing test, investigating.

@jsnajdr
Copy link
Member

jsnajdr commented Aug 28, 2018

There is one failing test, investigating.

Funny bug with mocked window.FileList. It's an array with a mocked prototype, so that files instanceof window.FileList in the tested code returns true.

But it's still partially an array: Array.isArray() returns true for it, probably because its toString method still returns [object Array].

Before the Babel upgrade, code

if ( files instanceof window.FileList ) {
  files = [ ...files ];
}

transpiled to files = toConsumableArray( files ). The helper managed to convert the "almost array" to "real array".

But after the upgrade, the toConsumableArray helper is no longer used and tests running in Node don't transpile the [ ...files ] expression at all. Now it becomes a problem that the mocked FileList object doesn't expose a Symbol.iterator property.

I pushed a patch that adds the iterable capability to the mock.

@blowery blowery added [Status] Needs e2e Testing [Status] Needs Jetpack e2e Testing Runs the full suite of Jetpack e2e automated tests against this PR using calypso.live labels Aug 28, 2018
Copy link
Contributor

@blowery blowery left a comment

Choose a reason for hiding this comment

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

LGTM!

@jsnajdr
Copy link
Member

jsnajdr commented Aug 28, 2018

@blowery @gziolo If we merge this without coordinating with Gutenberg packages, can something bad happen? Like versions of runtimes or polyfills getting out of sync and duplicated?

@gziolo
Copy link
Member

gziolo commented Aug 28, 2018

Gutenberg is on beta-56, which is the last version before rc. I guess it’s going to be fine. I didn’t find any issues when upgrading to 7.0.0 stable.

renovate-bot and others added 4 commits August 29, 2018 10:14
Makes the mocked FileList object created in the test iterable and therefore a valid
input to `[ ...files ]` spread operator.

Before Babel 7.0.0, the bug was covered up by Babel's `toConsumableArray`, because for
the mocked object, `Array.isArray` still returns true.
@jsnajdr jsnajdr merged commit b68974a into master Aug 29, 2018
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 29, 2018
@renovate renovate bot deleted the renovate/babel-monorepo branch August 29, 2018 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework [Status] Needs Jetpack e2e Testing Runs the full suite of Jetpack e2e automated tests against this PR using calypso.live [Type] Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants