Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
react-server-docs | 69bba11 | Apr 04 2026, 07:51 PM |
⚡ Benchmark Results
Legend🟢 > 1% improvement | 🔴 > 1% regression | ⚪ within noise margin Benchmarks run on GitHub Actions runners (shared infrastructure) — expect ~5% variance between runs. Consistent directional changes across multiple routes are more meaningful than any single number. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #377 +/- ##
=======================================
Coverage ? 93.93%
=======================================
Files ? 2
Lines ? 2275
Branches ? 686
=======================================
Hits ? 2137
Misses ? 138
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Built-in DevTools for development mode
This PR introduces a comprehensive, browser-embedded DevTools panel for
@lazarv/react-serverthat gives developers full visibility into their running application during development — without leaving the browser or installing any extensions.What it does
When the
--devtoolsCLI flag is passed (ordevtools: trueis set inreact-server.config.mjs), a small floating button with the react-server logo appears in the browser. Clicking it (or pressingCtrl/Cmd+Shift+D) opens a multi-panel inspector that covers every runtime concern: server process health (CPU, memory, uptime), RSC payload structure, cache behavior, the file-system route tree, outlet layout, remote and live components, worker threads, and real-time server logs with full ANSI color support.How it works
The DevTools UI is split into two layers. The outer chrome — the floating trigger button, the resizable/dockable panel shell, the DOM highlight overlay, and the RSC payload collector — are client components injected directly into the host page by
render-rsc.jsxwhenconfig.devtoolsis truthy andimport.meta.env.DEVis true. The inner inspector panels (Status, Payload, Cache, Routes, Outlets, Remotes, Live, Workers, Logs) run inside an iframe pointed at/__react_server_devtools__/*, whichssr-handler.mjsintercepts and renders as a standalone react-server app with its own component tree, completely isolated from the user's middleware and routing. Communication between the host page and the iframe happens throughpostMessage, and the server-side devtools context (cache entries, route manifests, worker state, live component registry) is aggregated indevtools/context.mjsand exposed via server actions.The panel supports four dock modes — bottom, left, right, and floating — with smooth animated transitions and drag/resize handles. Panel size and position persist across page navigations via
localStorage. A dark mode toggle is included, independent of the host application's theme. The highlight overlay uses the samepostMessagebridge to let inspector panels visually mark DOM elements on the host page (client component boundaries, outlet containers, remote component mount points) with colored outlines and labels.The Logs panel implements a custom virtualized list with measured row heights to handle high-throughput server output without degrading browser performance. Server-side,
devtools-output.mjshooks intoprocess.stdoutandprocess.stderrto capture log output, strips non-SGR ANSI escape sequences (cursor movement, terminal titles) while preserving color codes, and streams entries to the client where they are parsed into styled React spans supporting 4-bit, 8-bit, and 24-bit true-color ANSI sequences.The Payload panel parses the raw RSC wire format in real time, breaking it into individually inspectable chunks — server components, client references, hints, and metadata — with syntax highlighting and cross-referencing between client component chunks and their corresponding DOM elements via the highlight overlay.
Cache inspection surfaces every
useCacheentry with its function name, source location, arguments, tags, timestamps, and hit/miss/revalidation status, all extracted from structured metadata that the newuse-cache-inline.mjsVite plugin injects at build time.Supporting changes
The file-router plugin now emits a structured route manifest consumed by the devtools route tree view. The cache subsystem (
cache/index.mjs,cache/client.mjs) is instrumented to record entry metadata and exposes a snapshot API for the devtools context. Client-side routing internals (client-route-store.mjs,ClientProvider.jsx,ClientRouteGuard.jsx,ClientRouteRegistration.jsx) are extended to emit route and outlet registration events that the devtools context collects. Worker proxy modules on both client and server now report thread status. The CI workflow has been simplified by removing test sharding. The docs site gains a full DevTools documentation page (English and Japanese) with themed screenshots and a lightbox image component, plus a new banner image and updated OpenGraph asset.DevTools is strictly development-only. No devtools code is included in production builds — the injection points are gated behind
import.meta.env.DEV, and thedevtoolsconfig key is stripped from the Vite config before it reaches Vite's own internals to avoid conflicts with@vitejs/devtools.