Repository navigation
perf(react-compiler): enable controlled state and outside-click hooks - #8558
Conversation
🦋 Changeset detectedLatest commit: 8717c36 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
Integration test results from github/github-ui PR: |
There was a problem hiding this comment.
🟢 Approval recommended
The focused refactors preserve existing behavior and include targeted regression coverage; no blocking issues were identified, though tests were not executed.
0 open findings
What changed in this PR
Continues the React Compiler rollout from #8555 by enabling compilation for three hooks while preserving their existing behavior.
Changes:
- Replace render-time ref access and memoized handler IDs with state initialization.
- Select the development-only effect implementation at module initialization.
- Remove compiler exclusions, add regression tests, and include a minor changeset.
| File | Description |
|---|---|
packages/react/src/internal/hooks/useDevOnlyEffect.ts |
Selects the effect implementation at module initialization. |
packages/react/src/hooks/useOnOutsideClick.tsx |
Allocates stable handler IDs through lazy state. |
packages/react/src/hooks/useControllableState.ts |
Stores the initial controlled mode in state. |
packages/react/src/hooks/__tests__/useOnOutsideClick.test.tsx |
Tests nested priority, cancellation, and cleanup in StrictMode. |
packages/react/src/hooks/__tests__/useControllableState.test.tsx |
Tests setter stability and callback freshness. |
packages/react/script/react-compiler.mjs |
Removes the three hook exclusions. |
.changeset/react-compiler-hooks.md |
Records compiler support as a minor release. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
8717c36 to
11cefe4
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e632d4e3-54d2-4423-9888-8e37b00494a3
11cefe4 to
80f8d24
Compare
Follow up to #8555. Enable React Compiler for
useControllableState,useOnOutsideClick, and our internal development-only effect hook.Keep the hooks that need broader dependency or focus-lifecycle changes excluded.
Changelog
New
Changed
Removed
Rollout strategy