feat: support React Native 0.87.1 and fix navigation edge cases - #8344
Open
OskarEichler wants to merge 3 commits into
Open
feat: support React Native 0.87.1 and fix navigation edge cases#8344OskarEichler wants to merge 3 commits into
OskarEichler wants to merge 3 commits into
Conversation
Adapt native APIs, Fabric shared-element ordering, strict public types and modern ReactHost autolinking. Add compatibility CI and regression coverage, repair native test-host linkage, and clear existing lint errors.
Address the branch review findings with processor/event/linking fixes, cancellable Android preparation, direct custom-tab lifecycle tracking, responsive modal sizing, safer iOS animation/layout handling, and reproducible contributor tooling. Add regression coverage and document observable behavior changes.
Author
|
@mobileoss 🙌🏼 |
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.
Review fixes included
This PR now includes the follow-up correctness and performance fixes found during the full branch review, in addition to RN 0.87.1 compatibility:
screenPoppedevents correctly; check deprecated option paths once per options object.GlobalScopepreparation with controller-owned cancellable work; remove render/image listeners on cancellation or teardown; cancel pending animations as well as started ones. Shared-element image readiness accepts downscaled images and has a one-second fallback per image instead of waiting indefinitely.Regression tests cover these fixes. Compatibility and externally observable behavior changes are called out below; reference-device visual limitations remain explicit.
Most findings fix pre-existing library behavior, not regressions introduced by RN 0.87. The Gesture Handler round-trip issue was introduced by the compatibility mapping. The follow-up is kept in a separate commit for review. Performance improvements remove repeated work; no frame-time benchmark is claimed.
Summary
Add React Native 0.87.1 compatibility while keeping the repository's RN 0.85.2 development baseline and existing public navigation API.
RCTHostimports that work with both source and prebuilt React Native.ReactHostdev-support access. Replace removedViewGroupManager.getViewZIndexwith Fabric native-hierarchy ordering, preserving sibling order when shared elements are restored.Suggested release line: RNN 8.9.0. No package version bump is included; final release numbering is left to maintainers.
Breaking changes and migration notes
React Native Navigation API
No public navigation API removals, signature changes, or native codegen contract changes are intended. Correctness fixes do change the observable behaviors listed below. The existing RN 0.85.2 development baseline is retained; consumers are not forced to upgrade React Native by this PR. Declaration compatibility is also checked against RN 0.77.
Android shared-element stacking now follows Fabric's native sibling/ancestor ordering and Android elevation, replacing the removed RN z-index helper. Apps relying on the old incorrect stacking order may see corrected overlap during transitions. Original child order is restored after completion/cancellation.
Observable behavior changes from the review fixes
screenPoppedlisteners, not preview listeners. Unsubscribing a processor no longer removes later registrations; repeated removal is a no-op. Custom color/image transformations now reach native normalization. Multiple processors retain the existing original-input/last-result-wins behavior.react-lifecycles-compatis no longer a direct RNN/playground dependency or invoked by RNN. It remains a transitive playground dependency throughremx; this does not raise the supported React Native floor.Requirements when upgrading an app to RN 0.87.1
android.builtInKotlin=falseandandroid.newDsl=falsewhile using this integration.moduleResolution: "bundler"/module: "esnext", or the RN TypeScript configuration), migrate private RN deep imports and obsolete ref types in application code. RNN no longer requires the legacy deep-import opt-out; itsColortype uses RN's publicColorValue.reactHost, extendNavigationApplication, and removeloadReactNative(this)because RNN initializes RN. Existing legacy-host applications remain supported; useNavigationReactNativeHost(this@MainApplication)for the anonymous host.The RN upgrade also removes/deprecates APIs outside RNN. Consult the official RN 0.87 breaking-change notes when migrating application code.
Contributor/playground changes (not consumer requirements)
gestureHandlerRootHOC; the playground uses a compatibleGestureHandlerRootViewwrapper that preserves screen statics on GH 2 and 3. This does not impose these dependencies on RNN consumers.alert; its explicitshowAlerthelper keeps the same overlay behavior.Verification after the review fixes
On RN 0.87.1 and RN 0.85.2:
abortOnError false.Additional RN 0.87 checks:
git diff --checkalso passed.Earlier compatibility verification (before the follow-up fixes)
RN 0.87.1, Node 22.23.2, Java 17, Xcode 26.6 / iOS Simulator 26.5, Android API 35 emulator:
git diff --check: passed (four existing script style warnings).Existing/environmental verification limits
UnmountRaceScreenfixture firespopandpushconcurrently and clears module-global data on unmount. The new screen can displaystale_unmountwhen the outgoing screen unmounts after the new screen mounts. The follow-up build failed once and passed an unchanged isolated rerun. For a controlled comparison, restored the Android/JS runtime files to pre-fix commitb58d499, rebuilt the RN 0.87 Release app, and ran the same test: three passes followed by the identical failure on attempt four. Restored all fixes afterward. This is not a demonstrated regression from these fixes, but the fixture/overlapping-command lifecycle behavior remains unresolved; the Android E2E suite is not claimed fully green. The assertion was not weakened and the test was not skipped.