Taro 3.6 版本支持 React Native 0.70 #12468
Replies: 10 comments 6 replies
-
Taro Native Shell 升级至 0.70 测试对应分支 https://github.com/NervJS/taro-native-shell/tree/0.67.0 下载现有包进行验证 https://github.com/NervJS/taro-native-shell/releases/tag/v0.70.0-3 修改代码后
查看打包是否正常进行 |
Beta Was this translation helpful? Give feedback.
-
Taro 主仓库升级至 0.70对应分支 https://github.com/NervJS/taro/tree/feat/react-native pr 包安装 3.5.5-alpha.0 测试要点无 |
Beta Was this translation helpful? Give feedback.
-
Taro Playground 升级至 0.70 测试对应分支 https://github.com/wuba/taro-playground/tree/releases/v1.8.0 包下载 |
Beta Was this translation helpful? Give feedback.
-
Taro Project Template 升级至 0.70 测试对应分支 https://github.com/zhiqingchen/taro-project-templates/tree/v3.6
查看打包是否正常进行 https://github.com/NervJS/taro-native-shell/actions 参考分支 https://github.com/NervJS/taro-native-shell/tree/test/template-0.70-0 |
Beta Was this translation helpful? Give feedback.
-
taro build:rn 能把代码打包成二进制文件吗 |
Beta Was this translation helpful? Give feedback.
-
目前不能,后续计划把build交给rn原逻辑。这样开启hermes后,就能编成二进制文件 |
Beta Was this translation helpful? Give feedback.
-
47发布bete版本了,好多个expo组件也更新了,我都更新了,ios死循环的问题还在 |
Beta Was this translation helpful? Give feedback.
-
将podfile里面的hermes关掉就能运行起来 |
Beta Was this translation helpful? Give feedback.
-
xcode 需要升级至 14.1 |
Beta Was this translation helpful? Give feedback.
-
React Native 0.69 使用 Taro 3.6旧版本从 3.5 升级到 3.6 或使用 Taro 3.5 初始化后,将 taro 相关版本升级到 3.6。需要做兼容。 方案一使用 expo 47,将 ios 支持的最低版本升到 13.0
方案二使用 expo 46,将相关版本锁定在 0.69 对应版本
{
"dependencies": {
"expo": "~46.0.1",
"expo-av": "~12.0.3",
"expo-barcode-scanner": "~11.4.0",
"expo-brightness": "~10.3.0",
"expo-camera": "~12.3.0",
"expo-file-system": "~14.1.0",
"expo-image-picker": "~13.3.1",
"expo-keep-awake": "~10.2.0",
"expo-location": "~14.3.0",
"expo-modules-core": "~0.11.3",
"expo-sensors": "~11.4.0"
},
"resolutions": {
"expo": "~46.0.1",
"expo-av": "~12.0.3",
"expo-barcode-scanner": "~11.4.0",
"expo-brightness": "~10.3.0",
"expo-camera": "~12.3.0",
"expo-file-system": "~14.1.0",
"expo-image-picker": "~13.3.1",
"expo-keep-awake": "~10.2.0",
"expo-location": "~14.3.0",
"expo-modules-core": "~0.11.3",
"expo-sensors": "~11.4.0"
}
} 编译过程:https://github.com/NervJS/taro-native-shell/actions React Native 0.68 使用 Taro 3.6不进行验证,如需可参考 0.69 的方式 |
Beta Was this translation helpful? Give feedback.
-
概述
将默认的 RN 版本切换至 0.70,expo 版本切换至 47。
参考React Native 0.69 版本支持
动机
React Native 0.70 版本已于 2022-9-5 正式发布。0.70 版本 在 Android 将默认使用 Hermes 引擎,Hermes 也带来了RN性能的较大提升,特别是启动场景。
Taro 将与 RN 社区保持同步,将默认的 RN 版本设置为 0.70。
使用案例
将 Taro 升级至最新版,将原生代码根据相关pr进行变更。
详细设计
依赖变更
替换为:
支持使用 react-native 命令进行打包
index.js
内容为空。metro.config.js
配置,从 rn-support 包中引入 taro 的默认配置。yarn start
命令改为react-native start
android/app/build.gradle
的apply from: "../../node_modules/react-native/react.gradle"
yarn build:rn
相关内容Taro 主仓库升级至 0.70
升级内容:
@types/react-native
及react-native
进行版本更新。Taro Native Shell 升级至 0.70
分支:https://github.com/NervJS/taro-native-shell/tree/0.70.0
参考 upgrade-helper
Taro Project Template 升级至 0.70
Taro Playground 升级至 0.70
分支:
https://github.com/wuba/taro-playground/tree/releases/v1.8.0
升级内容:
缺陷
替代选择
N/A
适配策略
常见问题
Library not loaded: @rpath/hermes.framework/hermes on iOS
参考 facebook/react-native#34608 需要使用 2.7.5 的 ruby,重新安装 cocoapods 及进行 pod install
iOS release build crash
参考 expo/expo#19179 (comment)
Beta Was this translation helpful? Give feedback.
All reactions