Repository navigation
fix(server-functions): keep the dev manifest fast and current - #432
Merged
Merged
Conversation
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 detectedLatest commit: e7cc602 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 |
commit: |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #427.
Two fixes to the server-function manifest in dev.
@cloudflare/vite-plugin. The first call after startup, a restart, or a new"use server"file used to wait that second."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
virtual:solid-server-function-manifestnow returns the current module list right away.Testing
src/server-functions/manifest.test.ts. It starts a dev server and loads the manifest after each change."use server"directive is removed must no longer be imported. Without the fix it is still imported.@cloudflare/vite-plugin1.64.0,wrangler4.151.0, Vite 8.3.4, Solid 2.0.0-rc.15) in headless Chrome."use server"file added while the server runs is callable without a restart.greet()still works. On 3.0.0-next.50 the page returns 500 withFailed to load url /src/shout.ts ... in virtual:solid-server-function-manifest.pnpm test:unitandtsc --noEmitpass.🤖 Generated with Claude Code