Repository navigation
Conversation
- The generated client entry imports the configured module ahead of the app, so it runs before hydrate() in SSR mode and before render() in client mode. - A top-level await in the module delays hydrate()/render() until it settles. - It is a static import, so the app stays in the entry chunk and the server still preloads its chunks and links its CSS. - The module joins the dep-scan entries. - An authored entry-client together with the option is a config error. - The README start options list now also names `instrument`. Closes #419. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: fe5be7b 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: |
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.
Closes #419.
Adds
start.clientSetup, a module that the generated client entry runs beforehydrate()orrender().Changes
start.clientSetupis a path inside the Vite root. It is validated the same way asstart.instrumentandstart.setup.@solidjs/weband the app.hydrate()withssr: trueand beforerender()without it, so the option keeps working whenssrchanges.awaitin the module delayshydrate()orrender()until it settles.entry-clientis a config error, the same rule asstart.setup.clientSetupsection. The list of start options now also includes the missinginstrument.Design choice
The module is a static first import, not
await import()asstart.instrumentdoes on the server.await import(), the app would move into a separate chunk. The server would no longer preload it or link its CSS, which causes a waterfall and unstyled content.hydrate()orrender(), because the app's modules evaluate while it awaits.<ClientEntry />(option 2 in the issue) is not included. Placing the entry script in the document is a separate design decision.Testing
client-setupmode toexamples/start-ssr/test/run.mjs. In Chrome, for dev and prod, it checks that:hydrate()waits for its top-levelawait;start-ssrmodesclient-setup20/20,dev80/80,entries21/21 andprod77/77 pass. Thestart-clientsuite passes 70/70.pnpm test:unitandtsc --noEmitpass.🤖 Generated with Claude Code