Skip to content
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

Feat/rn73 #16807

Merged
merged 6 commits into from
Nov 7, 2024
Merged

Feat/rn73 #16807

merged 6 commits into from
Nov 7, 2024

Conversation

zhiqingchen
Copy link
Member

@zhiqingchen zhiqingchen commented Nov 4, 2024

这个 PR 做了什么? (简要描述所做更改)

  1. 将所有原生依赖与 RN 0.73 expo 50 对齐。因为 RN 原生依赖差异较大,没对齐无法编译。模板和壳工程使用了源码里的 "peerDependencies" 进行对齐。
  2. 升级到 0.73 后的编译问题。
  3. rimraf --impl=move-remove 改成 rimraf。因为项目在mac 移动硬盘中无法编译。--impl=move-remove 是否有必要保留?正常情况在用默认的就行,不必要特别指定。
  4. 删除 babel-plugin-minify-dead-code-elimination
  5. linaria 版本更新,by @SidneyLann

对应的资源

  1. 壳工程默认分支切换到 0.73.0 https://github.com/NervJS/taro-native-shell/tree/0.73.0
  2. 已更新 4.x 分支 https://github.com/NervJS/taro-project-templates/tree/v4.0/react-native
  3. playground 升级到 v1.11.0 https://github.com/wuba/taro-playground/tree/releases/v1.11.0

测试版本:4.0.7-canary.4

这个 PR 是什么类型? (至少选择一个)

  • 错误修复(Bugfix) issue: fix #
  • 新功能(Feature)
  • 代码重构(Refactor)
  • TypeScript 类型定义修改(Typings)
  • 文档修改(Docs)
  • 代码风格更新(Code style update)
  • 其他,请描述(Other, please describe):

这个 PR 涉及以下平台:

  • 所有小程序
  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 字节跳动小程序
  • QQ 轻应用
  • 京东小程序
  • 快应用平台(QuickApp)
  • Web 平台(H5)
  • 移动端(React-Native)
  • 鸿蒙(harmony)

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.

Project coverage is 58.52%. Comparing base (9a6bf39) to head (352aeb1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/taro-rn-transformer/src/utils.ts 0.00% 4 Missing ⚠️
...taro-components-rn/src/components/Camera/index.tsx 50.00% 2 Missing ⚠️
packages/taro-rn/src/lib/scanCode/index.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16807      +/-   ##
==========================================
+ Coverage   58.50%   58.52%   +0.01%     
==========================================
  Files         466      466              
  Lines       27107    27099       -8     
  Branches     5927     5914      -13     
==========================================
  Hits        15860    15860              
+ Misses       9902     9770     -132     
- Partials     1345     1469     +124     
Flag Coverage Δ
taro-cli 73.67% <ø> (ø)
taro-runtime 59.87% <ø> (ø)
taro-web 52.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/taro-rn-transformer/src/component.ts 80.64% <100.00%> (ø)
packages/taro-rn/src/lib/scanCode/index.tsx 38.23% <75.00%> (ø)
...taro-components-rn/src/components/Camera/index.tsx 62.06% <50.00%> (-2.22%) ⬇️
packages/taro-rn-transformer/src/utils.ts 36.87% <0.00%> (+1.96%) ⬆️

... and 14 files with indirect coverage changes

@SidneyLann
Copy link
Contributor

能否把#16747的修改也放到这个PR一下?

@zhiqingchen
Copy link
Member Author

可以,感谢

@zhiqingchen
Copy link
Member Author

@SidneyLann 试一下 4.0.7-canary.4

@SidneyLann
Copy link
Contributor

还没review就已发布了吗?

@zhiqingchen
Copy link
Member Author

canary 包,测试用

@SidneyLann
Copy link
Contributor

试了。linaria没问题。但是这句有undefined的异常, main分支已改了,为什么没同步到4.x?
\node_modules@tarojs\runtime-rn\dist\app.js
return (isFunction(component === null || component === void 0 ? void 0 : component.render) || !!(component==undefined||(_a = component.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent) || (component==undefined||component.prototype instanceof Component));

image

@SidneyLann
Copy link
Contributor

/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/permissions/PermissionsService.kt:166:16
/node_modules/expo-sensors/android/src/main/java/expo/modules/sensors/services/BaseSensorService.kt:39:29
这两个类,得把里面的requestedPermissions.contains(改为requestedPermissions!!.contains(才能跑通,这得expo那边改是吧?

@zhiqingchen
Copy link
Member Author

试了。linaria没问题。但是这句有undefined的异常, main分支已改了,为什么没同步到4.x? \node_modules@tarojs\runtime-rn\dist\app.js return (isFunction(component === null || component === void 0 ? void 0 : component.render) || !!(component==undefined||(_a = component.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent) || (component==undefined||component.prototype instanceof Component));

image

https://github.com/NervJS/taro/blob/feat/rn73/packages/taro-runtime-rn/src/app.tsx 代码是一样的

@zhiqingchen
Copy link
Member Author

/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/permissions/PermissionsService.kt:166:16 /node_modules/expo-sensors/android/src/main/java/expo/modules/sensors/services/BaseSensorService.kt:39:29 这两个类,得把里面的requestedPermissions.contains(改为requestedPermissions!!.contains(才能跑通,这得expo那边改是吧?

expo sdk 50 确实有这个问题,需要自行 patch

zhiqingchen and others added 5 commits November 6, 2024 17:19
* upgrade linaria to latest version

* use className instead style

* format

* restore

* use space instead of tab

* tweak for submit fail

* t

---------

Co-authored-by: Administrator <Administrator@tech8>
@SidneyLann
Copy link
Contributor

试了。linaria没问题。但是这句有undefined的异常, main分支已改了,为什么没同步到4.x? \node_modules@tarojs\runtime-rn\dist\app.js return (isFunction(component === null || component === void 0 ? void 0 : component.render) || !!(component==undefined||(_a = component.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent) || (component==undefined||component.prototype instanceof Component));

那这句从哪来?这句我要改成如下才能跑,不然报undefined的异常:
return (isFunction(component === null || component === void 0 ? void 0 : component.render) || !!(component==undefined||(_a = component.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent) || (component==undefined||component.prototype instanceof Component));

@SidneyLann
Copy link
Contributor

SidneyLann commented Nov 6, 2024

我跑完yarn upgradePeerdeps后,仅修改react-native,@react-native/gradle-plugin的版本为0.75.4,项目就能跑通,为什么不直接升级到0.75.4或者0.76.0?

@zhiqingchen
Copy link
Member Author

等 0.76 稳定后会升。0.73 是之前 4.x 的兼容版本,目前是修复问题。

@zhiqingchen zhiqingchen merged commit c17123d into main Nov 7, 2024
38 checks passed
@zhiqingchen zhiqingchen deleted the feat/rn73 branch November 7, 2024 02:57
This was referenced Nov 9, 2024
tutuxxx pushed a commit that referenced this pull request Nov 29, 2024
* feat: native libs version check

* feat: rimraf

* fix: build & test error

* fix: stylelint version

* upgrade linaria to latest version (#16747)

* upgrade linaria to latest version

* use className instead style

* format

* restore

* use space instead of tab

* tweak for submit fail

* t

---------

Co-authored-by: Administrator <Administrator@tech8>

* fix(rn): undefinde error

---------

Co-authored-by: f <voiddlanson@163.com>
Co-authored-by: Administrator <Administrator@tech8>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants