Skip to content

feat: add @sveltejs/adapter-server for the code adapter-node and adapter-bun share - #17308

Merged
Nic-Polumeyv merged 4 commits into
mainfrom
adapter-server
Nov 18, 2026
Merged

Nic-Polumeyv merged 4 commits into
mainfrom
adapter-server

Conversation

@Nic-Polumeyv

Copy link
Copy Markdown
Member

adapter-node and adapter-bun each carry their own copy of the Vite hook that bundles the server runtime with the app, the dotfile filter, ADDRESS_HEADER and XFF_DEPTH handling, and Accept-Encoding negotiation. The copies already disagree: negotiation honours q-values in adapter-node/src/static.js and only checks for q=0 in adapter-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-server exports bundleRuntime and isHidden for an adapter's build, and @sveltejs/adapter-server/runtime exports negotiateEncoding and forwardedAddress for 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.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 2f6b808:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/2f6b80802e465a989086bd17f65f4518c28ab138

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/17308

@changeset-bot

changeset-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f6b808

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@sveltejs/adapter-bun Patch
@sveltejs/adapter-node Patch
@sveltejs/adapter-server Minor

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

@Nic-Polumeyv
Nic-Polumeyv marked this pull request as ready for review October 2, 2026 21:28
Comment thread packages/adapter-server/index.js Resolved
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-server': minor

@teemingc teemingc Nov 5, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this supposed to be a patch because it's pre-1.0 for the new package?

Suggested change
'@sveltejs/adapter-server': minor
'@sveltejs/adapter-server': patch

@teemingc teemingc left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
@Nic-Polumeyv
Nic-Polumeyv merged commit 1bd5652 into main Nov 18, 2026
39 of 40 checks passed
@Nic-Polumeyv
Nic-Polumeyv deleted the adapter-server branch November 18, 2026 15:27
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
teemingc pushed a commit that referenced this pull request Nov 18, 2026
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>
github-actions Bot added a commit to clement-songis/sveltekit-adapter-bun that referenced this pull request Nov 23, 2026
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>
dadezzz pushed a commit to dadezzz/events-cash-register that referenced this pull request Nov 25, 2026
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) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@sveltejs%2fadapter-node/6.0.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@sveltejs%2fadapter-node/6.0.2/6.0.5?slim=true) |

---

### Release Notes

<details>
<summary>sveltejs/kit (@&#8203;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` ([#&#8203;17308](sveltejs/kit#17308))
- Updated dependencies:
  - [@&#8203;sveltejs/adapter-server](https://github.com/sveltejs/adapter-server)@0.1.0
  - [@&#8203;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 ([#&#8203;17779](sveltejs/kit#17779))
- Updated dependencies:
  - [@&#8203;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` ([#&#8203;17687](sveltejs/kit#17687))
- Updated dependencies:
  - [@&#8203;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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-platform-tests This PR needs to run platform tests in order to merge. pkg:adapter-bun pkg:adapter-node

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants