Repository navigation
Commit 9e4df29
authored
Support React Native 0.87 on 2.x (#4497)
## Description
Brings React Native 0.87 support to the 2.x line. Mirrors the changes
already on main (#4247, #4310, #4311, #4319), trimmed to what the v2
code needs.
Native (iOS):
- Remove the unused `RCTRootContentView.h` import. The header is gone
from the prebuilt React-Core framework in 0.87.
- `RCTCxxBridge` no longer exists, so the `isViewFlatteningDisabled` JSI
binding is now installed via `RCTTurboModuleWithJSIBindings`. Gated
behind `REACT_NATIVE_MINOR_VERSION >= 87`, older versions keep the
previous code path.
TypeScript:
- Bump TypeScript to 6.0.3 (cherry-pick of #4311) and switch
`moduleResolution` to `bundler`. RN 0.87 exposes its types only through
the package `exports` map.
- Port the Strict TS API fixes (cherry-pick of #4319, v2 subset):
`CodegenTypes` namespace and public `codegenNativeComponent` in specs,
`ComponentRef`-based ref types in Pressable, Text, GestureComponents,
style fixes in touchables.
- Explicit type annotations in `mocks.tsx` and
`GestureHandlerButton.web.tsx`. TS 6 refuses to emit declarations that
reach RN's non-exported type aliases.
- Cast in legacy `Swipeable` where `interpolate` overloads on a `Value |
AnimatedInterpolation` union no longer unify.
- `unbound-method` lint adjustments for methods RN 0.87 now types as
class members.
Example apps:
- Bump `basic-example` to RN 0.87.1, Reanimated 4.6.0, Worklets 0.12.1.
- Pin `expo` to 56.0.21 and patch `expo-modules-core` 56.0.25
(`executeSync` -> `runSync`), which Worklets 0.12 removed. The
resolution is keyed on the range expo declares, so the exact pin keeps
the patch applying.
- Type fixes in `common-app` examples for the 0.87 types.
## Test plan
- `yarn ts-check`, `yarn lint-js`, `yarn jest`
- Build `basic-example` on iOS and Android
- Build `expo-example` on iOS and Android1 parent f68a21a commit 9e4df29
48 files changed
Lines changed: 2522 additions & 1908 deletions
File tree
- .yarn/patches
- apps
- basic-example
- android
- app
- gradle/wrapper
- ios
- BasicExample
- src
- common-app
- src
- ListWithHeader
- new_api/calculator
- recipes
- panAndScroll
- scaleAndRotate
- release_tests
- combo
- nestedFling
- touchables
- showcase/bottomSheet
- expo-example
- macos-example
- packages/react-native-gesture-handler
- apple
- src
- components
- Pressable
- touchables
- mocks
- specs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments