Skip to content

fix(server-functions): keep the dev manifest fast and current - #432

Merged
ryansolid merged 2 commits into
nextfrom
fix/427-dev-manifest-debounce
Oct 21, 2026
Merged

ryansolid merged 2 commits into
nextfrom
fix/427-dev-manifest-debounce

Conversation

@lxsmnsyc

@lxsmnsyc lxsmnsyc commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Fixes #427.

Two fixes to the server-function manifest in dev.

  • The manifest no longer waits 1 second before it loads. This affected setups where another plugin runs the SSR environment, such as @cloudflare/vite-plugin. The first call after startup, a restart, or a new "use server" file used to wait that second.
  • Deleting a "use server" file no longer breaks the dev server. Before, the manifest kept importing the deleted file, and every request returned 500 until a restart.

Changes

  • In dev, virtual:solid-server-function-manifest now returns the current module list right away.
    • Each transform that registers a new server-function module already invalidates the manifest.
    • A function's module is always transformed before it can be called, so the current list is complete when it is needed.
    • Builds keep the debounce. A build has no other signal that all transforms are done.
  • In dev, a module is now removed from the manifest when its file is deleted, or when it is transformed again without any server functions.
    • Its client-function records are removed too, and the function id index is rebuilt.
    • The manifest is invalidated the same way as for an added module.
    • Builds are unchanged.

Testing

  • Added src/server-functions/manifest.test.ts. It starts a dev server and loads the manifest after each change.
    • Each load must list newly added modules and finish in under 500 ms. Without the fix it fails at about 1016 ms.
    • A deleted module must no longer be imported. Without the fix it is still imported.
    • A module whose "use server" directive is removed must no longer be imported. Without the fix it is still imported.
  • Ran the repro from the issue with the same versions (@cloudflare/vite-plugin 1.64.0, wrangler 4.151.0, Vite 8.3.4, Solid 2.0.0-rc.15) in headless Chrome.
    • On 3.0.0-next.50 each manifest load takes about 1001 ms. With the fix each load takes under 1 ms.
    • A "use server" file added while the server runs is callable without a restart.
    • After that file is deleted, the page returns 200 and greet() still works. On 3.0.0-next.50 the page returns 500 with Failed to load url /src/shout.ts ... in virtual:solid-server-function-manifest.
  • pnpm test:unit and tsc --noEmit pass.

🤖 Generated with Claude Code

When another plugin owns the SSR environment, the generated handler
imports the server function manifest in dev. Every load waited the
1,000 ms build debounce, so startup, restarts and the first call to a
new function were a second slower. Dev now returns the current list.
New modules still invalidate the manifest when they are transformed.

Fixes #427

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e7cc602

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

This PR includes changesets to release 1 package
Name Type
@solidjs/vite-plugin Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/vite-plugin@432

commit: e7cc602

The dev manifest only ever added modules. After a "use server" file was
deleted, the manifest kept importing it, and every request failed with
"Failed to load url" until the dev server restarted. A file that dropped
its directive also stayed listed.

In dev, a module is now removed from the manifest, with its client
function records, when the watcher reports it deleted or when a
re-transform finds no server functions. The manifest is invalidated the
same way as for additions. Builds are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@lxsmnsyc lxsmnsyc changed the title fix(server-functions): skip the manifest debounce in dev fix(server-functions): keep the dev manifest fast and current Oct 19, 2026
@ryansolid
ryansolid merged commit 909d781 into next Oct 21, 2026
6 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