Repository navigation
chore(bun): align pins to Bun 1.4.3 and compile .tsx tests with the Solid transform - #454
Conversation
.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
left a comment
There was a problem hiding this comment.
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.
Summary
Moves every Bun pin in this repository from 1.4.0 to 1.4.3:
.mise.toml,packageManager, thebun-versionof the four workflows that set it (design-system-gates,publish-ui,registry-pages,vite-task-cache-proof) and thePROOF_TOOLCHAINlabel inpackages/ui/scripts/vite-task-cache-proof.ts.bun.lockcarries 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
.tsxtest imports. Bun 1.4.3 compilesjsx: preservewithjsxImportSource: solid-jsas automatic dev JSX, andsolid-js/jsx-dev-runtimeexports nojsxDEV(696 pass, 12 fail, 12 errors instead of 872 pass without the transform).packages/ui/tests/helpers/solid-transform.tsis aBun.pluginpreload that runs the build'sbabel-preset-solidtransform, modelled on Cortana's. It is passed with--preloadby thepackages/uitest script and by the root coverage command (package.json,vite.config.ts). The rootbunfig.tomlhas nopreload, so rootbun testin Design System Gates' Gate scope still runs the dependency-free workflow tests without importing Babel before install.The transform uses
transformSync: Babel setsError.prepareStackTraceand raisesError.stackTraceLimitbeforetransformAsyncreturns its promise, so overlappingonLoadcallbacks saved each other's changed values and restored them last, and Bun'sError.captureStackTrace({})(and aviteimport) then threw.tests/solid-transform-globals.test.tsruns a cold process that imports four.tsxmodules at once, then callsError.captureStackTrace({}), then importsvite. It failed 3 of 3 runs against thetransformAsyncversion 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
packages/uitests 872 pass, 0 fail; root coverage run (--preloadform) 872 pass, exit 0; Storybook unit tests 15 pass;oxfmt --check,oxlint --deny-warningsandtsc -p tsconfig.check.jsonclean; frozen install passes.node_modules: the four workflow test files, run exactly as the workflow does, give 24 pass, 0 fail, and nonode_modulesappears. At the earlier head (5cdb0ce, global preload) the same command gave 0 pass, 4 fail withCannot find module '@babel/core' from packages/ui/tests/helpers/solid-transform.ts. That clean clone has a rootpackage.json, so Bun's auto-install does not apply there; I did not test a runner without one.Impact and rollout
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/**/*.tsxmodules 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 checktypechecking (#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