breaking: require Bun 1.4 - #16880
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/d1dc5581dbbc5d4a2bd5c55feeeccee4e91fb32dOpen in |
🦋 Changeset detectedLatest commit: d1dc558 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I investigated this failed test run and found that This is a pre-existing test synchronization race, not a regression caused by the adapter-bun PR. |
c9c4d70 to
6a3dacb
Compare
Bun 1.4 routes HEAD to a GET handler, so routes no longer register both methods, and its stop() promise settles after a force close, so the timer that bounded that wait is gone. Both make 1.4 the floor: CI, the docs and engines now say so.
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
78910ec to
d1dc558
Compare
9a73d3b
into
version-3
The side-effect chunk workaround in `packages/adapter-bun/index.js`
registers `build.onResolve({ filter: /\.js$/ })` and returns undefined
for anything outside `server/chunks/`. A `Bun.build` hook that matches
without resolving sends Bun to the filesystem, past the `files` virtual
entries. An app with `src/instrumentation.server.js` gets a virtual
`src/start.js` entrypoint that exists nowhere on disk, so its build
fails with `ModuleNotFound resolving ".../adapter-bun/src/start.js"
(entry point)`.
The plugin now reads `server/chunks/` once up front, keeps the stubs it
matches in `side_effect_sources`, and builds `side_effect_filter` from
their basenames, so no other specifier reaches the hook. A path that
still matches without being a stub resolves to its virtual entry when
there is one.
The non-GET e2e test posted an `http` origin, which fails the CSRF check
against the `https` origin the adapter computes.
`platform-tests-bun.yml` runs on `workflow_dispatch` only, so neither of
these showed up in CI.
#16880 is stacked on this.
The specs now run under `bun test`, with real `Bun.semver`, `Bun.file`, and `Bun.env`, and `spyOn` recording calls where assertions need them. `Bun.serve` and the `Bun.build` pipeline stay test doubles so the tests don't bind sockets or bundle. The build-generated modules (`MANIFEST`, `ROUTES`, `SERVER`, `SERVER_OPTIONS`) are still mocked, and since `mock.module` fixes a module's export names on first registration, `test/mocks.ts` registers each with the union of exports its consumers use. Loads that need a fresh evaluation import with a unique query string, as there is no `vi.resetModules`. `Bun.version` and the `Bun` global are frozen inside Bun, so the 1.4-floor guard is tested by spying `Bun.semver.order` plus assertions pinning the real comparator's verdicts, canaries being the reason it uses `order()`. The build-must-run-in-Bun error comes from running the adapter under a Node subprocess. CI installs Bun 1.4.0 in the `test:others` legs. Stacked on #16880.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to version-3, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `version-3` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `version-3`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @sveltejs/adapter-bun@1.0.0-next.2 ### Major Changes - breaking: require Bun 1.4, which routes `HEAD` to `GET` handlers and settles `stop()` after a force close ([#16880](#16880)) ### Patch Changes - fix: build apps that use server instrumentation ([#16898](#16898)) - Updated dependencies [[`ff8cdd4`](ff8cdd4), [`723572c`](723572c), [`3b8e034`](3b8e034), [`f2c5102`](f2c5102), [`c66a6ed`](c66a6ed), [`428e5ef`](428e5ef)]: - @sveltejs/kit@3.0.0-next.26 ## @sveltejs/adapter-node@6.0.0-next.11 ### Patch Changes - chore: remove polka, attach the handler to the http server directly ([#16907](#16907)) - Updated dependencies [[`ff8cdd4`](ff8cdd4), [`723572c`](723572c), [`3b8e034`](3b8e034), [`f2c5102`](f2c5102), [`c66a6ed`](c66a6ed), [`428e5ef`](428e5ef)]: - @sveltejs/kit@3.0.0-next.26 ## @sveltejs/kit@3.0.0-next.26 ### Patch Changes - fix: only require the `svelte-trusted-html` trusted-types policy when client-side code is shipped, allowing builds where all pages have `csr: false` ([#16928](#16928)) - chore: stop externalizing `cookie` dependency during build ([#16936](#16936)) - fix: preserve metadata on streamed page responses ([#16935](#16935)) - fix: error on server-only imports reachable from hooks or service worker files outside the project root ([#16912](#16912)) - fix: copy worker files emitted by the server build to the client output directory ([#16929](#16929)) - fix: Reject all pending query promises when a query fails before resolving with a value for the first time ([#16890](#16890)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fixes a pre-existing Playwright synchronization race found while investigating [#16880](#16880) and its [failed workflow run](https://github.com/sveltejs/kit/actions/runs/32514227006). `page.waitForLoadState('networkidle')` could return immediately because network idle had already been reached before the client-side redirect navigation. The following raw DOM read could then observe stale state. Replace it with a web-first `toHaveText` assertion that waits for the expected navigation callback state. Verification included 100 repetitions with four workers, the complete client spec, the original 4-worker shard, and server/client route-resolution variants. This is test-only, so no changeset is included. Co-authored-by: svelte-triage-bot <team@svelte.com>
Stacked on #16898
Follow-ups to the Bun 1.4 release.
HEADnow reachesGEThandlers andstop()settles after a force close, so routes stop registering both methods and shutdown stops racing a timer. That makes 1.4 the floor.