Skip to content

test(rsc): add e2e for react source map features - #1358

Merged
hi-ogawa merged 17 commits into
mainfrom
server-reference-source-location-e2e
Jul 30, 2026
Merged

hi-ogawa merged 17 commits into
mainfrom
server-reference-source-location-e2e

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR adds a dedicated examples/source-map e2e for React development source-location features. There were some manual test cases in examples/basic and those are ported over to new fixture. Furthermore, many server reference variants are added.

This PR only prepares the infra so we can verify source map fix and also catch regression of currect one in the future.

Add a dedicated development fixture that follows React's eval-backed Server Function proxy through CDP and resolves its advertised Vite source map to the original export.

Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa and others added 3 commits July 30, 2026 17:54
Organize manual Server Function source-location patterns under feature routes while keeping the CDP assertion focused on the named-function baseline.

Co-authored-by: OpenCode <noreply@opencode.ai>
Document Chrome and React DevTools workflows for navigating from each received Server Function proxy to its original source declaration.

Co-authored-by: OpenCode <noreply@opencode.ai>
Rename the fixture and add concise routes for React Server Reference definitions, transported server errors, console replay, and a client error baseline with manual DevTools instructions.

Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa hi-ogawa changed the title test(rsc): verify server reference source location test(rsc): verify React source maps Jul 30, 2026
@hi-ogawa hi-ogawa changed the title test(rsc): verify React source maps test(rsc): add e2e for React source map features Jul 30, 2026
@hi-ogawa hi-ogawa changed the title test(rsc): add e2e for React source map features test(rsc): add e2e for react source map features Jul 30, 2026
hi-ogawa added 2 commits July 30, 2026 18:42
Avoid coupling the CDP check to React's synthetic script URL and document the generic V8 function-location mechanism used to resolve the advertised source map.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
Exercise every Server Reference fixture through a shared CDP resolver and record current source locations, including approximate mappings that can be improved in follow-up work.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa added 3 commits July 30, 2026 18:55
Clarify that issue #1356 establishes verification infrastructure and link the observed inaccurate mappings to follow-up issue #1361.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
Restore the source-position invariant now that the browser-level coverage identifies unresolved module export and inline directive shapes.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
Use the repository's async disposable convention for reliable CDP session cleanup without an explicit try/finally block.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa
hi-ogawa marked this pull request as ready for review July 30, 2026 10:02
Comment on lines +91 to +102
{
route: '/inline-directive',
references: [
{
// Currently resolves to the rendered section instead of the function.
name: 'inline-directive',
originalSource: '/src/features/inline-directive/server.tsx',
originalLine: 9,
originalColumn: 4,
},
],
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a regression. Inline use server was working in some old demo like

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may seem possible that this is Vite 7 vs Vite 8 difference. For now, don't dig deeper and follow-up in #1361

hi-ogawa and others added 7 commits July 30, 2026 19:08
Add a captured arrow and direct anonymous function expression to the inline directive fixture, and record their current browser source-map locations alongside the declaration case.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Use soft expectations for the location matrix so compatibility runs expose every differing Server Reference in a route.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
Link the prior working inline Server Function location demo beside the current regression expectations.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
Select exact Server Reference location expectations using Vite's Rolldown marker so the default and Vite 7 compatibility jobs preserve their distinct current behavior.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
Represent Rollup and Rolldown locations as direct source:line:column strings instead of helper-built objects.\n\nCo-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa
hi-ogawa merged commit 9db4976 into main Jul 30, 2026
22 checks passed
@hi-ogawa
hi-ogawa deleted the server-reference-source-location-e2e branch July 30, 2026 10:35
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.

Verify development source locations for transformed Server Functions

1 participant