Skip to content

chore(rsc): add performance track example#1304

Merged
hi-ogawa merged 12 commits into
mainfrom
fix/issue-1152
Jul 22, 2026
Merged

chore(rsc): add performance track example#1304
hi-ogawa merged 12 commits into
mainfrom
fix/issue-1152

Conversation

@hi-ogawa

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

Copy link
Copy Markdown
Contributor

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

image image

hi-ogawa and others added 6 commits July 22, 2026 13:14
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
hi-ogawa marked this pull request as ready for review July 22, 2026 06:36
hi-ogawa and others added 6 commits July 22, 2026 15:37
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>
@hi-ogawa
hi-ogawa merged commit 3cad164 into main Jul 22, 2026
22 checks passed
@hi-ogawa
hi-ogawa deleted the fix/issue-1152 branch July 22, 2026 08:20
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.

Create example of server components performance tracks

1 participant