Repository navigation
fix(babel-plugin): preserve source locations for SSR captures - #3783
Conversation
🦋 Changeset detectedLatest commit: 506eb5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
Merging this PR will not alter performance
Comparing Footnotes
|
|
Port #3783 to the native compiler: each captured binding argument of a hoisted SSR props constructor carries the span of the binding's first authored reference instead of a dummy span, so source maps point at the authored expression rather than the start of the JSX element. The source-map checks from #3783 move to a shared expectation module (babel-plugin/test/__shared_fixtures__/ssrCaptureMaps) that both the Babel spec and a new native suite run against. Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Hoisted SSR props constructors created capture arguments without source locations. Their source-map entries inherited nearby positions: in a dynamic TSRX tag, a capture at column 21 mapped to column 27.
Use the location of the first authored reference for each captured binding when building the constructor arguments. Keep comments attached to the original reference. Add map assertions for dynamic tags, repeated getters, refs, Unicode, and nested shadowing in development and production.
Validation: