test(rsc): add e2e for react source map features - #1358
Merged
Merged
Conversation
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
marked this pull request as draft
July 30, 2026 07:55
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>
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>
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
marked this pull request as ready for review
July 30, 2026 10:02
hi-ogawa
commented
Jul 30, 2026
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, | ||
| }, | ||
| ], | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
This looks like a regression. Inline use server was working in some old demo like
Contributor
Author
There was a problem hiding this comment.
It may seem possible that this is Vite 7 vs Vite 8 difference. For now, don't dig deeper and follow-up in #1361
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>
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.
This PR adds a dedicated
examples/source-mape2e for React development source-location features. There were some manual test cases inexamples/basicand 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.