Skip to content

chore(bun): align pins to Bun 1.4.3 and compile .tsx tests with the Solid transform - #454

Merged
0xPlayerOne merged 3 commits into
mainfrom
claude/bun-1.4.3-pins-ui
Oct 17, 2026
Merged

0xPlayerOne merged 3 commits into
mainfrom
claude/bun-1.4.3-pins-ui

Conversation

@0xPlayerOne

@0xPlayerOne 0xPlayerOne commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves every Bun pin in this repository from 1.4.0 to 1.4.3: .mise.toml, packageManager, the bun-version of the four workflows that set it (design-system-gates, publish-ui, registry-pages, vite-task-cache-proof) and the PROOF_TOOLCHAIN label in packages/ui/scripts/vite-task-cache-proof.ts. bun.lock carries the workspace version refresh that Bun 1.4.3 writes (0.139.0 to 0.141.0).

The same branch carries the Solid test transform, so main never has a head where Bun 1.4.3 cannot link .tsx test imports. Bun 1.4.3 compiles jsx: preserve with jsxImportSource: solid-js as automatic dev JSX, and solid-js/jsx-dev-runtime exports no jsxDEV (696 pass, 12 fail, 12 errors instead of 872 pass without the transform). packages/ui/tests/helpers/solid-transform.ts is a Bun.plugin preload that runs the build's babel-preset-solid transform, modelled on Cortana's. It is passed with --preload by the packages/ui test script and by the root coverage command (package.json, vite.config.ts). The root bunfig.toml has no preload, so root bun test in Design System Gates' Gate scope still runs the dependency-free workflow tests without importing Babel before install.

The transform uses transformSync: Babel sets Error.prepareStackTrace and raises Error.stackTraceLimit before transformAsync returns its promise, so overlapping onLoad callbacks saved each other's changed values and restored them last, and Bun's Error.captureStackTrace({}) (and a vite import) then threw. tests/solid-transform-globals.test.ts runs a cold process that imports four .tsx modules at once, then calls Error.captureStackTrace({}), then imports vite. It failed 3 of 3 runs against the transformAsync version and passes now.

New devDependencies of packages/ui (Cortana's ranges): @babel/core ^8.0.6, @babel/preset-typescript ^8.0.1, babel-preset-solid ^1.9.15; all lock entries are registry sha512.

Validation

  • Bun 1.4.3 and 1.4.0: packages/ui tests 872 pass, 0 fail; root coverage run (--preload form) 872 pass, exit 0; Storybook unit tests 15 pass; oxfmt --check, oxlint --deny-warnings and tsc -p tsconfig.check.json clean; frozen install passes.
  • Gate scope on a clean Bun 1.4.3 checkout with no node_modules: the four workflow test files, run exactly as the workflow does, give 24 pass, 0 fail, and no node_modules appears. At the earlier head (5cdb0ce, global preload) the same command gave 0 pass, 4 fail with Cannot find module '@babel/core' from packages/ui/tests/helpers/solid-transform.ts. That clean clone has a root package.json, so Bun's auto-install does not apply there; I did not test a runner without one.
  • Hosted CI: none yet (draft).

Impact and rollout

  • No migration or rollout action is required
  • Migration or rollout steps are documented below
  • Environment or secret changes are documented below
  • Security, privacy, compatibility, or performance impact is documented below
  • Rollback or follow-up work is documented below

Compatibility: test-only transform; no source, build or published output changes. Coverage totals shift slightly because Babel output replaces Bun's JSX output; the run still exits 0. 21 of 135 src/**/*.tsx modules cannot be imported in the DOM-less unit lane (window is not defined), as before; no unit test imports them.

Review notes

First of a two-PR stack: this PR, then bun check typechecking (#456, based on this branch). #455 (claude/ui-solid-test-transform) was the separate transform PR; its branch now points at the same commit as this one and it is folded in here. Draft, auto-merge off.

Related issue

None.


Generated by Claude Code

.mise.toml, packageManager and every setup-bun step move from 1.4.0 to
1.4.3, and the Vite Task proof harness names the new toolchain in its
cache environment. bun.lock only refreshes the stale workspace version
that Bun 1.4.3 rewrites on install.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XSzpR2pqR4VzetRzaTw7Td
Bun 1.4.3 compiles `jsx: preserve` + `jsxImportSource: solid-js` as automatic dev
JSX, and solid-js/jsx-dev-runtime exports no jsxDEV, so any test that imports a
.tsx module fails to link. Load the same babel-preset-solid transform the build
uses through a Bun.plugin preload (root bunfig.toml for the coverage run,
--preload for the package run), modelled on Cortana's solid-transform.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XSzpR2pqR4VzetRzaTw7Td
The root bunfig preload also applied to the dependency-free workflow tests that
Design System Gates' Gate scope runs before any install, importing Babel there.
Pass the transform with --preload from the UI test and root coverage commands
instead.

transformAsync changes Error.prepareStackTrace and Error.stackTraceLimit before it
returns its promise, so overlapping onLoad callbacks saved each other's changed
values and restored them last. Use transformSync, and cover it with a cold-process
test: concurrent .tsx imports, then Error.captureStackTrace({}), then a vite import.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XSzpR2pqR4VzetRzaTw7Td
@0xPlayerOne
0xPlayerOne marked this pull request as ready for review October 17, 2026 06:33
@0xPlayerOne 0xPlayerOne changed the title chore(bun): align pins to Bun 1.4.3 chore(bun): align pins to Bun 1.4.3 and compile .tsx tests with the Solid transform Oct 17, 2026

@0xPlayerOne 0xPlayerOne left a comment

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.

Personal source outcome: APPROVED at 5872098; merge PENDING qualification. I personally reviewed the complete combined 19-file patch, including the complete lockfile delta, original pins/transform scope and repair regression. Pins and the Solid transform now land atomically. Root workflow tests no longer import Babel through global bunfig; package and both coverage commands explicitly preload. transformSync plus finally prevents overlapping async callbacks from restoring Babel's global stack wrapper, and the cold-process regression checks concurrent TSX imports, both Error globals, captureStackTrace({}) and Vite import. Babel7 remains nested for existing build tooling; no production component implementation changed. Gate scope and cache proof have passed; remaining applicable CI/protections are pending. Owner-reported local tests are not tests I executed. This author-account comment is not a formal GitHub approval. Auto-merge remains off.

@0xPlayerOne
0xPlayerOne enabled auto-merge (squash) October 17, 2026 07:17
@0xPlayerOne
0xPlayerOne merged commit 06002d3 into main Oct 17, 2026
98 of 100 checks passed
@0xPlayerOne
0xPlayerOne deleted the claude/bun-1.4.3-pins-ui branch October 17, 2026 07:18
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.

2 participants