[react-devtools-facade] 1/ scaffold package + installFacade building block#36593
Open
hoxyq wants to merge 1 commit into
Open
[react-devtools-facade] 1/ scaffold package + installFacade building block#36593hoxyq wants to merge 1 commit into
hoxyq wants to merge 1 commit into
Conversation
|
Comparing: 63e95c2...91b8d0b Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
20917a3 to
f21f395
Compare
Introduces react-devtools-facade, a private, source-only library of building
blocks for querying React runtime state.
This first commit adds installFacade(target): it installs only
__REACT_DEVTOOLS_GLOBAL_HOOK__ (the global React looks for at init) and returns
a Facade handle {hook, fiberRoots, rendererInternals, profilingState}. It
installs no tool globals — integrators (e.g. a chrome-devtools-mcp package)
compose the Facade into tools and decide what to expose.
Its tests rely on the devtools build/dev setup, so the package is excluded from
the general test runners and runs only under the build-devtools jest project —
matching react-devtools-shared and react-devtools-extensions.
Tool building blocks and a createTools(facade) assembler land in follow-ups.
f21f395 to
91b8d0b
Compare
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.
Introduces
react-devtools-facade, a private, source-only package of building blocks for React runtime state introspection. Integrates with Reconciler through React DevTools global hook.Plan
The facade is the shared, low-level layer that public, MCP-server–specific packages build on:
react-devtools-facade(private) — installs the React DevTools global hook and exposes a small, framework-agnostic API: install the hook, then assemble a set of tools from the returned handle. It installs no tool globals and makes no decision about how tools are surfaced.react-devtools-cdt-mcp— compose the facade's tools and target a specific MCP server (chrome-devtools-mcp first).This keeps all runtime-introspection logic in one reusable place while each
integration owns its own protocol, packaging, serialisation and globals.
This PR
installFacade(target = globalThis): Facade— installs only__REACT_DEVTOOLS_GLOBAL_HOOK__(the global React looks for at init) and returns aFacadehandle{hook, fiberRoots, rendererInternals, profilingState}. The hook tracks fiber roots on commit and forwards commits to the profiling state when a session is active; building blocks read from the returned handle and never touch globals.package.json(private, source-only),index.js,README.md.react-devtools-shared/react-devtools-extensions.