Upgrade Babel to 8 and move polyfill injection to babel-plugin-polyfill-corejs3 - #15169
Merged
Merged
Conversation
Contributor
npm Package VersionsWarning The following packages have changed files but no version bump:
If these changes affect published code, consider bumping the version. |
Contributor
Build Artifacts
Smoke test screenshot |
rtibblesbot
force-pushed
the
issue-15138-85358f
branch
3 times, most recently
from
August 8, 2026 09:49
3ef1d27 to
5213ad0
Compare
rtibblesbot
marked this pull request as ready for review
August 8, 2026 10:05
Contributor
Author
|
Acceptance criteria, ticked here because this account cannot edit the issue body (
|
…ll-corejs3 Babel 8 removes preset-env's `useBuiltIns`. Each of the three configs that set it keeps its injection mode: `entry-global` for the core polyfills bundle and Jest, `usage-global` for the sandbox. The core-js version hint moves with it, onto the plugin's `version` option. core-js unifies on the catalog at 3.49.0 — 3.50.0 is inside the 7-day `minimumReleaseAge` window. 300 -> 327 generated modules; all 38 removals are proposals that graduated to `es.*` in the same diff. Consequences of the major: - `vue-jest@3` reaches @babel/core through the `babel-core` bridge, which dies under 8. `@vue/vue2-jest` delegates to babel-jest instead. - transform-runtime needs an explicit `moduleName`: polyfill-corejs3 advertises `@babel/runtime-corejs3` as the helper module whatever its `method`. - `@babel/parser` is pinned to 7.x inside recast's scope — recast requires it from CJS without declaring it, and 8.x is ESM-only. - `@babel/plugin-syntax-import-assertions` is dropped; it has no 8.x release, and nothing transformed here uses import attributes. polyfillLoader.js's comment claimed browsers passing its ES2023 array-method test support the full polyfill set. That was already false at 3.31; the comment now states the test as the legacy-cohort cutoff it is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rtibblesbot
force-pushed
the
issue-15138-85358f
branch
from
August 8, 2026 10:16
5213ad0 to
ce28fd0
Compare
rtibbles
approved these changes
Aug 9, 2026
rtibbles
left a comment
Member
There was a problem hiding this comment.
Changes make sense - manual QA checks out, no regressions when testing on Chrome 65.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Injection moves off the removed
useBuiltInsontobabel-plugin-polyfill-corejs3—entry-globalfor the polyfills bundle and Jest,usage-globalfor the sandbox. core-js unifies on the catalog at 3.49.0.References
Fixes #15138. Supersedes #15113 — close when this lands.
Criteria ticked with evidence: #15169 (comment)
Reviewer guidance
jest.conf/babel.config.js:8— polyfill-corejs3 advertises@babel/runtime-corejs3whatever itsmethod, and transform-runtime follows it; hencemoduleName.package.json:108—@babel/parserheld at 7.x in recast's scope: 8.x is ESM-only and recastrequire()s it undeclared.jest.conf/index.js:25—@vue/vue2-jest@29.2.6peersjest 29/babel-jest 29/@babel/core 7, all mismatched.pnpm-lock.yaml— one non-Babel move:terser5.49.2 → 5.46.0, deduped onto the copy already there under an optionalterser-webpack-plugin.Polyfill accounting
core-js-compat over
browserslist-config-kolibri: 300 → 327 modules, 65 added, 38 removed. Every removal is anesnext.Xwith a matchinges.Xaddition.38 graduations, 27 new modules
Graduated:
iterator.*,set.*v2,json.*raw-json,array-buffer.*transfer/detached,symbol.[async-]dispose,[async-]disposable-stack,async-iterator.async-dispose,suppressed-error,array.from-async,map/object.group-by,promise.try,promise.with-resolvers.es.data-view.{get,set}-float16,es.math.f16roundes.uint8-array.{from,to,set-from}-{base64,hex}es.{map,weak-map}.get-or-insert[-computed]es.error.is-error,es.iterator.concat,es.math.sum-precise,es.regexp.escapeesnext.data-view.{get,set}-uint8-clamped,esnext.iterator.{chunks,sliding,windows,zip,zip-keyed},esnext.number.clamp,esnext.symbol.custom-matcherweb.url.parseEmitted
core-js/modules/*forpolyfills.js:useBuiltIns: 'entry', corejs 3.31useBuiltIns→ polyfill-corejs3Bundle 211,870 → 230,596 bytes (gz 73,633 → 80,399), all the core-js bump.
Sandbox
usagemode: 58 modules before and after, the one changeesnext.json.parse→es.json.parse. Re-measure with babel-loader's caller flags; without them preset-env down-transformsimport()and injects a spuriouses.weak-map.Criteria not met as written
minimumReleaseAgeblocks 3.50.0 until 2026-08-12.es.*module dominates all three engines. It stays a legacy-cohort cutoff — measurement.corejs:hints — that preset-env key is gone; the literal is polyfill-corejs3'sversion,'3.49'in all three configs.Verification
pnpm test-jest318/318,pnpm sandbox-build,make assets,make dist,prek: pass. NouseBuiltInsoutsidenode_modules.AI usage
Used Claude Code to plan and implement the upgrade, and to measure the compat and emitted-import diffs rather than reason about them. Verified with the full Jest suite, the sandbox build and the WHL build.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
🟡 Waiting for feedback
Last updated: 2026-08-08 10:26 UTC