rusackas opened a new pull request, #41510:
URL: https://github.com/apache/superset/pull/41510
### SUMMARY
Upgrades **all `@babel/*` packages from 7.x to 8.0.x** in one coordinated
change, consolidating the ~17 open Dependabot PRs. Babel 8 must be adopted
atomically — `@babel/core` and its plugins/presets share peer ranges, so
merging the bumps individually leaves the tree on a broken 7/8 mix. Dependabot
also **missed `packages/superset-core`**, which still pinned Babel 7; that's
fixed here.
Babel 8 removed several long-deprecated options and APIs, and parts of the
surrounding tooling ecosystem have not shipped Babel 8 support yet. This PR
carries the migration plus the workarounds that gap requires — they should be
unwound as upstreams catch up.
**`babel.config.js` migration**
- `loose`/`spec` → `assumptions` (`setPublicClassFields`,
`privateFieldsAsProperties`, `noDocumentAll`) — these options were removed from
preset-env in v8.
- `useBuiltIns`/`corejs` (removed from preset-env) →
`babel-plugin-polyfill-corejs3`.
- Dropped `@babel/plugin-syntax-dynamic-import` (removed in v8) and the
standalone class-properties / class-static-block / optional-chaining /
private-methods / nullish-coalescing transforms (now bundled in preset-env and
ordered correctly after preset-typescript).
- `preset-typescript` set to `onlyRemoveTypeImports: false` — the v8 default
flipped to `true`, which stops eliding value-syntax type-only imports (`import
{ SomeType } from '...'`) and broke ESM resolution in tests.
- `preset-react` and `@emotion/babel-plugin` scoped to `.jsx/.tsx` via
`overrides`. Both enable the JSX syntax plugin; in v8 that makes TypeScript
generic arrows in `.ts` files (e.g. `<T = unknown>(x: T) => x`) parse as JSX.
- Test env uses preset-env `modules: 'commonjs'` instead of the standalone
`transform-modules-commonjs` plugin (v8 runs plugins before presets, so the
standalone plugin rewrote type-only re-exports before they could be elided).
**Dependency workarounds (track for removal)**
- **`patch-package` introduced** (postinstall) to patch
`@emotion/babel-plugin`. Its latest release (11.13.5) still calls the removed
`NodePath#hoist`. Remove the patch once Emotion ships Babel 8 support.
- **`package.json` `overrides`** relax the `@babel/core` peer range for
`ts-jest` (latest still caps `<8`) and the 15 `@babel/plugin-syntax-*` no-op
packages pulled in via `babel-preset-current-node-syntax` / `babel-jest`, none
of which declare Babel 8 compat yet.
- **Removed `babel-plugin-lodash`** — it calls the removed `path.hoist` /
`isModuleDeclaration` APIs and is unmaintained. ⚠️ *Bundle-size note:* this
plugin rewrote `import { x } from 'lodash'` into per-method imports; without
it, cherry-pick lodash imports or rely on tree-shaking to avoid pulling in all
of lodash.
**Lockfile note:** the diff is large but legitimate — a `@babel/runtime`
major bump means our code uses `@babel/runtime@8` while hundreds of third-party
deps still declare `@babel/runtime@^7`, so both majors coexist in the tree.
Verified with `npm dedupe`; the duplication is dependency-driven, not
resolution junk.
Replaces Dependabot PRs: #41355 #41356 #41359 #41372 #41378 #41381 #41406
#41407 #41410 #41412 #41415 #41416 #41417 #41418 #41419 #41420 #41449
### TESTING INSTRUCTIONS
Requires Node 24 (already the repo's `engines` requirement).
```bash
cd superset-frontend
npm ci # postinstall applies the @emotion/babel-plugin patch
npm run build # production webpack build
npm run test # Jest unit suite
```
Validated locally: `npm ci` succeeds and is stable (a follow-up `npm
install` is a no-op), the production webpack build compiles (pre-existing
echarts/bundle-size warnings only), and the Jest unit suite passes.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [x] Removes existing feature or API <!-- removes babel-plugin-lodash;
introduces patch-package -->
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]