Repository navigation
fix(dev): keep a shared stylesheet in its first position - #431
Merged
Merged
Conversation
In start mode dev, a stylesheet imported by both the entry graph and a lazy component is rendered twice in the shell. When both copies were server-rendered, the dev style patch removed the earlier one, so the stylesheet moved after the lazy component's styles. The patch now removes the later copy in that case, and skips tags that were already removed. Fixes #425 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: b0887c0 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 #425.
In start mode dev, a stylesheet shared by the entry graph and a lazy component now keeps its first position in
<head>, as in production. Before, it moved after the lazy component's own styles, so equal-specificity overrides in the lazy component lost.Changes
Testing
examples/start-ssr/test/style-patch.mjs. It runs the patch in jsdom for streamed copies, batched copies, and both orders of a server-rendered tag and a Vite tag..cornerresolves toposition: absolute, and editingbutton.cssstill hot-updates it.examples/start-ssrsuite (node test/run.mjs) passes 749/749.pnpm test:unitpasses.🤖 Generated with Claude Code