Skip to content

feat(rsc): validate inline action lexical expressions#1260

Open
james-elicx wants to merge 2 commits into
vitejs:mainfrom
james-elicx:codex/rsc-reject-lexical-server-functions
Open

feat(rsc): validate inline action lexical expressions#1260
james-elicx wants to merge 2 commits into
vitejs:mainfrom
james-elicx:codex/rsc-reject-lexical-server-functions

Conversation

@james-elicx

Copy link
Copy Markdown
Contributor

Extracted from #1246.

Hoisting a directive function changes the meaning of lexical this, super, and arguments. Custom directives that require semantic preservation need a transform-level way to reject these expressions.

This adds opt-in validation scoped to the transformed function, skips nested function scopes, and allows the JSX dev helper source-metadata this argument. Tests cover every rejected expression and both exceptions.

@james-elicx james-elicx marked this pull request as ready for review June 30, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant