feat: merge 0.86-merge into 0.85-merge#3035
Draft
Saadnajmi wants to merge 596 commits into
Draft
Conversation
Summary:
scheduleCallback() and pause() held synchronized(paused) while calling
ReactChoreographer.postFrameCallback/removeFrameCallback, which acquire
synchronized(callbackQueues). ReactChoreographer dispatches frame
callbacks inside synchronized(callbackQueues), invoking
executeFrameCallback -> scheduleCallback -> synchronized(paused).
This is a lock ordering inversion: background thread acquires paused
then callbackQueues, main thread acquires callbackQueues then paused.
Fix: move postFrameCallback/removeFrameCallback calls outside the
synchronized(paused) block. The atomic state check (paused +
callbackPosted) stays inside the lock, only the ReactChoreographer
interaction moves outside.
Why this is safe:
- callbackPosted.getAndSet(true) inside the lock guarantees at most one
thread proceeds to post. A concurrent scheduleCallback will see
callbackPosted=true and bail out.
- If pause() runs between the lock release and postFrameCallback:
pause sets paused=true and callbackPosted=false, then calls
removeFrameCallback. Two outcomes depending on ordering inside
callbackQueues (which serializes both calls):
(a) post runs first, then remove cancels it — clean.
(b) remove runs first (nothing to remove), then post adds a callback.
That callback fires once, executeFrameCallback sees paused=true
via scheduleCallback and does not re-post. Net effect: one extra
no-op frame, then the loop stops.
- resume() already operated without synchronized(paused) before this
change, so no new races are introduced on that path.
## Changelog:
[Android] [Changed] - AnimationBackendChoreographer doesn't guard the ReactChoreographer post/remove with synchronized(paused)
Reviewed By: zeyap
Differential Revision: D99099455
fbshipit-source-id: 5c5e9e76ec23fd300a0a67c98b70a9c5bdb08f30
Summary: Pull Request resolved: react#56273 Adds a new, experimental `ReactNativeApplication.unstable_fastRefreshComplete` CDP event, emitted to subscribed active CDP sessions when a Fast Refresh update completes. **Notes** - As with D97486551, we reuse the `changeId` block in `HMRClient.js`, ensuring duplicate updates for the same change are not reported. Changelog: [Internal] Reviewed By: GijsWeterings, hoxyq Differential Revision: D98493216 fbshipit-source-id: b0b81a210fb84873e9358aa5484038062f110103
…ule (react#56257) Summary: Pull Request resolved: react#56257 ## Changelog: [General] [Changed] - move ViewTransition APIs not for react reconciler to its own TurboModule Move `unstable_getViewTransitionInstance` which is not consumed by react reconciler out of UIManagerBinding into a standalone NativeViewTransition CxxTurboModule, following the NativeDOM pattern. This avoids bloating UIManager with ViewTransition-specific APIs. Reviewed By: christophpurrer Differential Revision: D98360009 fbshipit-source-id: 191d0c8cc39fbe1cff87e12ad9a99d5e125b0250
Summary: Pull Request resolved: react#56302 Changelog: [Internal] migrate `ProgressBarAndroid` from Jest to Fantom Note: AndroidProgressBar does not expose props in the Fantom rendered output, so the test only verifies that the component renders. The old Jest snapshot verified JS-level props via the shallow renderer, but those aren't available through Fantom's native rendering pipeline for this component. Reviewed By: sammy-SC Differential Revision: D98998943 fbshipit-source-id: 6c570eaed1639e18cb54e29920c22aa9b9397615
) Summary: Guard `ReactViewGroup.addChildrenForAccessibility` against transient non-descendant races during accessibility traversal on Android. This replaces direct `super.addChildrenForAccessibility(...)` calls with a small wrapper that: - catches `IllegalArgumentException` - only swallows the specific "descendant of this view" case - rethrows all other `IllegalArgumentException`s ## Why There are recurring crashes with stack traces ending in: `ViewGroup.offsetRectBetweenParentAndChild` -> `offsetDescendantRectToMyCoords` -> `addChildrenForAccessibility` -> `IllegalArgumentException: parameter must be a descendant of this view`. This can happen when accessibility is traversing children while views are being re-parented/removed. Related reports: - react#32649 - react#38925 - react#7377 - kirillzyusko/react-native-keyboard-controller#961 - kirillzyusko/react-native-keyboard-controller#962 - dotnet/maui#32927 There is also precedent in RN for handling this class of non-descendant race defensively: - react#55273 ## Scope This is intentionally minimal and localized to accessibility child collection in `ReactViewGroup`. Behavior is unchanged in the non-racy path. ## Changelog: [Android] [Fixed] - Guard `ReactViewGroup.addChildrenForAccessibility` against transient non-descendant accessibility traversal crashes. Pull Request resolved: react#56182 Test Plan: Validated in a downstream RN Android app on Android 16 with repeated sheet/modal open-close stress and active accessibility hierarchy traversal; crash reproduces before patch and no longer reproduces with this guard. Reviewed By: jorge-cab Differential Revision: D97861147 Pulled By: Abbondanzo fbshipit-source-id: 15e624a94d5acd99777a7426787b52d8e85cdf8a
Summary: Pull Request resolved: react#56318 [changelog](https://github.com/facebook/flow/blob/main/Changelog.md) Changelog: [Internal] Reviewed By: gkz Differential Revision: D99477741 fbshipit-source-id: 3d3175111b128ae85c75db55d7e2f1d4bf3e1372
Summary: Pull Request resolved: react#56337 Feature is currently always on. ## Changelog: [internal] Reviewed By: marcoww6 Differential Revision: D99681591 fbshipit-source-id: 82a651fea23e160dd753c2e9644d0423e6a80395
…nvocation (react#56201) Summary: Pull Request resolved: react#56201 JavaMethodWrapper is a legacy architecture class that wraps ReactMethod-annotated Java methods via reflection for the bridge-based NativeModule invocation path. When ReactNativeFeatureFlags.useTurboModuleInterop is enabled (the new architecture), this class is completely bypassed — the TurboModule interop layer uses JavaInteropTurboModule (C++) with direct JNI invocation via JavaTurboModule::invokeJavaMethod(), which converts JSI values to JNI arguments directly in C++ without any Java-side reflection. This diff: - Deletes JavaMethodWrapper.kt (only instantiated from JavaModuleWrapper.findMethods()) - Deletes BaseJavaModuleTest.kt (test that exercised JavaMethodWrapper) - Removes the NativeMethod interface from JavaModuleWrapper (only implemented by JavaMethodWrapper) - Rewrites JavaModuleWrapper.findMethods() to compute method type inline without JavaMethodWrapper - Changes JavaModuleWrapper.invoke() to throw UnsupportedOperationException - Sets md.signature to empty string for sync methods to prevent C++ null deref The JavaModuleWrapper class shell is kept because it is still referenced from C++ JNI (JavaModuleWrapper.cpp) and NativeModuleRegistry. Full removal is planned as follow-up. Changelog: [Internal] internal Reviewed By: cortinico, javache Differential Revision: D97387121 fbshipit-source-id: 5c6a16f5b8d92430e4afeb3603b5bc538c076f90
…ds (react#56040) Summary: X-link: react/yoga#1918 Pull Request resolved: react#56040 Fixed 101 MissingOverrideAnnotation lint errors in YogaNodeJNIBase.java. Added Override annotation to all public methods that override abstract methods from the YogaNode superclass but were missing the annotation. This includes style getters/setters (direction, flex, margin, padding, border, position, width, height, min/max dimensions, aspect ratio, gap), layout methods (reset, calculateLayout, dirty), tree manipulation (addChildAt, removeChildAt, indexOf), and measurement/baseline functions. Changelog: [Internal] internal Reviewed By: cortinico Differential Revision: D95413075 fbshipit-source-id: fc148c8aefe734c090541b6eb02815c1446d2e98
…ster Summary: Chronos Job Instance ID: 1125908291255772 Sandcastle Job Instance ID: 22518000715806458 allow-large-files ignore-conflict-markers opt-out-review drop-conflicts Differential Revision: D99780677 fbshipit-source-id: 915f9d29d6587b15730422cceb9023df25d3a843
Summary: Pull Request resolved: react#55480 Rolls out the antialiased clipping code path introduced in react#54525 Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D92742063 fbshipit-source-id: fa47774082017d0961b1ceae934334a81ae1b3ab
…eact#56336) Summary: Pull Request resolved: react#56336 Moves `clipRect` inside the outer `saveLayer` in `clipWithAntiAliasing()` to fix blank rendering on API 24 (Nougat) devices. react#55762 added `canvas.withClip()` to fix black pixels on partially off-screen views. However, it wrapped the entire compositing chain in an extra `save()`/`clipRect`/`restore()`, creating a triple-nested save/restore stack (`save` -> `saveLayer` -> `saveLayer(DST_IN)`) that breaks Porter-Duff compositing on API 24's HWUI renderer. Moving `clipRect` inside the `saveLayer` reduces nesting from 3 to 2 levels while preserving the black-pixel mitigation. The `saveLayer` already saves and restores clip state, so a separate `save()`/`restore()` wrapper is unnecessary. Changelog: [Android][Fixed] - Fix image content disappearing on API 24 (Nougat) when antialiased border radius clipping is applied Reviewed By: NickGerleman Differential Revision: D99677658 fbshipit-source-id: 55a9c84655cc08b05b95c29725492b9b8f759331
…eact#56294) Summary: Pull Request resolved: react#56294 Add Android instrumentation tests that validate the Java-side and C++ registry behavior around view preallocation, destruction, and recreation — the core scenario fixed by D98729251. Two layers of tests: 1. **Java-side tests** (IntBufferBatchMountItem): Construct mount item int/obj buffers manually and execute against MountingManager. Validates CREATE→INSERT and Preallocate→Delete→CREATE→INSERT sequences through the Java mount system. 2. **Native registry tests** (FabricMountingManagerTestHelper): JNI hybrid class that creates a real C++ FabricMountingManager and exercises the allocatedViewRegistry_ lifecycle. Validates that after preallocate + destroy, the tag is removed from the registry (the D98729251 fix), so executeMount would correctly emit a CREATE instruction. The native test helper is built as a separate library (libfabricjni_test_helper.so) under jni/react/fabric/test/, with friend access to FabricMountingManager internals. Changelog: [Internal] Reviewed By: Abbondanzo Differential Revision: D98935855 fbshipit-source-id: 2c41a19e037a34d5500b396836d8f453ab34a109
Summary: Pull Request resolved: react#56352 Add mutex to protect `PerformanceObserver::buffer_` and `didScheduleFlushBuffer_`, which can be accessed concurrently from a background thread (`handleEntry`) and JS thread (`takeRecords`). Fixes T263429319. Changelog: [Internal] Reviewed By: jorge-cab Differential Revision: D99820359 fbshipit-source-id: 068fa1871b3a0feeb84b950b0c8f5fe7dcf38b7d
Summary: Pull Request resolved: react#56338 ## Changelog: [iOS] [Fixed] - Addressed -Wunreachable-code-return violations Reviewed By: NickGerleman Differential Revision: D97797196 fbshipit-source-id: 0a7a34d69fb4592094bbcbae5d56bc848eb8f01b
Summary: Pull Request resolved: react#56353 Consolidated all changelog items from RC versions (v0.85.0-rc.0 through v0.85.0-rc.7) into a single v0.85.0 release section. Changes: - Merged 150 total changelog items from 5 RC versions - Items sorted alphabetically within each #### subsection (platform-specific) - Maintained title hierarchy (Breaking, Added, Changed, Deprecated, Removed, Fixed, Security) - Preserved all links, commit hashes, and author attributions Item counts verified: - Before: 150 items across v0.85.0-rc.0 through v0.85.0-rc.7 - After: 150 items in merged v0.85.0 Changelog: [Internal] Reviewed By: huntie Differential Revision: D99845726 fbshipit-source-id: 732af1ce36fb722548c0367433a40105f1c2afa3
Summary: Pull Request resolved: react#56306 This PR is an optimization attempt during work on the `calc()` feature: react/yoga#1874. It aims to reduce the regression effect on layout operations after extending the size of `StyleLength` and `StyleSizeLength` classes. ## Changelog: This PR introduces a private `resolve(StyleValueHandle handle, float referenceLength)` function to `Style.h` that resolves its property values directly from `StyleValueHandle` and skips creating intermediate objects. I am aware that this duplicates the resolving functionality that already exists in `StyleLength.h` and `StyleSizeLength.h`, and may not be the cleanest solution. Optimization could go even further and totally drop the `resolve()` function from `StyleLength.h` and `StyleSizeLength.h`, and replace all usages with the newly introduced functions. But I think the performance boost is not high enough to justify that. Also it won't be the best API for Yoga library consumers - that's why I decided to keep them. However, I am opening this PR to start a discussion and would really like to hear opinions about it. Changelog: [Internal] ## Benchmarks: Results were averaged over 20 runs. This does not bring much gain in terms of performance when compared to the main branch. <img width="1366" height="254" alt="image" src="https://github.com/user-attachments/assets/19ec2a31-db60-46bc-84e1-5ad8eb9ddfcd" /> However, it introduces a significant boost for the calc() and YGValueDynamic work. Results before these optimizations: <img width="1390" height="276" alt="image" src="https://github.com/user-attachments/assets/68c17e88-78e2-439b-bf09-acb869d5533d" /> And after: <img width="1363" height="252" alt="image" src="https://github.com/user-attachments/assets/212b9d11-5e02-4524-b9ba-90b43130d02c" /> cc NickGerleman X-link: react/yoga#1922 Reviewed By: zeyap Differential Revision: D99006553 Pulled By: NickGerleman fbshipit-source-id: f6c8f8844d8d854789914b877e14af5eed678c23
Summary: Pull Request resolved: react#56357 Bump the `package.json` minimum of `whatwg-fetch` to the latest `3.6.20`. This version is already over two years old and was already within the `^3.0.0` range, so essentially every OSS user is already using it - as backed up by its download figures: https://www.npmjs.com/package/whatwg-fetch?activeTab=versions Bumping for clarity ahead of vendoring 3.6.20 Changelog: [Internal] Reviewed By: huntie Differential Revision: D99850877 fbshipit-source-id: 0f7754a647a26b41e02a7922de81da9d07949a4e
…#56335) Summary: When using Expo with `use_frameworks!` in the Podfile, Expo generates a `React-use-frameworks.modulemap` file inside `React-Core-prebuilt`. When `replaceRNCoreConfiguration` runs (e.g., when switching between Debug and Release builds), this file can be lost, causing subsequent builds to fail with modulemap-related errors. The current code removes only directories inside `React-Core-prebuilt` (preserving top-level files), but `React-use-frameworks.modulemap` may reside inside one of those subdirectories depending on the Expo version. This PR explicitly saves and restores the modulemap around the directory replacement to make the intent clear and guard against this case. The restore is placed inside the `finally` block so it runs even if `mv`/`cp` partially fails during the directory move. ## Changelog: [IOS] [Fixed] - Preserve Expo-generated `React-use-frameworks.modulemap` across `replace-rncore-version.js` runs Pull Request resolved: react#56335 Test Plan: - Set up an Expo project with `use_frameworks!` in Podfile - Run `pod install` for a Debug build - Switch to a Release build to trigger `replace-rncore-version.js` - Verify `React-use-frameworks.modulemap` is present in `React-Core-prebuilt/` after the replacement - Confirm the build succeeds without modulemap-related errors Reviewed By: cortinico Differential Revision: D99816864 Pulled By: cipolleschi fbshipit-source-id: d518420a45f5b178142fb5a118974d0d3e449676
Summary: Pull Request resolved: react#56307 Implement the `Page.captureScreenshot` CDP command in the inspector backend, allowing DevTools to capture an on-demand screenshot of the current app view. This is a minimal implementation supporting only the `format` (jpeg/png/webp) and `quality` (0-100, jpeg only) parameters, returning base64-encoded image data. The feature is gated behind a new `fuseboxCaptureScreenshotEnabled` React Native feature flag, wired through `InspectorFlags` following the same pattern as frame recording. **Motivation** Improve agent verification / user feedback during AI sessions. We've proven that screenshots (in performance traces) are useful for understanding how components render on screen, and exposing this as an on-demand CDP method is relatively cheap today vs the larger task of modelling the DOM (Elements panel). **Changes** - New `fuseboxCaptureScreenshotEnabled` feature flag + `InspectorFlags` wiring (C++, Android JNI, Kotlin) - `HostTargetDelegate::captureScreenshot()` virtual method with async callback - C++ CDP handler in `HostAgent` — parses `format`/`quality`, delegates to platform, sends async CDP response (gated by flag) - iOS (`RCTHost.mm`): Captures key window via `UIGraphicsImageRenderer` + `drawViewHierarchyInRect`, encodes to PNG/JPEG - Android (`ReactHostImpl.kt`): Captures decor view via `Bitmap` + `Canvas` + `View.draw()`, encodes to PNG/JPEG/WebP - 4 C++ tests: success, failure, param forwarding, flag-disabled rejection Changelog: [Internal] Reviewed By: hoxyq Differential Revision: D99099930 fbshipit-source-id: d4d2ef86ba20d2ee230903e152dd21e11f29cbb8
…act#55923) Summary: When Metro host is an IPv6, iOS dev-support had two parsing issues, causing SIGABRTs): 1. `RCTPackagerConnection` parsed `host:port` by splitting on `:`, which breaks IPv6 literals and can build an invalid websocket URL for `/message`. 2. `RCTInspectorDevServerHelper` used `NSURL.host` directly to compose `host[:port]`. For IPv6, `NSURL.host` is unbracketed, producing an invalid authority for inspector endpoints. Changes: - `RCTPackagerConnection`: parse host/port via `NSURLComponents` from a synthesized URL instead of splitting by `:`. - `RCTInspectorDevServerHelper`: re-add IPv6 brackets when composing authority strings from `NSURL.host`. ## Changelog: [IOS] [FIXED] - Fix iOS dev-support IPv6 handling for packager and inspector connections. Pull Request resolved: react#55923 Test Plan: - Built RNTester Debug (Hermes + New Architecture) for iOS simulator. - Started Metro on IPv6: - `RCT_METRO_PORT=8088 yarn --cwd packages/rn-tester start --host :: --port 8088` - Launched RNTester with IPv6 Metro host in settings: - `RCT_packager_scheme = http` - `RCT_jsLocation = [2a02:...]:8088` - Verified in logs: - `http://[2a02:...]:8088/status` returns 200 - bundle loads from `http://[2a02:...]:8088/js/RNTesterApp.ios.bundle?...` - Verified app remains running and renders RNTester UI (no SIGABRT in packager/inspector startup paths). Reviewed By: vzaidman, cortinico Differential Revision: D95564862 Pulled By: cipolleschi fbshipit-source-id: 4fbdf00ca604a2b2ec40dd0ba9b92a146e6b10f2
Summary: Pull Request resolved: react#56371 Changelog: [GENERAL][FIXED] - Prevent updates to mounted flag on the React revision Currently, with fabric branching enabled, the logic for `updateMountedFlag` can run twice for the same tree: first when committing it to a react revision, then when merging to the main revision. This has the potential to drive `enableCounter_ ` negative. This diff, makes it so that `updateMountedFlag` runs only when committing to the main branch. Reviewed By: rubennorte, cipolleschi Differential Revision: D99996551 fbshipit-source-id: 8e578b3bf1e22ef1f87fdd0df20dc25bb4631ccf
Summary: Pull Request resolved: react#56370 Vendor `whatwg-fetch` v3.6.20 directly into `Libraries/Network/`, replacing the npm dependency with a local copy. `whatwg-fetch` has not had a release since December 2023 and appears to be [unmaintained](JakeChampion/fetch#1482), by download numbers `react-native` is the dominant consumer (all this is unsurprising, since `fetch` is natively implemented in every browser). It has several shortcomings we (with the OSS community) could improve on - one important one being that `whatwg-fetch`'s `fetch()` does not resolve immediately on receipt of headers, only on completion. This takes the single source file from the `whatwg-fetch` npm package as `Libraries/Network/whatwg-fetch.js`, and its accompanying types, marking as originally vendored from whatwg-fetch v3.6.20 (Copyright (c) 2014-2023 GitHub, Inc., MIT license). Changelog: [Internal] Reviewed By: huntie Differential Revision: D99854694 fbshipit-source-id: 6e742c47c43d69012841671608cc8b359d20ea91
Summary: This is a reland of commit `401b162` on main. ## Changelog: [Internal] - Pull Request resolved: react#56374 Test Plan: N/A Reviewed By: zeyap Differential Revision: D100024009 Pulled By: cortinico fbshipit-source-id: 56a27794afba803291c037f5d6a1ece5f1813849
Summary: Pull Request resolved: react#56319 While RCTScrollViewComponentView is overridable, its NOT a UIScrollView. It has a private property this is the scroll view and if you want to override UIScrollView behavior you have to change this. Changelog: [Internal] Reviewed By: sbuggay Differential Revision: D99462381 fbshipit-source-id: fec7741248c229c301ba60b6b2b4d06bb14297de
…lag (react#56366) Summary: Fixes a critical iOS regression introduced in RN 0.83 (react#53825) where `RCTViewComponentView.canBecomeFirstResponder` unconditionally returns `YES`. This causes UIKit to promote parent views to first responder via `_promoteSelfOrDescendantToFirstResponderIfNecessary`, resulting in: 1. **TextInput autoFocus regression** — inputs lose focus on mount (focus→blur cycle) 2. **Keyboard reopening** — after any TextInput was focused/dismissed, opening native overlays (UIMenu, dropdown menus, header toolbar buttons) causes the keyboard to reappear unexpectedly ### Root Cause PR react#53825 added `canBecomeFirstResponder: YES` as part of the `enableImperativeFocus` feature, but didn't gate the return value behind the feature flag. When the flag is `false` (default), every `RCTViewComponentView` still claims first responder eligibility, causing UIKit's `_promoteSelfOrDescendantToFirstResponderIfNecessary` to steal focus from TextInputs. Two distinct failure modes: 1. **On navigation transitions** — UIKit calls `_promoteSelfOrDescendantToFirstResponderIfNecessary` on the incoming screen's root view, walks the hierarchy, finds an `RCTViewComponentView` that returns `YES`, and promotes it — stealing focus from a TextInput that just called `becomeFirstResponder`. 2. **On native overlay dismissal** — When UIMenu/context menu/toolbar dismisses, UIKit restores first responder by walking to the nearest view claiming first responder eligibility, which is now every `RCTViewComponentView`. ### Fix Gate `canBecomeFirstResponder` behind the `enableImperativeFocus` feature flag. When `false` (the default for all existing apps), views don't claim first responder — fixing the regression. When `true`, the imperative focus/blur feature works as designed. This change is safe: `enableImperativeFocus` defaults to `false`, so the gated path only activates for apps explicitly opting in to the new focus/blur commands. Credit to war-in for identifying this fix in react#55908. Fixes react#55116 Related: expo/expo#43198, software-mansion/react-native-screens#3763, software-mansion/react-native-screens#3677 ## Changelog:[iOS] [Fixed] - Gate RCTViewComponentView.canBecomeFirstResponder behind enableImperativeFocus flag to prevent keyboard reopening and focus theft in Fabric apps Pull Request resolved: react#56366 Test Plan: 1. Create a screen with a `TextInput` that has `autoFocus={true}` 2. Navigate to that screen using React Navigation (Stack) 3. Verify `TextInput` retains focus and keyboard stays visible — previously it would focus then immediately blur 4. Dismiss the keyboard, then open a native UIMenu or press a toolbar button 5. Verify keyboard does **NOT** reopen 6. Enable `enableImperativeFocus` flag, verify `focus()`/`blur()` commands still work on Views > **Note:** This PR is intended as a backup to react#55908 by war-in, which has the identical fix. If that PR gets reviewed and merged, this can be closed. Opening this to increase visibility on a critical regression affecting all RN 0.83+ iOS Fabric apps. Reviewed By: cipolleschi Differential Revision: D99994820 Pulled By: javache fbshipit-source-id: bdfea2b01e43afa05e8cf35d12d9ccf7a56d63ca
…eact#56272) Summary: Pull Request resolved: react#56272 BlobCollector::nativeInstall received a raw jlong pointer to jsi::Runtime from Java and cast it directly, with no thread safety. Migrated BlobModule to implement TurboModuleWithJSIBindings, which provides a safe getBindingsInstaller() callback guaranteed to run on the JS thread during module initialization. Removed the unsafe raw pointer path. Changelog: [Internal] Reviewed By: alanleedev Differential Revision: D98712509 fbshipit-source-id: 2220b854374090e2e2b9e4b3a8113c1c890a81e4
Summary: Pull Request resolved: react#56369 Blob images in RNTester work Changelog: [Android][Fixed] Blob content provider did not work in new arch Reviewed By: alanleedev Differential Revision: D99836114 fbshipit-source-id: e672a920c2327dfe18edaae5291dd8bb8642cdd1
Summary: Pull Request resolved: react#56310 Migrate `SafeAreaView` from Jest to Fantom. Note: SafeAreaView falls back to View in non-iOS environments, so `collapsable={false}` is needed to prevent Fantom from optimizing the view away. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D99290669 fbshipit-source-id: 8beaf75c4f8237e8f8955564799fed0bbf50d25a
…al (react#56390) Summary: Fix the v0.85.0 changelog entry for commit 5681db0. The current entry says React Native removed `StyleSheet.absoluteFill`, but that commit actually removed the deprecated `StyleSheet.absoluteFillObject` API while `StyleSheet.absoluteFill` remains exported. ## Changelog: [GENERAL] [FIXED] - Correct the v0.85.0 changelog entry for the removal of `StyleSheet.absoluteFillObject`. Pull Request resolved: react#56390 Test Plan: - Ran `git show 5681db0` and confirmed the diff removes `absoluteFillObject` exports/types/usages, not `absoluteFill`. - Ran `git grep -n "absoluteFillObject" HEAD` and confirmed only the historical deprecation changelog entry remains. - Verified `StyleSheet.absoluteFill` is still exported in the current tree. - Ran `git diff --check`. Reviewed By: cortinico Differential Revision: D100148162 Pulled By: fabriziocucci fbshipit-source-id: b2158cb64fb0e7d2ea7a87969cfedcda7b9de4b4
Summary: X-link: facebook/relay#5266 Pull Request resolved: react#56664 [changelog](https://github.com/facebook/flow/blob/main/Changelog.md) Changelog: [Internal] Reviewed By: gkz Differential Revision: D103276599 fbshipit-source-id: 1fa9ee978bb17267f36d782df635dc15ffebf6f7
…#56666) Summary: Pull Request resolved: react#56666 The feature flag `enableNativeEventTargetEventDispatching` switches the React Native renderer from the legacy plugin-based event dispatch to a new W3C `EventTarget`-based dispatch in `dispatchNativeEvent.js`. The legacy path honors the `phasedRegistrationNames.skipBubbling` flag declared in view configs by short-circuiting the bubble traversal. The new path was unconditionally setting `bubbles: true` for any event with a `customBubblingEventTypes` entry, so `topPointerEnter` / `topPointerLeave` (the only events that declare `skipBubbling: true` today) ended up bubbling to all ancestors, breaking the W3C Pointer Events contract that `pointerenter` / `pointerleave` do not bubble. Map `skipBubbling: true` to `bubbles: false` on the synthesized `LegacySyntheticEvent`. The existing `EventTarget.dispatch()` bubble loop already short-circuits when `event.bubbles` is `false` and `target !== eventTarget`, so the target's own bubble + capture handlers still fire — only ancestor bubble handlers are suppressed. Capture-phase listeners are unaffected. Changelog: [internal] Reviewed By: sammy-SC Differential Revision: D103200424 fbshipit-source-id: 8f246b09017bd1a1026e79f5aeb78123f5bba873
…ct#56646) Summary: Pull Request resolved: react#56646 Replace `ConcurrentHashMap<Int, ViewState>` with `MutableIntObjectMap<ViewState>` + `ReentrantReadWriteLock` in `SurfaceMountingManager`, behind the `useOptimizedViewRegistryOnAndroid` feature flag. `ConcurrentHashMap<Int, ViewState>` boxes every `Int` key to `java.lang.Integer` (16 bytes) and allocates a `Node` object per entry (~32 bytes). `MutableIntObjectMap` from `androidx.collection` uses a Swiss Table layout with primitive `IntArray` keys — ~9 bytes/entry vs ~56-64 bytes, a ~6x reduction in map overhead. For a complex surface with 2000+ views, this saves ~90KB per surface in map overhead alone, plus reduced GC pressure from eliminating `Integer` boxing. The `ReentrantReadWriteLock` replaces CHM's built-in concurrency. This matches the access pattern: reads from any thread (`getEventEmitter`, `enqueuePendingEvent`), writes almost exclusively from the UI thread. Readers never block each other. `stopSurface` snapshots entries under the write lock and processes `onViewStateDeleted` outside the lock to minimize reader blocking. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D102797904 fbshipit-source-id: c951fd31c9582f2196c3e09b0e41b8b29e889d85
…react#56534) Summary: Pull Request resolved: react#56534 Fix two ThreadSanitizer data races caught by the messenger_demo integration test under dev-tsan mode. **InspectorFlags**: `loadFlagsAndAssertUnchanged()` reads and writes `cachedValues_` without synchronization. The main thread calls it via `getIsProfilingBuild()` while the JS thread calls it via `getNetworkInspectionEnabled()`, racing on the shared `optional<Values>`. Add a `std::mutex` to protect `cachedValues_` access. The lock is taken after computing `newValues` from feature flags, so flag reads stay outside the critical section. `dangerouslyResetFlags()` also acquires the lock to avoid racing with concurrent flag reads. **Inspector**: `Inspector::connectDebugger()` is called from the main thread but creates and uses `packagerConnection_` which is also accessed on the inspector thread. Dispatch the body of `connectDebugger()` to the task dispatch thread via `invokeElsePost()`, matching the pattern other Inspector methods already use. This ensures `InspectorPackagerConnection::connect()` is called on the correct thread as its API requires. Changelog: [Internal] Reviewed By: hoxyq Differential Revision: D101809616 fbshipit-source-id: 92eac22ca9ab364daafc403a0fdbb39394bd0f63
…eact#56610) Summary: Pull Request resolved: react#56610 Removes deprecated feature flags `enableImagePrefetchingJNIBatchingAndroid` and `enableImagePrefetchingOnUiThreadAndroid` by consolidating their behavior into `enableImagePrefetchingAndroid`. The changes make image prefetch batching and UI thread dispatch the default behavior when `enableImagePrefetchingAndroid` is enabled. This simplifies the feature flag system and removes intermediate experimentation flags that are no longer needed. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D102428102 fbshipit-source-id: af7387e5a3144d7c425fc600a04b33e830d6e2e7
Summary: Pull Request resolved: react#56663 ## Changelog: [Android] [Added] - Add test for synchronous mount props override behavior ___ overriding_review_checks_triggers_an_audit_and_retroactive_review Oncall Short Name: react_native Reviewed By: christophpurrer Differential Revision: D103237771 fbshipit-source-id: 617b2dc5f0d9527910eb2b1fc4ec41f431b2e2f7
Summary: Pull Request resolved: react#56676 Reviewed By: tmikov Differential Revision: D103664557 fbshipit-source-id: bcc53150cf357b025918b4dab9f19603284d602b
Summary: Pull Request resolved: react#56678 Introduces a new common React Native feature flag, `enableSchedulerDelegateInvalidation`, that gates a defensive guard around `Scheduler::uiManagerDidDispatchCommand` and `uiManagerDidFinishTransaction`. Those call sites enqueue a lambda via `runtimeScheduler_->scheduleRenderingUpdate` that captures the raw `SchedulerDelegate` pointer by value. With `RuntimeScheduler_Modern` (bridgeless) the lambda runs asynchronously, so if the `SchedulerDelegate` is destroyed between enqueue and execution the lambda dereferences dangling memory and the process crashes (`EXC_BAD_ACCESS` / `KERN_INVALID_ADDRESS`). The follow-up commit adds the actual guard wired to this flag. Defaults to `false` so behavior is unchanged on landing. Apps opt in by overriding the flag in their own `ReactNativeFeatureFlagsDefaults` subclass. Includes the regenerated feature-flag boilerplate (Kotlin/Java/Cxx accessors, defaults, providers, JS spec, native module) emitted by `yarn featureflags --update`. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D103757271 fbshipit-source-id: 85991de4a21e3946a25571b6488bee9c0a4e1caf
Summary: Pull Request resolved: react#56680 Scheduler::uiManagerDidFinishTransaction and Scheduler::uiManagerDidDispatchCommand queue lambdas via runtimeScheduler_->scheduleRenderingUpdate that capture the raw delegate_ pointer by value. With RuntimeScheduler_Modern (the bridgeless implementation), the lambda runs asynchronously, so if the SchedulerDelegate is destroyed between enqueue and execution (surface teardown, Scheduler destruction, or setDelegate flip), the lambda dereferences dangling memory → EXC_BAD_ACCESS / KERN_INVALID_ADDRESS. Add a per-delegate-identity invalidation token (`shared_ptr<atomic<bool>>`) owned by Scheduler and captured by-value into the deferred lambdas. The destructor and setDelegate flip the flag to true; lambdas check it (acquire ordering) before dereferencing the captured raw delegate. The shared_ptr keeps the atomic alive for any outstanding lambdas. Public API is unchanged (private member only), so C++ API snapshots are unaffected. Changelog: [General][Fixed] - Prevent Scheduler use-after-free crash when surfaces tear down with pending rendering updates Reviewed By: mdvacca, Abbondanzo Differential Revision: D103727974 fbshipit-source-id: 8abf5073b7fd35e88d65a91c42f311b238d8f156
…com (react#56683) Summary: Pull Request resolved: react#56683 RN's GitHub Actions CI isn't set up to authenticate against `registry.facebook.net`, causing 401s on Yarn install As a quick fix ahead of the 0.86 cut, this manually fixes them back to `yarnpkg.com` Changelog: [Internal] Reviewed By: cortinico Differential Revision: D103845323 fbshipit-source-id: d31f5bbaedfeaa35ef26837ab8faf29dbeff465e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
This change merges the React Native 0.86 fork point into the macOS release stack while preserving the 0.85 macOS platform work and explicitly porting the 0.86 deltas that cannot be resolved mechanically.
d1cdce24cca2224f8d37873d24a49523a8271a0a(d1cdce24).4014f771b43d804c242f407b95ef3a999a48b24f, with parentsdcd3d60324c220393aae7729bb538235f3c70416andd1cdce24cca2224f8d37873d24a49523a8271a0a.db92dc832747c4ad003d8fe12da35f7dc56880b4, treed55946fa7f2f75922e2de1b7b8a535e38e0038b6.0.86-stabletipa8eb4f70c730bc3ee3dba4d9b1ca6f70f0d674d3(a8eb4f70) is not an ancestor. Its 22 stable-only commits are intentionally excluded from this fork-point merge.The temporary target is base
microsoft:0.85-mergeand headSaadnajmi:0.86-merge. After the predecessor lands, retarget this change tomicrosoft:main; do not merge it intomainbefore the predecessor is present.Conflict accounting
The mechanical merge materialized exactly 49 unique conflict paths, 145 conflict hunks, 290 side terms (145 snapshot terms and 145 diff terms), and 3 deletions. Package/workspace conflicts retain fork workspace identity and links while taking 0.86 dependency metadata. Source conflicts were resolved hunk by hunk against both the local intent and the upstream change intent.
Workspace, package, podspec, and lock metadata (23 paths)
package.jsonpackages/babel-plugin-codegen/package.jsonpackages/community-cli-plugin/package.jsonpackages/dev-middleware/package.jsonpackages/eslint-config-react-native/package.jsonpackages/eslint-plugin-specs/package.jsonpackages/jest-preset/package.jsonpackages/metro-config/package.jsonpackages/react-native/gradle/libs.versions.tomlpackages/react-native/package.jsonpackages/react-native/react-native.config.jspackages/react-native/third-party-podspecs/RCT-Folly.podspecpackages/react-native/third-party-podspecs/fmt.podspecpackages/react-native-babel-preset/package.jsonpackages/react-native-babel-transformer/package.jsonpackages/react-native-codegen/package.jsonpackages/react-native-compatibility-check/package.jsonpackages/react-native-popup-menu-android/package.jsonpackages/rn-tester/package.jsonpackages/virtualized-lists/package.jsonprivate/react-native-codegen-typescript-test/package.jsonscripts/releases/ios-prebuild/configuration.jsyarn.lockJavaScript, tests, generated artifacts, and RNTester (12 paths)
packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-test.jspackages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snappackages/react-native/Libraries/Components/View/View.jspackages/react-native/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snappackages/react-native/Libraries/LogBox/UI/__tests__/__snapshots__/LogBoxInspectorStackFrames-test.js.snappackages/react-native/ReactNativeApi.d.tspackages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewCommon.mmpackages/rn-tester/Podfile.lockpackages/rn-tester/js/examples/Layout/LayoutEventsExample.jspackages/rn-tester/js/examples/TextInput/TextInputExample.ios.jspackages/rn-tester/js/examples/View/ViewExample.jspackages/rn-tester/js/utils/RNTesterList.ios.jsObjective-C, Objective-C++, C++, SwiftPM, and native podspecs (14 paths)
packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mmpackages/react-native/Package.swiftpackages/react-native/React/Base/RCTRootView.hpackages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.hpackages/react-native/React/CoreModules/RCTRedBox.mmpackages/react-native/React/CoreModules/RCTWebSocketModule.mmpackages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.hpackages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mmpackages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mmpackages/react-native/React/Modules/RCTUIManager.mmpackages/react-native/React/Profiler/RCTProfile.mpackages/react-native/React/Views/ScrollView/RCTScrollView.hpackages/react-native/ReactCommon/react/renderer/components/view/BaseTouch.cpppackages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspecConflict resolution reviewer table
workspace:*edges, thereact-native-macosidentity, the fork virtualized-lists replacement, and security overrides. The fmt value is the upstream-equivalent12.1.0.TARGET_OS_OSX; SwiftPM excludes tvOS host sources and the fork-root coordinator while retaining the platform/ios header root. The React-Fabric podspec mirrors macOS-versus-cxx source selection. Review source lists and header search roots together.RCTPlatformView,RCTPlatformColor,RCTUIView,RCTUIScrollView, and otherRCTUIKitabstractions while taking 0.86 subclassability, clipped-subview ownership, imperative focus, content-metrics ordering, zoom scale, renderer-debug, animated/mutation/view-transition/tracing, and nullable UTF-8 changes.orderOut:rather than UIKit's hidden property.TARGET_OS_SXguard typo and provide forwarding/dispatch headers for the evolved key/mouse include shape.250829098.0.12for this fork point. Production resolution defaults to Hermes V1 unlessRCT_HERMES_V1_ENABLED=0, downloads the production archive, and recomposes the standalone macOS slice into the xcframework before prebuilds.PODFILE_DIRproject setting.RCTUIKitand other fork behavior with canonical markers where comments are legal. Generated JSON, locks, snapshots, API output, and structural deletions are explicitly classified rather than force-tagged.Layered commits
4014f771b43d804c242f407b95ef3a999a48b24ffeat: merge React Native 0.86 fork point279148b3e255bcade03da5033583211860df1170feat(macos): port React Native 0.86 platform changes6d613d39f44a654d5d2ecd95cda8131502776b86fix(hermes): align 0.86 compiler artifacts01e4c1a79c6d14a41b91beb4cdb0b986d78a9d8echore: regenerate 0.86 derived artifacts5db7b732baf81cafa34ad53d55890520a2e49709chore: audit 0.86 macOS diff tags04900d746ede6566bf531ede20e1b45eb3df9798fix(workspaces): align 0.86 parser tooling083d8059ee693842b9c1e8af4ee51d7c73e9e42ffix(macos): port 0.86 native ownershipc0073885ad61cc22aa2b32077163a36aaa853d87fix(codegen): transpile absolute source paths0d5c74fa75553d1542de6f10eb0df9be84106adfchore: audit 0.86 follow-up diff tagsbcf6084886b989b617546d4e538eb3ac63857aa4fix(swiftpm): single host source ownership for 0.86 Fabric958d45274e048d381d7f967393f963fbd535854dfix(macos): guard 0.86 frame timings observer45a553efbfb797568a1c107ef2c1a25e02ec2b66fix(macos): hide 0.86 loading window with AppKitc5a4a2ec46faabd2beb39629cd6aec1c49f844a7fix(hermes): default production resolver to Hermes V1db92dc832747c4ad003d8fe12da35f7dc56880b4chore: regenerate 0.86 pod artifactsThe first port layer carries reviewed 0.86 macOS behavior, while generated output is separate from semantic source changes. Later recovery layers are deliberately narrow: parser tooling, native ownership, absolute-path codegen, follow-up tag audit, single-source Fabric ownership, frame timing, AppKit loading behavior, production Hermes selection, and the final pod checksum.
Commands used
The rough command sequence was:
jj new <0.85-merge> <0.86-fork-point>; usejj resolve, focused edits, andjj describefor resolution layers, thenjj git exportthe Git commits.pod install; retain semantic lock/checksum output and restore path-sensitive project output.resolve-hermes.mts download-hermes Debug, thenresolve-hermes.mts recompose-xcframework ...; verify the macOS library entry and prepare the production prebuilt Hermes tree.ios-prebuild.jsbuild slices: iOS, iOS Simulator, macOS, visionOS, and visionOS Simulator.xcodebuild.The first monolithic final Xcode attempt was not all green. Xcode 26 SwiftBuild stalled at
CreateBuildDescriptionafter interrupted shared build state. Failed logs and exact owned process information were retained; no stalled result counted as a pass. Clean sequential retries then ran against the same exact head/export and passed all five prebuild slices, all three RNTester builds, and the ownership gate. Independent review accepted the consolidated canonical retries as genuine environmental stalls rather than source failures.Validation
All 42/42 canonical gates exit with
0.HostPlatformViewProps=1andCoordinator=1; CocoaPods selects the same coordinator for all 3 RNTester targets.250829098.0.12and fmt12.1.0.Diff-tag independent judge gate
The canonical diff guide remains methodology-only and byte-identical, SHA-256
79f533c26acf8e23bc2ea09d74d744aa16a1ed0b0ceecd026665af4a0f7d4d4c; it was not modified to make this merge pass.The scoped audit covers 73 paths: 42 tagged, 25 exempt, and 6 upstream-equal, with 0 failures. The logical-condition audit reports 0 untagged conditions and 0 manual reviews. The scope includes merge-touched files and focused follow-up layers; the broad historical fork scan remains supplemental.
The independent judge must rerun and enforce this contract. Any retained fork behavior without a canonical marker, invalid pairing, unsupported deletion, unclassified changed condition, or inappropriate exemption is a blocking failure.
Novel conflict classes and skill lessons
Focused follow-up PR candidates
Proposed draft metadata
feat: merge \0.86-merge` into 0.85-merge`microsoft:0.85-mergeSaadnajmi:0.86-merge