fix(rsc): fix transformWrapExport with filter and rejectNonAsyncFunction#1254
Merged
Conversation
james-elicx
marked this pull request as ready for review
June 30, 2026 23:29
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
transformWrapExport with filter and rejectNonAsyncFunction
hi-ogawa
approved these changes
Jul 17, 2026
hi-ogawa
left a comment
Contributor
There was a problem hiding this comment.
Hey, thanks for the fix! This looks like a nicely scoped change, so I've adjusted a bit and will be merging. Will try to capture larger picture as I go through other PRs.
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.
Updated description by @hi-ogawa
transformWrapExportcurrently validatesfilter-ed exports and includes them inexportNameseven though their values are not wrapped. It also makes metadata exports fail async validation and reports references that were never registered.This behavior wasn't a problem for rsc plugin's internal use for rsc css transform https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-rsc/README.md#css-support, but is a problem for more general usages such as the integration indicated in #1246.
This PR fixes
transformWrapExportso thatfilterandrejectNonAsyncFunctionoptions andexportNamesreturn value behaves naturally and consistently. It also refinesExportMeta.isFunction: boolean | undefineddetection sofiltercan make use of it more flexibly. The new test is added to cover hopefully all possible patterns ofExportMeta.Original description
Extracted from #1246.
transformWrapExportcurrently validates filtered exports and includes them inexportNameseven though their values are not wrapped. This makes metadata exports fail async validation and reports references that were never registered.This applies filtering before validation/reporting and keeps unresolved identifier exports eligible for wrapping. Tests cover named exports, default exports, and unknown identifier metadata.