Conversation
8e1f4ce to
136bc6d
Compare
|
Switching to multi-root is a pretty big change, and we should probably discuss the consequences a bit more. Can we do something similar to react-native-screens and keep everything in a single root? |
|
@javache We can, but while depending on Unless we patch or depend on at least a suitable SafeAreaView in core, this is a pragmatic way to opt out of solving these concerns, IMO. |
|
Yeah, not suggesting we adopt |
+1 to this. I also don't think we should optimize RNTester for iPhone Duo. We haven't optimized it for Android Foldable devices either. We run e2e tests on this app so the simpler it is to maintain, the better. |
|
I think I'll be able to push an update that keeps the single root design from the JS point of view 👍🏻 Due next week. @cortinico Disagree. It's reasonable to make our tester app usable, and before this diff we already had UX bugs on regular iPhones. It's also not, theoretically, out of scope for core to implement some incoming foldable APIs/behaviours, so it's nice to at least view RNTester on a foldable without blatant safe area bugs. (Aware we will probably try to add these APIs via other libraries, but it's not fundamentally off the table.) If we support iOS, it's worth having a trivial navigation setup for our iOS tester app — especially if it saves maintaining custom UI code. |
Summary:
Migrates RNTester on iOS from a single React Native entry point to a native
UITabBarControllerstack — allowing us to leverage the platform tab bar, header, and safe area behaviours needed to support iPhone Duo.Android is unchanged. No new capabilities are added to React Native itself.
Motivation
RNTester on iOS runs as one React Native surface that draws its own header and bottom tab bar in JS, so it cannot follow platform layouts such as iPhone Duo's, where the status bar sits in a side cutout and the tab bar moves to the side.
Necessary and intentional fork: Fork the iOS RNTester app to a native navigation setup, which gives RNTester the platform tab bar, header and back gesture, minimally supports iPhone Duo, and takes the brownfield shape many apps embed React Native in.
<SafeAreaView>in core at this stage, or making any hardcoded hacks to the custom tab bar — which had already drifted into buggy territory on the regular iPhone.react-native-screens, to avoid introducing a dependency within core (againstmain).Changes
UITabBarControllerholding Components, APIs and Playground, each aUINavigationControllerstack; every tab root and pushed module or example mounts its ownRNTesterScreensurface, kept within the safe area.RNTesterNavigatormodule, and share Recently Viewed across surfaces.Out-of-tree platforms: On iOS, RNTester is no longer a single React Native surface, so platforms reusing its JS will need equivalent native wiring for the main pages. The single-surface
RNTesterAppstays registered, and Android is entirely unchanged.Notes
resolveExampleURLis extracted fromRNTesterAppSharedin this PR rather than a separate one: it exists only so both shells share the deep link parsing, and the navigator is what needs it.Changelog: [Internal]
Test Plan:
xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 18 Pro' buildapis-tabtest ID the Maestro flow uses; modules and examples push with native back and the docs button; Recently Viewed updates on the list.rntester://example/Switch) and at cold launch (rntester://example/Image).