Repository navigation
feat: add @sveltejs/adapter-server for the code adapter-node and adapter-bun share - #17308
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/2f6b80802e465a989086bd17f65f4518c28ab138Open in |
🦋 Changeset detectedLatest commit: 2f6b808 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@sveltejs/adapter-server': minor | |||
There was a problem hiding this comment.
Is this supposed to be a patch because it's pre-1.0 for the new package?
| '@sveltejs/adapter-server': minor | |
| '@sveltejs/adapter-server': patch |
There was a problem hiding this comment.
LGTM but I'm a little unclear if we need an npm admin to set up the new @sveltejs/adapter-server package before we release the new bun and node versions. Also unclear how to do that without merging these and the version package PR into main first.
cc: @elliott-with-the-longest-name-on-github
# Conflicts: # packages/adapter-bun/index.js # packages/adapter-bun/src/routes-util.js # packages/adapter-bun/test/routes.spec.ts
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 main, this PR will be updated. # Releases ## @sveltejs/[email protected] ### Major Changes - breaking: automatically build for Cloudflare Workers rather than Cloudflare Pages ([#17479](#17479)) ### Patch Changes - Updated dependencies: - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Major Changes - breaking: use the adapter `worker` option to control if a Worker is built ([#17520](#17520)) - breaking: set the Wrangler config `main` setting automatically ([#17520](#17520)) - breaking: reject `paths.assets`, which can't be served when previewing in workerd ([#17751](#17751)) - breaking: remove Cloudflare Pages support ([#17479](#17479)) - breaking: remove the adapter `fallback` option in favour of Wrangler's `assets.not_found_handling` setting ([#17520](#17520)) ### Minor Changes - feat: support unbundled deployments ([#17520](#17520)) ### Patch Changes - fix: use the Wrangler environment resolved from `CLOUDFLARE_ENV` in `.env` files for platform bindings during development ([#17520](#17520)) - Updated dependencies: - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Minor Changes - feat: add `@sveltejs/adapter-server`, the building blocks shared by adapters that generate a standalone server ([#17308](#17308)) ## @sveltejs/[email protected] ### Minor Changes - feat: allow adapters to disable SvelteKit's Node preview server with `vite.customPreview: true` when providing their own preview implementation ([#17750](#17750)) - feat: add `sveltekit.remote.call.file` attribute to remote function tracing spans ([#17760](#17760)) ### Patch Changes - fix: strip trailing route groups when resolving routes with search parameters or fragments ([#17808](#17808)) - fix: correctly display non-ASCII characters for plain text error messages during development ([#17468](#17468)) - fix: explain missing TypeScript compiler API instead of crashing with TypeScript 7 ([#17539](#17539)) - fix: reject remote function requests that use the wrong HTTP method ([#17740](#17740)) - fix: respect `NO_COLOR` and explicit `FORCE_COLOR` settings in forked build processes ([#17618](#17618)) ## @sveltejs/[email protected] ### Patch Changes - fix: honour q-values in `Accept-Encoding` and serve dotfiles below `.well-known`, matching `@sveltejs/adapter-node` ([#17308](#17308)) - Updated dependencies: - @sveltejs/[email protected] - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Patch Changes - chore: build on `@sveltejs/adapter-server` ([#17308](#17308)) - Updated dependencies: - @sveltejs/[email protected] - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Patch Changes - fix: avoid build warnings for missing optional peer dependencies ([#17802](#17802)) - Updated dependencies: - @sveltejs/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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 main, this PR will be updated. # Releases ## @sveltejs/[email protected] ### Major Changes - breaking: automatically build for Cloudflare Workers rather than Cloudflare Pages ([#17479](sveltejs/kit#17479)) ### Patch Changes - Updated dependencies: - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Major Changes - breaking: use the adapter `worker` option to control if a Worker is built ([#17520](sveltejs/kit#17520)) - breaking: set the Wrangler config `main` setting automatically ([#17520](sveltejs/kit#17520)) - breaking: reject `paths.assets`, which can't be served when previewing in workerd ([#17751](sveltejs/kit#17751)) - breaking: remove Cloudflare Pages support ([#17479](sveltejs/kit#17479)) - breaking: remove the adapter `fallback` option in favour of Wrangler's `assets.not_found_handling` setting ([#17520](sveltejs/kit#17520)) ### Minor Changes - feat: support unbundled deployments ([#17520](sveltejs/kit#17520)) ### Patch Changes - fix: use the Wrangler environment resolved from `CLOUDFLARE_ENV` in `.env` files for platform bindings during development ([#17520](sveltejs/kit#17520)) - Updated dependencies: - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Minor Changes - feat: add `@sveltejs/adapter-server`, the building blocks shared by adapters that generate a standalone server ([#17308](sveltejs/kit#17308)) ## @sveltejs/[email protected] ### Minor Changes - feat: allow adapters to disable SvelteKit's Node preview server with `vite.customPreview: true` when providing their own preview implementation ([#17750](sveltejs/kit#17750)) - feat: add `sveltekit.remote.call.file` attribute to remote function tracing spans ([#17760](sveltejs/kit#17760)) ### Patch Changes - fix: strip trailing route groups when resolving routes with search parameters or fragments ([#17808](sveltejs/kit#17808)) - fix: correctly display non-ASCII characters for plain text error messages during development ([#17468](sveltejs/kit#17468)) - fix: explain missing TypeScript compiler API instead of crashing with TypeScript 7 ([#17539](sveltejs/kit#17539)) - fix: reject remote function requests that use the wrong HTTP method ([#17740](sveltejs/kit#17740)) - fix: respect `NO_COLOR` and explicit `FORCE_COLOR` settings in forked build processes ([#17618](sveltejs/kit#17618)) ## @sveltejs/[email protected] ### Patch Changes - fix: honour q-values in `Accept-Encoding` and serve dotfiles below `.well-known`, matching `@sveltejs/adapter-node` ([#17308](sveltejs/kit#17308)) - Updated dependencies: - @sveltejs/[email protected] - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Patch Changes - chore: build on `@sveltejs/adapter-server` ([#17308](sveltejs/kit#17308)) - Updated dependencies: - @sveltejs/[email protected] - @sveltejs/[email protected] ## @sveltejs/[email protected] ### Patch Changes - fix: avoid build warnings for missing optional peer dependencies ([#17802](sveltejs/kit#17802)) - Updated dependencies: - @sveltejs/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@sveltejs/adapter-node](https://svelte.dev/docs/kit/adapter-node) ([source](https://github.com/sveltejs/kit/tree/HEAD/packages/adapter-node)) | [`6.0.2` → `6.0.5`](https://renovatebot.com/diffs/npm/@sveltejs%2fadapter-node/6.0.2/6.0.5) |  |  | --- ### Release Notes <details> <summary>sveltejs/kit (@​sveltejs/adapter-node)</summary> ### [`v6.0.5`](https://github.com/sveltejs/kit/blob/HEAD/packages/adapter-node/CHANGELOG.md#605) [Compare Source](https://github.com/sveltejs/kit/compare/@sveltejs/[email protected]...@sveltejs/[email protected]) ##### Patch Changes - chore: build on `@sveltejs/adapter-server` ([#​17308](sveltejs/kit#17308)) - Updated dependencies: - [@​sveltejs/adapter-server](https://github.com/sveltejs/adapter-server)@0.1.0 - [@​sveltejs/kit](https://github.com/sveltejs/kit)@3.4.0 ### [`v6.0.4`](https://github.com/sveltejs/kit/blob/HEAD/packages/adapter-node/CHANGELOG.md#604) [Compare Source](https://github.com/sveltejs/kit/compare/@sveltejs/[email protected]...@sveltejs/[email protected]) ##### Patch Changes - fix: replace the port in the forwarded host with `PORT_HEADER` instead of appending a second one ([#​17779](sveltejs/kit#17779)) - Updated dependencies: - [@​sveltejs/kit](https://github.com/sveltejs/kit)@3.3.0 ### [`v6.0.3`](https://github.com/sveltejs/kit/blob/HEAD/packages/adapter-node/CHANGELOG.md#603) [Compare Source](https://github.com/sveltejs/kit/compare/@sveltejs/[email protected]...@sveltejs/[email protected]) ##### Patch Changes - fix: set `X-Accel-Buffering: no` on `text/event-stream` responses whose content type has parameters, such as `charset=utf-8` ([#​17687](sveltejs/kit#17687)) - Updated dependencies: - [@​sveltejs/kit](https://github.com/sveltejs/kit)@3.2.1 </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTUuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
adapter-nodeandadapter-buneach carry their own copy of the Vite hook that bundles the server runtime with the app, the dotfile filter,ADDRESS_HEADERandXFF_DEPTHhandling, andAccept-Encodingnegotiation. The copies already disagree: negotiation honours q-values inadapter-node/src/static.jsand only checks forq=0inadapter-bun/src/routes-util.js.This adds
@sveltejs/adapter-server, a published package with those four pieces, and makes both adapters use it.@sveltejs/adapter-serverexportsbundleRuntimeandisHiddenfor an adapter's build, and@sveltejs/adapter-server/runtimeexportsnegotiateEncodingandforwardedAddressfor the generated server. The runtime functions are bundled into the app with the rest of the adapter's runtime, so the build output does not depend on the package.adapter-node's behaviour is unchanged. adapter-bun now honours q-values and serves dotfiles below
.well-known, as adapter-node does.Env parsing and origin detection are still duplicated, because the two adapters validate them differently and sharing them changes the behaviour of one or the other.