Skip to content

nb-bond-api: Babel 8 (@babel/core 8.1.0, @babel/preset-env 8.0.7), supersedes #346 - #368

Merged
Greaker merged 2 commits into
developmentfrom
feature/babel-8-nb-bond-api
Nov 11, 2026
Merged

Greaker merged 2 commits into
developmentfrom
feature/babel-8-nb-bond-api

Conversation

@Greaker

@Greaker Greaker commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

What

Moves nb-bond-api's test-transform toolchain to Babel 8: @babel/core 7.29.7 → 8.1.0 and @babel/preset-env 7.29.5 → 8.0.7, with babel-jest staying at 30.5.2. Supersedes #346, which only bumped the preset and cannot work alone (preset-env 8 peer-requires core 8).

Why the root package.json gains a dev dependency

babel-jest 30.5.2 accepts core 7 or 8 as a peer. With only the workspace bumped, npm hoists jest's own @babel/core 7 to the root, babel-jest resolves that copy, and the Babel 8 preset loads under core 7 (it happens to transform correctly here because the target is the current Node, but the pairing is unsupported). Pinning @babel/core 8.1.0 in the root devDependencies makes npm hoist core 8 instead, so babel-jest and the workspace share one Babel 8 copy.

An overrides entry on babel-jest was tried and rejected: it cascades into @jest/transform, which would then run on core 8 without being supported there (npm ls reports it invalid).

Resulting tree

  • One @babel/core 8.1.0, shared by the workspace and babel-jest.
  • Nested @babel/core 7.29.13 copies stay under @jest/transform, jest-config, jest-snapshot, istanbul-lib-instrument and eslint-plugin-react-hooks, which depend on core 7 directly. This is the unavoidable duplicate; npm ls reports the tree clean. @vitejs/plugin-react 6 no longer depends on Babel, so the old reason for deferring the upgrade no longer applies.
  • Lockfile: re-resolved by removing only the Babel-related entries and letting npm rebuild them, so every non-Babel entry is unchanged. The new transitive packages are Babel 8's own (@jridgewell/gen-mapping beta, @types/gensync, @types/jsesc, empathic, flru, import-meta-resolve, js-tokens 10, verkit, and refreshed regexpu-core / regenerate / babel-plugin-polyfill-corejs3 1.0.0); resolve 1.22.12 and babel-plugin-polyfill-corejs2 / -regenerator drop out. The diff is large because npm moves the Babel entries; the package set is as above.

Babel 8 breaking changes against this repo

  • Node floor ^22.18.0 || >=24.11.0: the repo pins Node 26.12.1.
  • ESM-only packages: the only Babel config is services/nb-bond-api/babel.config.cjs (a plain preset-env entry with targets: { node: 'current' }), which Babel 8 still loads; no removed options are used.
  • No other workspace uses Babel.

Verification

  • nb-bond-api: lint, prettier --check, build, jest 39 suites / 293 tests (also with --no-cache).
  • nb-ui: lint, prettier --check, build, vitest 27 files / 139 tests.
  • npm ci from the committed lockfile; license inventory, node-version, image-hash-input, hygiene and link checks pass.
  • npm audit: 5 low before, 5 low after (all the existing deepmerge / jest chain).

Rollout impact

Dev-only toolchain. The nb-bond-api and nb-ui image content hashes include the root manifest and lockfile, so both images rebuild once under new tags on the next local start; runtime code is unchanged.

docs/KNOWN_ISSUES.md: the "Babel 8 upgrade deferred" entry is replaced by a description of the resulting layout.

Moves the test-transform toolchain to Babel 8. The root package.json pins
@babel/core 8.1.0 as a dev dependency so babel-jest and the workspace share one
Babel 8 copy; jest's own packages and eslint-plugin-react-hooks keep nested
Babel 7 copies. The lockfile change is limited to Babel's own dependency tree.
Replaces the deferred-upgrade note in KNOWN_ISSUES with the resulting layout.
@Greaker
Greaker merged commit b5c0c5f into development Nov 11, 2026
11 checks passed
@Greaker
Greaker deleted the feature/babel-8-nb-bond-api branch November 11, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant