Skip to content

Backport upstream Fabric native-props synchronization to react-native-macos 0.81.9 - #4499

Merged
Jason Morse (JasonVMo) merged 3 commits into
mainfrom
user/jasonvmo/rnmacos-native-props-backport
Nov 13, 2026
Merged

Jason Morse (JasonVMo) merged 3 commits into
mainfrom
user/jasonvmo/rnmacos-native-props-backport

Conversation

@JasonVMo

Copy link
Copy Markdown
Contributor

Platforms Impacted

  • iOS
  • macOS
  • win32 (Office)
  • windows
  • android

Description of changes

Part of #4435. Prerequisite for the macOS physical-input fixes (#4441), which are stacked on this PR. This bottom layer contains only the renderer backport.

Adds a second repository-local Yarn patch on react-native-macos@0.81.9: .yarn/patches/react-native-macos-npm-0.81.9-native-props.patch. It is a minimal backport of MIT-licensed upstream commit 923e7ddcaf4d (react/react-native#52646), and the upstream copyright and license headers are kept.

  • Race: during Fabric window resizing, AppKit layout can clone animated nodes (ShadowNode::clone) on the main thread while JavaScript replaces their nativeProps_DEPRECATED map. An AddressSanitizer run of the owned process recorded BUS in folly::dynamic::type() while that unprotected map was being copied. The concurrent writer is inferred from the failing reader, the unguarded source and the upstream fix; ThreadSanitizer was not run.
  • Fix: one mutex owned by the family (ShadowNodeFamily.h) guards both native-props writers (UIManager.cpp) and the cloning reader (ShadowNode.cpp). The props are copied under the lock and parsed after it is released, so merge precedence is unchanged and the mutex is never held across shadow-tree commits.
  • Resolution: the root react-native-macos resolution chains both patches (…aa583a0648.patch&…native-props.patch), and yarn.lock is updated.
  • Docs: native-core/references/rnmacos-patch.md covers attribution, the inferred race and lock scope, the clean-build requirement and the qualification boundary. Upstream replacement is a release gate tracked in remaining-work.md. Changeset: calm-fabric-props.md (native-core patch, docs only). Publishing native-core does not install this patch for consumers.

This is a renderer concurrency fix, not a click-through or driver retry workaround. Without it, Fabric Storybook's PGB-006 NativeSemantics window-resize callback crashed the app in both the full physical and the accessible lanes, even after a clean native rebuild.

Verification

Local macOS (Apple silicon), under a machine-wide lock for native runs.

Check Result
This branch alone, fresh worktree: yarn install --immutable (no manifest, lockfile or patch drift), yarn build Passed
apps/storybook: yarn storybook bundle --macos, prep --macos, build --macos with fresh Pods/DerivedData Passed; AddressSanitizer still linked
yarn workspace @fluentui-react-native/native-core test:apple-integration (CocoaPods module plus Office-style bridging header) Passed, 3/3
PGB-006 forced-resize callback, clean Fabric build with ASan Passed 1/1, crashed before
Full Fabric Storybook smokes with the stacked driver/runtime fixes Passed: physical 343, accessible 260 (+3 declared unsupported each); no retries, skips, quarantines or flakes
macOS FluentTester and other native hosts that consume the root resolution Not built locally
iOS, Android, Windows, Win32 Not affected (patch applies only to react-native-macos); hosted CI covers the build

The original Checkbox, keyboard-clear and Accordion physical reproductions passed without this backport. It is needed only for the full Fabric lanes, which include PGB-006.

One Opus 5.5 review: the backport matches upstream, the mutex scope is safe, and the & resolution and changeset are appropriate. One minor finding (session details in a published reference) was fixed in 5bdfc133f.

Before After
Fabric window resize can crash in ShadowNode::clone while the native-props map is replaced concurrently Writers and the cloning reader share one family mutex; the PGB-006 resize callback passes

Pull request checklist

This PR has considered (when applicable):

  • Automated Tests
  • Documentation and examples
  • Keyboard Accessibility
  • Voiceover
  • Internationalization and Right-to-left Layouts

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken, minified production esbuild bundles with React and React Native runtimes externalized.

Scenario Modules-Mac (Δ) Modules-Win (Δ) Size-Mac (Δ) Size-Win (Δ)
components-button 79 (+1) 80 (+1) 72.92k (-702b) 72.85k (-702b)
components-catalog 228 (+1) 229 (+1) 229.66k (+349b) 229.59k (+349b)
design-themed-root 55 (+4) 56 (+4) 56.26k (+998b) 56.18k (+998b)
design-color-lib 6 (+0) 6 (+0) 6.27k (+0b) 6.27k (+0b)
design-theme-state-legacy-source 49 (+1) 50 (+1) 52.96k (-841b) 52.89k (-841b)
design-legacy-theme 42 (+0) 42 (+0) 39.11k (+0b) 42.91k (+0b)
design-legacy-theme-from-flex 58 (+4) 58 (+4) 60.70k (+824b) 64.51k (+822b)
design-fluent-light-theme 7 (+0) 7 (+0) 18.74k (+0b) 22.59k (+0b)
design-fluent-theme 35 (+0) 35 (+0) 27.46k (+4b) 31.25k (-1b)
design-fluent-hc-theme 32 (+0) 32 (+0) 27.34k (+0b) 31.13k (+0b)
design-flex-theme 29 (-4) 29 (-4) 14.30k (-9.07k) 14.29k (-9.07k)
design-flex-cool-theme 26 (New) 26 (New) 12.51k (New) 12.50k (New)
design-flex-warm-theme 26 (-7) 26 (-7) 12.28k (-11.15k) 12.27k (-11.15k)

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

Minimal backport of MIT-licensed upstream React Native code by OrfeasZ from 923e7ddcaf4d2de45ca7dedafbb84c6b87dbffc4 (react/react-native#52646). Original source copyright and license remain intact.

F16 defect 1's oversized-preview qualification exposed the renderer race in the unchanged PGB-006 NativeSemantics window-resize callback. Both Fabric full lanes lost the app; a clean native rebuild still failed. The owned ASan report fabric-progress-asan-report.86816 records BUS while ShadowNode::clone copies nativeProps_DEPRECATED during AppKit layout. Guard both writers and the cloning reader with the upstream family mutex and preserve props precedence.

Validated after fresh Pods and a clean Fabric native build with ASan retained: forced PGB-006 1/1, run 61d2dce4-5980-49b9-a727-412da47fca71; Apple module and Office-style bridging-header probe 3/3. Evidence: artifacts/desktop/f16-macos-physical/native-props-clean-build-green.log. FluentTester and other native app hosts were not built locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document the observed failing reader, inferred concurrent writer, complete Fabric regression results, and immutable-install/fresh-native-build evidence for the independent lower branch. No E driver or runtime implementation is present in this layer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move session-only run details out of the published reference into ignored private PR evidence. Preserve upstream attribution, lock scope, renderer diagnosis, and the qualified native-host boundary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JasonVMo
Jason Morse (JasonVMo) force-pushed the user/jasonvmo/rnmacos-native-props-backport branch from 5bdfc13 to fb89e9d Compare November 13, 2026 08:13
@JasonVMo
Jason Morse (JasonVMo) merged commit 24d3972 into main Nov 13, 2026
19 checks passed
@JasonVMo
Jason Morse (JasonVMo) deleted the user/jasonvmo/rnmacos-native-props-backport branch November 13, 2026 14:38
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.

3 participants