Skip to content

Use a current Bun runtime for development reloads - #179

Merged
tonyfresher merged 5 commits into
mainfrom
fix/dev-query-client-hmr
Oct 29, 2026
Merged

tonyfresher merged 5 commits into
mainfrom
fix/dev-query-client-hmr

Conversation

@tonyfresher

@tonyfresher tonyfresher commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Bun 1.3.10 can lose TanStack Query re-exports after frontend rebuilds, producing QueryClient is not a constructor until the server restarts (report, upstream fix). Development now requires Bun 1.4.4, checks the version before startup, and keeps server children on the launcher's executable. The TanStack-specific HMR plugin is removed.

bun upgrade --version 1.4.4
bun install --frozen-lockfile
bun run dev

CI and release setup read packageManager; the explicit bun >=1.4.4 development dependency prevents an older transitive Bun from taking over package scripts. The lockfile resolves Bun 1.4.4.

Linux CI exposed a separate native-library interaction: a Bun.secrets.get() probe loads system GLib/GObject even when it fails with libsecret not available; subsequent Sharp image processing segfaults. This reproduces in a small standalone process, with either import order. Updating Sharp to 0.35.5 did not resolve the full-suite crash. CI and release tests now use the existing MOI_SECRET_BACKEND=file setting with normal bun test. Per-file isolation and temporary diagnostics have been removed. Production keychain behavior is unchanged.

Validation: Linux and Windows CI pass on ecacf2ff. Linux runs all 2,397 tests across 251 files in one process with zero failures; frozen install, lint, formatting, registry validation, repository checks, typecheck, and package inspection also pass. The 25 focused dependency-reload, attachment, and secret-store tests pass locally.

Some dependency edits still trigger automatic full-page reloads; state-preserving Fast Refresh is not guaranteed for every edit.

Reject development runtimes older than the packageManager baseline, preserve
the checked executable for server children, and remove the TanStack HMR
acceptance workaround. Document the upstream QueryClient re-export bug and
the separate automatic browser reload limitation.

Validated 28 frontend edits on Bun 1.3.14, generated Tailwind CSS, stylesheet
updates and fresh-tab loading. Launcher tests, typecheck, repository checks
and formatting pass; lint reports existing warnings only.
Keep the version check in the existing server launcher and consolidate its
tests. Remove the standalone development guide; retain only the short setup
note, with investigation details in the PR. Adapt the existing CLI capture
fixture to the executable-preserving child launch.

Validated 36 launcher and CLI tests, typecheck, lint, formatting and repository
checks. Sandbox DNS and orphan-worker test failures reproduce on unchanged main.
Comment thread package.json Outdated
"@types/react-dom": "^19.2.7",
"@types/react-grid-layout": "^2.1.0",
"@types/react-resizable": "^3.0.8",
"bun": "1.3.14",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should be?

Suggested change
"bun": "1.3.14",
"bun": ">1.3.14",

@tonyfresher tonyfresher changed the title Require a fixed Bun runtime for development reloads Use a current Bun runtime for development reloads Oct 29, 2026
@tonyfresher
tonyfresher force-pushed the fix/dev-query-client-hmr branch from ecacf2f to f0edd0a Compare October 29, 2026 16:04
@tonyfresher
tonyfresher requested a review from molefrog October 29, 2026 16:07
@tonyfresher
tonyfresher merged commit 6ceb570 into main Oct 29, 2026
2 checks passed
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