Conversation
Improves confidence in transform metadata by validating how transition and head propagation flags are derived across key directive combinations. Prevents regressions by confirming that only actual transition directives enable transition handling, while defer-only rendering still preserves head propagation.
Prevents deferred server rendering from being treated as a transition feature. Keeps head propagation enabled for deferred content, while only transition-specific attributes trigger transition state and related scoping.
🦋 Changeset detectedLatest commit: 0012bc8 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 |
viewtransition.css when server:defered was used without transition.* directives
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where server:defer was incorrectly treated as a transition directive, causing unnecessary inclusion of ViewTransitions CSS. The fix separates the handling of server:defer from actual transition directives (transition:animate, transition:name, transition:persist), ensuring that only genuine transition directives set the doc.Transition flag while both can enable head propagation independently.
Changes:
- Separated
server:deferdetection from transition directive detection in the transform logic - Added comprehensive test coverage for the transition flag and head propagation behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/transform/transform.go | Splits the conditional logic to handle server:defer separately from transition directives, preventing it from incorrectly setting doc.Transition |
| internal/transform/transform_test.go | Adds regression tests verifying that server:defer alone doesn't trigger transition behavior while transition directives do |
| .changeset/brown-tires-melt.md | Documents the bug fix in the changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
viewtransition.css when server:defered was used without transition.* directivesviewtransition.css when server:defer was used without transition.* directives
Changes
server:deferfrom transition detection in internal/transform/transform.go.doc.Transition+ transition scope are now only set whentransition:animate,transition:name, ortransition:persistare present.server:deferwithout enabling transition behavior.server:deferonly → no transition flag, head propagation enabledCloses #1148
Testing
go test ./internal/transform.Docs