fix(rsc): preserve exported client reference subpaths#1257
Open
NathanDrake2406 wants to merge 1 commit into
Open
fix(rsc): preserve exported client reference subpaths#1257NathanDrake2406 wants to merge 1 commit into
NathanDrake2406 wants to merge 1 commit into
Conversation
commit: |
7298896 to
e8146be
Compare
Client reference dedupe currently rewrites every package file imported through the RSC package proxy back to the package root. That loses subpath identity when a package exposes client modules through an exported subpath instead of its root barrel. The plugin now derives a bare import specifier from package metadata, preserving exact and pattern exports while keeping private internals on the package root so existing context dedupe behavior stays intact. Regression coverage exercises exported subpaths, scoped packages, export patterns, private internals, and legacy deep imports.
e8146be to
717e266
Compare
Collaborator
|
/bigbonk review |
Contributor
|
@james-elicx Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk 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.
Overview
Why
Client reference identity has to preserve the module boundary that the framework means to load. Collapsing every package file to the package root only works when the root barrel re-exports the same binding. For exported subpaths, that changes the import contract and can make valid package subpath references fail or bind to the wrong module.
What changed
Maintainer review path
packages/vinext/src/plugins/client-reference-dedup.ts
tests/client-reference-dedup.test.ts
Validation
Risk / compatibility
Non-goals
References