Skip to content

Backport React 19 root error callbacks - #31

Draft
christopher-buss wants to merge 5 commits into
Roblox:mainfrom
christopher-buss:backport-react-19-root-error-callbacks
Draft

Backport React 19 root error callbacks#31
christopher-buss wants to merge 5 commits into
Roblox:mainfrom
christopher-buss:backport-react-19-root-error-callbacks

Conversation

@christopher-buss

@christopher-buss christopher-buss commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • add onCaughtError, onUncaughtError, and onRecoverableError options to ReactRoblox.createRoot
  • route reconciler commit errors through the owning root, including component stacks and caught boundary metadata
  • add the shared reportGlobalError substrate and preserve legacy synchronous throwing for internal React 17 renderers
  • port the applicable React 19 configurable error logging tests and document the source/test ledger

Upstream sources

Pinned to the React 19.2.0 annotated tag commit (ae74234eae6ebd62f19190731278e20bc1c37d51) and the error-reporting series:

  • 6786563f3cbbc9b16d5a8187207b5bd904386e53 (#28627)
  • a0537160771bafae90c6fd3154eeead2f2c903e7 (#28641)
  • e10a7b5cd541882a78ff659147c1a0294413ccb0 (#28665)
  • 6090cab099a8f7f373e04c7eb2937425a8f80f80 (#28736)

The relevant source trees are identical between the tag commit and its scheduler-version parent (861811347b8fa936b4a114fc022db9b8253b3d86). The port excludes hydration, Fizz/server rendering, DOM events, View Transitions, and React 19 act queue behavior, which do not have corresponding React-Luau capabilities. Roblox global reporting uses a deferred thread error because the host has no browser reportError/error event.

Verification

  • exact pushed commit: 7958fe635c98a4afa8f5147584183c7f51302776
  • exact tested tree: d8cce65c650c94414c59adf06c04790021123a4c
  • hardened public package-identity probe: 1/1 passed
  • Roblox Studio DEV: ReactRobloxConfigurableErrorLogging 6/6 and SetStateInConstructor 21/21; 27/27 total with 0 failures and 0 skipped
  • hardened harness SHA-256 prefixes: tar F6F70094, project D93D6C7D, config 803C3D1E, Jest F361BCAA
  • stylua --check modules bin WorkspaceStatic
  • selene modules WorkspaceStatic (0 errors/warnings)
  • luau-compile --only-parse modules/react-reconciler/src/ReactFiberWorkLoop.new.lua
  • WorkLoop optimized bytecode remains below the Studio load limit at register R188
  • git diff --check

Generated with Codex.

Expose configurable caught, uncaught, and recoverable handlers on ReactRoblox roots and route Fiber errors through the owning root. Preserve React 17 internal renderer throw behavior while public roots use the React 19 global reporting model.

Port the applicable upstream callback tests and document the pinned source ledger and capability exclusions.

Co-authored-by: Codex <noreply@openai.com>
Pin stable source links to the annotated v19.2.0 tag commit and distinguish it from its scheduler-version parent.

Co-authored-by: Codex <noreply@openai.com>
Keep React 17's synchronous internal-renderer console and throw contract while public roots retain React 19 error callbacks. Document the upstream deviations and preserve callback error identity.

Co-authored-by: Codex <noreply@openai.com>
Record that React 17 performs hydration fallback at the retry callers rather than inside the modern recovery helper.

Co-authored-by: Codex <noreply@openai.com>
Store React 19 recovery bookkeeping on the existing private module table and avoid extra WorkLoop imports so Roblox Studio can load the reconciler.

Co-authored-by: Codex <noreply@openai.com>
@christopher-buss
christopher-buss force-pushed the backport-react-19-root-error-callbacks branch 2 times, most recently from 2c1efee to 7958fe6 Compare September 6, 2026 17: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.

1 participant