Repository navigation
fix: invalidate dev manifest CSS in isolated SSR runners - #417
Open
everton-dgn wants to merge 1 commit into
Open
everton-dgn wants to merge 1 commit into
everton-dgn wants to merge 1 commit into
Conversation
Send cache invalidation over the server environment's HMR channel after Vite processes a file change. Guard pending responses by generation so older work cannot restore stale CSS or remove a newer pending request. Keep warm lookups synchronous for SSR render retries. Add regression coverage for CSS edits, delayed watchChange hooks, overlapping requests, failures and listener replacement. Fixes solidjs#415
🦋 Changeset detectedLatest commit: 81555d8 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.
Fixes #415
The HTTP bridge returns fresh CSS after an edit, but an isolated SSR runner keeps the first successful response in its manifest cache. Later SSR responses therefore retain the old styles until that module is evaluated again.
Send a custom event on the server environment's HMR channel after Vite invalidates its transforms. The manifest clears its cache when it receives that event. Generation checks prevent older requests from restoring stale entries or deleting newer pending work. Warm lookups still return synchronously, as required by SSR render retries.
The new tests use the same manifest instance throughout each edit. They cover delayed
watchChangehooks, overlapping requests, failed requests and listener replacement, and run in CI after the plugin build.Validation:
pnpm buildpassed, including declaration generation.watchChangetest also failed against the first version of the fix.18pxto36pxnow appears in the next SSR response without a restart or hydration. This reproduction delays manifest loading until HTTP startup to isolate Dev manifest bridge keeps stale CSS after an edit #415 from the separate startup bug in Dev manifest loses lazy CSS when imported before HTTP startup #414.pnpm testcommand could not run its cases locally: Cypress was killed withSIGKILLduring its startup smoke test on macOS.Invalidation uses the runner's HMR transport. Workerd and configurations with HMR disabled were not exercised.
Related: #414 covers imports before HTTP startup. The two fixes touch the same resolver; combining them requires preserving both the generation check and the
!bridgeMissingcache guard. Each fix was tested separately.