Repository navigation
fix(router-plugin): export a shared binding as-is when a split route option uses it - #8773
dasjideepak wants to merge 1 commit into
Conversation
…option uses it When a split route option (like notFoundComponent) points to a local function that another split group also uses, the virtual module exported SplitNotFoundComponent without declaring it. This happened whenever the earlier scope cache was not reused, for example with two copies of @babel/traverse installed. Fixes TanStack#8715
🦋 Changeset detectedLatest commit: 429ff7c The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
🎯 Changes
Fixes #8715
A split option like
notFoundComponent: PostNotFound, wherePostNotFoundis also used by another split group, made the virtual module exportSplitNotFoundComponentwithout declaring it. It only worked with a single@babel/traversecopy, through the stale scope cache.Fix: when the option's identifier is a shared binding, export the shared import directly.
code-splitter-shared-split-target.test.tsfornotFoundComponentanderrorComponent. It clears the traverse cache after the first pass, which is what a second traverse copy does. Fails on main, passes with the fix.@babel/traverse7.29.8 + 7.29.10): the output now matches the single-copy one.✅ Checklist
🚀 Release Impact
AI disclosure: I used an AI assistant to help write the test and this text. I reproduced the bug, reviewed the change and ran the tests myself.