Skip to content

feat: fetchable dev environments#15574

Draft
teemingc wants to merge 87 commits intoversion-3from
fetchable-dev-environment
Draft

feat: fetchable dev environments#15574
teemingc wants to merge 87 commits intoversion-3from
fetchable-dev-environment

Conversation

@teemingc
Copy link
Copy Markdown
Member

@teemingc teemingc commented Mar 20, 2026

This PR implements an SSR environment as a FetchableDevEnvironment. This means that it does not share the same Node process as the Vite host process. This will help ensure that it works with other fetchable dev environments. It also removes the adapter.emulate option in favour of allowing adapters to provide their own Vite plugins to run customised config, configureServer, configurePreviewServer, and buildApp hooks.

Any non-POJO data we were previously passing to the SvelteKit server now has to be communicated via a virtual module or through the HMR API import.meta.hot. Instances of ssrLoadModule have also been replaced with the environment module runner.

TODOs

  • fetchable dev inlined css to avoid fouc
  • fetchable dev param matchers
    - [ ] vite preview
  • refactor node dev server to use the environment API
  • write up a proper PR description
  • changesets
  • docs (will probably do this in the cloudflare vite plugin PR once we add a public server export)

Future PRs

  • adapter-static environment
  • adapter-node environment
  • adapter-netlify environment
  • run prerender using ssr environment
  • run analysis using ssr module runner

EDIT: I've split the cloudflare changes into a separate PR so that it will be easier to review the changes. Until then, test-others will fail because adapter.emulator has been removed


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: 764b56e

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Major

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

@teemingc teemingc changed the title feat: fetchable dev environment feat: fetchable dev environments Mar 20, 2026
@teemingc teemingc changed the base branch from main to version-3 March 20, 2026 09:59
@svelte-docs-bot
Copy link
Copy Markdown

@teemingc teemingc marked this pull request as ready for review March 31, 2026 20:56
@teemingc teemingc marked this pull request as draft April 1, 2026 02:10

test.describe.configure({ mode: 'parallel' });

test.describe('adapter', () => {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These might be better tested in the adapters themselves now that they have a more comprehensive test suite

@teemingc
Copy link
Copy Markdown
Member Author

teemingc commented Apr 4, 2026

/autofix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant