Skip to content

docs: define React component runtime architecture - #6122

Merged
cixzhang merged 4 commits into
mainfrom
spec-react-component-runtime
Sep 8, 2026
Merged

cixzhang merged 4 commits into
mainfrom
spec-react-component-runtime

Conversation

@cixzhang

@cixzhang cixzhang commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • defines shared runtime roles for render, handlers, refs, Effects, external resources, node replacement, observation, lifecycle ownership, and broadcast identity
  • keeps React techniques as guidance unless misuse causes observable correctness, ownership, cleanup, accessibility, or scale harm
  • constrains Effects to external-system synchronization while allowing documented singletons and recommending Effect Events for non-reactive latest reads
  • permits refs as general non-rendering mutable storage while preventing hidden rendered state
  • delegates public ref / handleRef admission and naming, controlled/optimistic semantics, accessibility, styling, tooling, and public-hook identity to their existing owners

Audit-row coverage

Owned here:

  • C5, C6, C19
  • durable runtime outcomes from C1, C9, C10, C16, C22
  • a narrow lifecycle/scale boundary informed by C7–C8

Explicitly delegated:

  • C2, C13 → public API, family, and component contracts
  • C3, C17 → accessibility, interaction, family, and component contracts
  • C4, C11, C18, C21 → lint/contributor guidance unless an invariant is violated
  • C12 → applicable primitive owner
  • C14 → runtime state boundary here; public composition/introspection with API/component owners
  • C15 → applicable registry/data owner
  • C20 → style/token/component/interaction owner

Owner decisions

  • Effects are constrained, not banned.
  • Controlled props are not casually mirrored; current owners may define explicit optimistic seams.
  • React owns rendered semantics; refs may hold general non-rendering mutable data.
  • Effect Events are guidance for non-reactive latest reads, never hidden dependencies.
  • Complex behavior remains with the stable lifecycle owner; private extraction is guidance, not policy.
  • ref and handleRef may coexist, but their public naming/admission belongs to architecture:public-component-api; handle identity is unspecified.
  • CSS-first and pooled observation are guidance; runtime owns lifecycle and unbounded-fan-out outcomes.

Overlap receipt

Validation

  • node scripts/check-knowledge.mjs
  • pnpm check:sync
  • Prettier
  • git diff --check
  • independent authority map and Matt-style exact-file review

The record is 226 lines because it carries an explicit audit-row ownership/delegation matrix; removing that routing would recreate duplicate authority.

No implementation, tooling, wiki, or audit-table changes. No changeset.

False-positive / false-negative audit

Initial current-code audit sampled 21 cases: 4 false-positive risks, 2 false-negative risks, 13 correct passes, and 2 cases without a current specimen. After the five wording fixes and two mutation expectations, the exact-head rerun classified all 19 concrete cases correctly: 0 false positives, 0 false negatives, 19 correct, with the 2 no-specimen cases covered by explicit node-replacement and N-consumer observer mutations.

@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 8, 2026 12:27am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 7, 2026
github-actions Bot added a commit that referenced this pull request Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang force-pushed the spec-react-component-runtime branch from e9b14cb to 1270947 Compare September 8, 2026 00:23
@cixzhang

cixzhang commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by the owner direction to burn down audit gaps through amendments to existing canonical records rather than new architecture records. The researched clauses and row routing will be reused in smaller owner-specific amendment PRs.

@cixzhang cixzhang closed this Sep 8, 2026
@cixzhang

cixzhang commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 1270947

@cixzhang cixzhang reopened this Sep 8, 2026
@cixzhang

cixzhang commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Reopened under Cindy’s latest explicit owner direction to finalize and merge this runtime authority. That direct approval supersedes the earlier amend-first closure for this PR.

@cixzhang

cixzhang commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 1270947

@cixzhang
cixzhang marked this pull request as ready for review September 8, 2026 00:25
github-actions Bot added a commit that referenced this pull request Sep 8, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantic verdict: approve

This is good. The runtime boundaries are clear and keep public API, component behavior, and specialized systems with their existing owners.

[Reviewed by Robohands]

@cixzhang
cixzhang merged commit 32e06af into main Sep 8, 2026
45 of 59 checks passed
@github-actions
github-actions Bot deleted the spec-react-component-runtime branch September 8, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 12709473 Deployed Sep 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant