chore(rsc): add performance track example#1304
Merged
Merged
Conversation
Co-authored-by: OpenCode <noreply@opencode.ai>
The `react`/`react-dom`/`react-server-dom-webpack: canary` overrides were accidentally committed from a local `pnpm override-react canary` run. They forced the entire monorepo (and the default CI matrix) onto React canary. The canary/experimental CI jobs already apply this override at runtime via scripts/override-react.sh, so revert it here. Co-authored-by: OpenCode <noreply@opencode.ai>
Use the repo's standard dev/build split (two `test.describe` blocks delegating to a shared define function) instead of a `for` loop, and gate the tracing test with separate `test.skip` statements (mode as a describe hook, browser and React version inline) rather than one combined condition. Co-authored-by: OpenCode <noreply@opencode.ai>
The mid-test `test.skip` on span counts silently passed whenever React's flaky dev performance flush produced no entries, making the assertion meaningless. Remove it and instead gate the whole tracing test behind `TEST_PERFORMANCE_TRACK` so it only runs on demand locally, then assert the expected span counts and durations. Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
marked this pull request as ready for review
July 22, 2026 06:36
Drop the React version skip so `TEST_PERFORMANCE_TRACK=1` is the single opt-in gate for the tracing test, letting it run regardless of React version when explicitly requested locally. Co-authored-by: OpenCode <noreply@opencode.ai>
Drop the initial/on-demand RSC probe test and the build variant, and hoist the `TEST_PERFORMANCE_TRACK` opt-in skip to the top of the describe so the file is a single dev-only, Chromium-only tracing test. Co-authored-by: OpenCode <noreply@opencode.ai>
Move the Chrome DevTools Protocol tracing plumbing into named helpers (`startTracing`, `stopTracing`, `stopTracingAndCollectServerComponentSpans`) so the test reads as business logic, rename the derived `Span` entity to `ServerComponentSpan`, and document the CDP domain and Trace Event Format references for `TraceEvent`. Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-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.
Description
Apparently performance tracks feature technically already works and doesn't require debug channel since the same debug info is available in rsc payload directly without debug channel. So this PR add a simple example to test it out.
As indicated by wakujs/waku#1984, there seems to be a bug or limitation about the shape of flight stream payload for debug info to work properly. Some are already addressed in canary e.g.
The example added here does
renderToReadableStream(ReactNode)(i.e. the payload is react node itself) to workaround. Waku and Next.js seems to manipulate debug info directly to support object form of rsc payload.Example