New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to react-native 0.66 #15914
Upgrade to react-native 0.66 #15914
Conversation
e406705
to
d875d5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superb work!
Nice job taking core of each edge case detected 🚀
I've briefly looked at the upgrade from rn@0.66.4
to rn@0.67.0-rc.6
and observed that there's a change in android/build.gradle
regarding fetching react-native
from Maven Central. Should we care about it? Maybe that might cause some additional issues? 🤔
// Copyright 2018-present 650 Industries. All rights reserved. | ||
|
||
#import <ExpoModulesCore/EXComponentDataCompatibleWrapper.h> | ||
|
||
@interface RCTComponentData (EXComponentDataCompatibleWrapper) | ||
|
||
// available in RN 0.65+ | ||
- (instancetype)initWithManagerClass:(Class)managerClass | ||
bridge:(RCTBridge *)bridge | ||
eventDispatcher:(id<RCTEventDispatcherProtocol>) eventDispatcher; | ||
|
||
- (instancetype)initWithManagerClass:(Class)managerClass bridge:(RCTBridge *)bridge; | ||
|
||
@end | ||
|
||
@implementation EXComponentDataCompatibleWrapper | ||
|
||
- (instancetype)initWithManagerClass:(Class)managerClass | ||
bridge:(RCTBridge *)bridge | ||
eventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher | ||
{ | ||
if ([self respondsToSelector:@selector(initWithManagerClass:bridge:)]) { | ||
return [super initWithManagerClass:managerClass bridge:bridge]; | ||
} | ||
return [super initWithManagerClass:managerClass bridge:bridge eventDispatcher:eventDispatcher]; | ||
} | ||
|
||
@end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean solution 👏
that is a nice to have notation that prevent users accidentally to fetch the old react-native from maven central when they do not fetch from node_modules. since we have |
… react-native-codegen
…29) # Why fix android client build error for expo/expo#15914 when different react-native version between `node_modules/react-native` and `react-native-lab/react-native`. # How use the `react-native-codegen` from the same repository.
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
Is there any way to try out expo with this PR? I want to try this out in my project. |
@mangkoran you can try to have a react-native 0.66 project and install expo modules $ npx react-native init RN066 --version 0.66
$ cd RN066
$ npx install-expo-modules |
@Kudo I encountered some issue when trying to run |
Bump `expo-modules-core` to `0.7.0`: # Changelog: ## 0.7.0 — 2022-01-26 ### 🎉 New features - Allow accessing `RCTBridge` from the modules on iOS. ([#15816](expo/expo#15816) by [@tsapeta](https://github.com/tsapeta)) - Added support for native callbacks through the view props in Sweet API on iOS. ([#15731](expo/expo#15731) by [@tsapeta](https://github.com/tsapeta)) - Added support for native callbacks through the view props in Sweet API on Android. ([#15743](expo/expo#15743) by [@lukmccall](https://github.com/lukmccall)) - The `ModuleDefinition` will use class name if the `name` component wasn't provided in Sweet API on Android. ([#15738](expo/expo#15738) by [@lukmccall](https://github.com/lukmccall)) - Added `onViewDestroys` component to the `ViewManager` in Sweet API on Android. ([#15740](expo/expo#15740) by [@lukmccall](https://github.com/lukmccall)) - Added shortened `constants` component that takes `vargs Pair<String, Any?>` as an argument in Sweet API on Android. ([#15742](expo/expo#15742) by [@lukmccall](https://github.com/lukmccall)) - Introduced the concept of chainable exceptions in Sweet API on iOS. ([#15813](expo/expo#15813) by [@tsapeta](https://github.com/tsapeta)) - Sweet function closures can throw errors on iOS. ([#15849](expo/expo#15849) by [@tsapeta](https://github.com/tsapeta)) - Add `requireNativeModule` function to replace accessing native modules from `NativeModulesProxy`. ([#15848](expo/expo#15848) by [@tsapeta](https://github.com/tsapeta)) - Implemented basic functionality of JSI host object to replace `NativeModulesProxy` on iOS. ([#15847](expo/expo#15847) by [@tsapeta](https://github.com/tsapeta)) ### 🐛 Bug fixes - It's no longer possible to directly call methods from the `ModuleDefinition` in the `ViewManagers` on Android. ([#15741](expo/expo#15741) by [@lukmccall](https://github.com/lukmccall)) - Fix compatibility with react-native 0.66. ([#15914](expo/expo#15914) by [@Kudo](https://github.com/kudo)) ## 0.6.4 — 2022-01-05 ### 🐛 Bug fixes - Fix `ReactInstanceManager.onHostPause` exception from moving Android apps to background. ([#15748](expo/expo#15748) by [@Kudo](https://github.com/kudo)) ## 0.6.3 — 2021-12-16 ### 🐛 Bug fixes - Fixed the deep link wasn't passed to the application if the application wasn't running when the deep link was sent. ([#15593](expo/expo#15593) by [@lukmccall](https://github.com/lukmccall)) ## 0.6.2 — 2021-12-15 ### 🎉 New features - Add `onNewIntent` and `onBackPressed` support to `ReactActivityLifecycleListener`. ([#15550](expo/expo#15550) by [@Kudo](https://github.com/Kudo))
# Why follow up expo#15817 (comment) after we use the react-native from npm, the react-native version we used in expo-go is decoupled with other stuffs. that makes us upgrade react-native easier. # How 1. update versions in package.json 2. sync changes from [react-native-upgrade-helper](https://react-native-community.github.io/upgrade-helper/?from=0.64.2&to=0.66.4) 3. `RCTComponentData` changed its designated initializer in react-native 0.65. to make it compatible with older version, i introduced the `EXComponentDataCompatibleWrapper` class to support different versions. 4. [react-native-lab] to fix expo-go build error, we should patch react-native to use the codegen library from its repo but not from node_modules: expo/react-native#29. # Test Plan - CI passed - bare-expo build & launch test - unversioned expo-go build & launch test
…#17266) # Why `__apply_Xcode_12_5_M1_post_install_workaround` was missing when i did #15914. that may introduced some build issue on m1 machine when flipper is enabled. # How - add missing `__apply_Xcode_12_5_M1_post_install_workaround` as from [react-native 0.68 template](https://github.com/facebook/react-native/blob/b5f1b26a8ff4014e45bbb95c5956ba2c2cf286db/template/ios/Podfile#L35) - also update `use_flipper!()` statement as from [react-native 0.68 template](https://github.com/facebook/react-native/blob/b5f1b26a8ff4014e45bbb95c5956ba2c2cf286db/template/ios/Podfile#L31). i think the old flipper issue should be already resolved. # Test Plan tested on m1 macos ```sh $ EXPO_BETA=1 expo init sdk45 # select bare # update ios/Podfile with the change and uncomment use_flipper!() $ expo run:ios # test with flipper ```
…#17266) # Why `__apply_Xcode_12_5_M1_post_install_workaround` was missing when i did #15914. that may introduced some build issue on m1 machine when flipper is enabled. # How - add missing `__apply_Xcode_12_5_M1_post_install_workaround` as from [react-native 0.68 template](https://github.com/facebook/react-native/blob/b5f1b26a8ff4014e45bbb95c5956ba2c2cf286db/template/ios/Podfile#L35) - also update `use_flipper!()` statement as from [react-native 0.68 template](https://github.com/facebook/react-native/blob/b5f1b26a8ff4014e45bbb95c5956ba2c2cf286db/template/ios/Podfile#L31). i think the old flipper issue should be already resolved. # Test Plan tested on m1 macos ```sh $ EXPO_BETA=1 expo init sdk45 # select bare # update ios/Podfile with the change and uncomment use_flipper!() $ expo run:ios # test with flipper ```
Why
follow up #15817 (comment)
after we use the react-native from npm, the react-native version we used in expo-go is decoupled with other stuffs. that makes us upgrade react-native easier.
How
[packages] Fix okio/okhttp compatibility issue #15915 landed.okio
andokhttp
were be upgraded in react-native 0.66. this is the same toRCTComponentData
changed its designated initializer in react-native 0.65. to make it compatible with older version, i introduced theEXComponentDataCompatibleWrapper
class to support different versions.Test Plan
Checklist
expo build
(eg: updated@expo/xdl
).expo prebuild
& EAS Build (eg: updated a module plugin).