test(unhead): resolve reactive root entry input#777
Merged
Conversation
walkResolver already applies the resolver chain at the root, so the explicit pre-call meant every entry input hit each propResolver twice at the top level (inherited from v3). Resolvers must now tolerate a single root pass; all framework adapter resolvers are unwrap-style and unaffected.
📝 WalkthroughWalkthroughAdds clarifying comments in ChangesClarify resolver behavior & SSR tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Bundle Size Analysis
|
…function inputs
Reverts the single-root-resolve optimization. walkResolver unwraps function
values before applying resolvers, so a resolvable yielding a function (e.g.
useHead(ref(() => ({...}))), the vite-pwa/vite-plugin-pwa#832 class of input)
only renders when an explicit resolve pass runs first; the root passing
through the resolver chain twice is intentional. Adds a comment encoding the
reason and regression tests for both root shapes so the pre-call doesn't get
optimized away again.
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.
🔗 Linked issue
Follow-up to #776 / the CodeRabbit "avoid resolving the root input twice" thread.
❓ Type of change
📚 Description
This PR originally removed the explicit root resolve in
normalizeEntryToTagssincewalkResolveralso resolves the root, making it look like a redundant double pass. Digging into history showed it is intentional:walkResolverunwraps function values before applying resolvers, so a resolvable that yields a function, e.g.useHead(ref(() => ({...}))), only renders if a resolve pass runs first. The pre-call dates to a255df0 (fix(vue): broken reactivity, the vite-pwa/vite-plugin-pwa#832 input class), and the full test suite passed without it because only the plain-ref root shape had coverage.The optimization is reverted here. What lands instead:
root-shapes.test.tscovering both root shapes (ref({...})andref(() => ({...}))); the second fails against the "optimized" versionNet behavior change vs main: none.
Summary by CodeRabbit
Tests
Chore