react-native-update 10.37.13 → 10.37.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-CN.md +72 -0
- package/README.md +61 -49
- package/android/build.gradle +47 -17
- package/bunfig.toml +2 -0
- package/error.js +1609 -0
- package/harmony/har-wrapper/AppScope/app.json5 +8 -0
- package/harmony/har-wrapper/build-profile.json5 +35 -0
- package/harmony/har-wrapper/hvigor/hvigor-config.json5 +5 -0
- package/harmony/har-wrapper/hvigorfile.ts +6 -0
- package/harmony/har-wrapper/oh-package.json5 +4 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/cache-v2-77b153ce45aba0ed28ef.json +1415 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-b65a07793384e0ce3e08.json +809 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-ce0e89410afd8bf3a057.json +60 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/directory-.-Release-f5ebdc15457944623624.json +14 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/index-2026-03-16T14-00-08-0134.json +89 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/target-rnupdate-Release-267153624504c9c3ffdd.json +222 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.ninja_deps +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.ninja_log +8 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeCache.txt +415 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeCCompiler.cmake +74 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeCXXCompiler.cmake +85 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_C.bin +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeSystem.cmake +15 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdC/CMakeCCompilerId.c +880 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdC/CMakeCCompilerId.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +869 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/CMakeConfigureLog.yaml +388 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/TargetDirectories.txt +3 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/cmake.check_cache +1 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/HDiffPatch/file_for_patch.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/HDiffPatch/libHDiffPatch/HPatch/patch.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/hpatch.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/lzma/C/Lzma2Dec.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/lzma/C/LzmaDec.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/pushy.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rules.ninja +64 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/additional_project_files.txt +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/build.ninja +206 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/build_file_index.txt +1 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/cmake_install.cmake +54 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/compile_commands.json +38 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/configure_fingerprint.json +1 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/hvigor_native_config.json +1 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/metadata_generation_command.txt +17 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/native_work_dir.txt +1 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/output.log +14 -0
- package/harmony/pushy/.cxx/default/default/release/hvigor/arm64-v8a/summary.cmake +0 -0
- package/harmony/pushy/BuildProfile.ets +3 -5
- package/harmony/pushy/build-profile.json5 +8 -1
- package/harmony/pushy/oh-package-lock.json5 +1 -1
- package/harmony/pushy/src/main/cpp/CMakeLists.txt +42 -30
- package/harmony/pushy/src/main/ets/DownloadTask.ts +145 -106
- package/harmony/pushy/src/main/ets/Logger.ts +24 -7
- package/harmony/pushy/src/main/ets/PushyFileJSBundleProvider.ets +1 -1
- package/harmony/pushy/src/main/ets/PushyTurboModule.ts +9 -73
- package/harmony/pushy/src/main/ets/UpdateContext.ts +206 -70
- package/harmony/pushy.har +0 -0
- package/package.json +9 -6
- package/scripts/build-harmony-har.js +427 -0
- package/scripts/prepublish.ts +113 -0
- package/scripts/read.js +188 -0
- package/src/__tests__/core.test.ts +103 -0
- package/src/__tests__/setup.ts +37 -0
- package/src/__tests__/utils.test.ts +36 -0
- package/src/client.ts +17 -10
- package/src/core.ts +5 -5
- package/src/locales/en.ts +1 -0
- package/src/locales/zh.ts +1 -0
- package/src/utils.ts +13 -1
package/README-CN.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# react-native-update [](http://badge.fury.io/js/react-native-update)
|
|
2
|
+
|
|
3
|
+
[English README](./README.md)
|
|
4
|
+
|
|
5
|
+
本组件是面向 React Native 提供热更新功能的组件,详情请访问我们的官方网站 <https://pushy.reactnative.cn>。
|
|
6
|
+
|
|
7
|
+
### 区域服务说明
|
|
8
|
+
|
|
9
|
+
- 中国区服务使用 **Pushy**(<https://pushy.reactnative.cn>),由**武汉青罗网络科技有限公司**运营,服务器与用户数据存放于中国境内。
|
|
10
|
+
- 全球区服务使用 **Cresc**(<https://cresc.dev>),由 **CHARMLOT PTE. LTD.** 运营,服务器与用户数据存放于新加坡。
|
|
11
|
+
- 中国区与全球区服务由不同公司实体独立运营,服务器、数据存放位置及控制台系统彼此隔离。中国大陆以外开发者建议直接使用 Cresc。
|
|
12
|
+
|
|
13
|
+
**现已支持鸿蒙以及新架构**
|
|
14
|
+
|
|
15
|
+
### 快速开始
|
|
16
|
+
|
|
17
|
+
请查看[文档](https://pushy.reactnative.cn/docs/getting-started.html)
|
|
18
|
+
|
|
19
|
+
### 优势
|
|
20
|
+
|
|
21
|
+
1. 对中国用户使用阿里云高速 CDN 分发,对比其他服务器在国外的热更新服务,分发更稳定,更新成功率极高。中国大陆以外开发者建议使用 Cresc 全球服务(<https://cresc.dev>),其全球节点同样提供稳定高速的分发体验。
|
|
22
|
+
2. 基于 bsdiff/hdiff 算法创建的**超小更新包**,通常版本迭代后在几十至几百 KB 级别(其他全量热更新服务所需流量通常在几十 MB 级别)。
|
|
23
|
+
3. 始终跟进 RN 最新正式版本,第一时间提供支持。支持 hermes 字节码格式。支持新架构(注:安卓 0.73.0 ~ 0.76.0 的新架构因官方 bug 不支持,0.73 以下或 0.76.1 以上的新架构可用)。
|
|
24
|
+
4. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
|
25
|
+
5. 命令行工具 & 网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
|
26
|
+
6. 支持崩溃回滚,安全可靠。
|
|
27
|
+
7. meta 信息及开放 API,提供更高扩展性。
|
|
28
|
+
8. 提供付费的专人技术支持。
|
|
29
|
+
|
|
30
|
+
### 与其他热更新库对比
|
|
31
|
+
|
|
32
|
+
| 对比维度 | react-native-update | expo-update | react-native-code-push |
|
|
33
|
+
|---------|---------------------|-------------|------------------------|
|
|
34
|
+
| **价格/成本** | 提供免费额度,多级梯度付费(最低约 66 元/月),流量不单独计费 | 提供免费额度,多级梯度付费(最低约 136 元/月),超出流量额外计费 | ❌ **已停运**(Microsoft App Center 已于 2025 年 3 月 31 日停止服务) |
|
|
35
|
+
| **更新包大小** | ⭐⭐⭐⭐⭐ 几十至几百 KB(增量更新) | ⭐⭐⭐ 全量更新(通常几十 MB) | ❌ **已停运** |
|
|
36
|
+
| **中国地区访问速度** | ⭐⭐⭐⭐⭐ 阿里云 CDN,速度极快 | ⭐⭐ 国外服务器,可能较慢 | ❌ **已停运** |
|
|
37
|
+
| **iOS 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
38
|
+
| **Android 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
39
|
+
| **鸿蒙支持** | ✅ 支持 | ❌ 不支持 | ❌ **已停运** |
|
|
40
|
+
| **Expo 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
41
|
+
| **RN 版本支持** | ⭐⭐⭐⭐⭐ 第一时间支持最新版本 | ⭐⭐⭐⭐ 跟随 Expo SDK | ❌ **已停运** |
|
|
42
|
+
| **新架构支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
43
|
+
| **Hermes 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
44
|
+
| **崩溃回滚** | ✅ 自动回滚机制 | ✅ 支持 | ❌ **已停运** |
|
|
45
|
+
| **管理界面** | ✅ 命令行工具 + Web 管理界面 | ✅ Expo Dashboard | ❌ **已停运** |
|
|
46
|
+
| **CI/CD 集成** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
47
|
+
| **API 扩展性** | ✅ Meta 信息 + 开放 API | ⚠️ 有限 | ❌ **已停运** |
|
|
48
|
+
| **中文文档/支持** | ⭐⭐⭐⭐⭐ 完整中文文档,中文社区支持 | ⭐⭐ 英文为主 | ❌ **已停运** |
|
|
49
|
+
| **技术支持** | ✅ 付费专人技术支持 | ⚠️ 社区支持 | ❌ **已停运** |
|
|
50
|
+
| **服务器部署** | ✅ 可托管也可付费私有部署 | ✅ Expo 托管(EAS Update) | ❌ **已停运** |
|
|
51
|
+
| **更新策略** | 灵活配置(静默/提示/立即/延迟) | 相对固定 | ❌ **已停运** |
|
|
52
|
+
| **流量消耗** | ⭐⭐⭐⭐⭐ 极低(增量更新) | ⭐⭐⭐ 较高(全量更新) | ❌ **已停运** |
|
|
53
|
+
| **更新成功率** | ⭐⭐⭐⭐⭐ 极高(国内 CDN 优势) | ⭐⭐⭐ 中等 | ❌ **已停运** |
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### 本地开发
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
$ git clone git@github.com:reactnativecn/react-native-update.git
|
|
61
|
+
$ cd react-native-pushy/Example/testHotUpdate
|
|
62
|
+
$ yarn
|
|
63
|
+
$ yarn start
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
本地库文件使用 yarn link 链接,因此可直接在源文件中修改,在 testHotUpdate 项目中调试。
|
|
67
|
+
|
|
68
|
+
### 关于我们
|
|
69
|
+
|
|
70
|
+
本组件由[React Native 中文网](https://reactnative.cn/)独家发布,如有定制需求可以[联系我们](https://reactnative.cn/about.html#content)。
|
|
71
|
+
|
|
72
|
+
关于此插件发现任何问题,可以前往[Issues](https://github.com/reactnativecn/react-native-update/issues)发帖提问。
|
package/README.md
CHANGED
|
@@ -1,64 +1,76 @@
|
|
|
1
1
|
# react-native-update [](http://badge.fury.io/js/react-native-update)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[中文文档](./README-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`react-native-update` provides over-the-air update capabilities for React Native apps. For full documentation, visit:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- China service: <https://pushy.reactnative.cn>
|
|
8
|
+
- Global service: <https://cresc.dev>
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Regional Service Notice
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
- **Pushy** (<https://pushy.reactnative.cn>) is the China service, operated by **Wuhan Qingluo Network Technology Co., Ltd.**, with servers and user data hosted in mainland China.
|
|
13
|
+
- **Cresc** (<https://cresc.dev>) is the global service, operated by **CHARMLOT PTE. LTD.**, with servers and user data hosted in Singapore.
|
|
14
|
+
- Pushy and Cresc are operated by different legal entities with separate infrastructure, data storage, and admin systems. Developers outside mainland China should use Cresc directly.
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
2. 基于 bsdiff/hdiff 算法创建的**超小更新包**,通常版本迭代后在几十至几百 KB 级别(其他全量热更新服务所需流量通常在几十 MB 级别)。
|
|
15
|
-
3. 始终跟进 RN 最新正式版本,第一时间提供支持。支持 hermes 字节码格式。支持新架构(注:安卓 0.73.0 ~ 0.76.0 的新架构因官方 bug 不支持,0.73 以下或 0.76.1 以上的新架构可用)。
|
|
16
|
-
4. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
|
17
|
-
5. 命令行工具 & 网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
|
18
|
-
6. 支持崩溃回滚,安全可靠。
|
|
19
|
-
7. meta 信息及开放 API,提供更高扩展性。
|
|
20
|
-
8. 提供付费的专人技术支持。
|
|
16
|
+
**HarmonyOS and React Native New Architecture are supported.**
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
## Quick Start
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
|---------|---------------------|-------------|------------------------|
|
|
26
|
-
| **价格/成本** | 提供免费额度,多级梯度付费(最低约 66 元/月),流量不单独计费 | 提供免费额度,多级梯度付费(最低约 136 元/月),超出流量额外计费 | ❌ **已停运**(Microsoft App Center 已于 2025 年 3 月 31 日停止服务) |
|
|
27
|
-
| **更新包大小** | ⭐⭐⭐⭐⭐ 几十至几百 KB(增量更新) | ⭐⭐⭐ 全量更新(通常几十 MB) | ❌ **已停运** |
|
|
28
|
-
| **中国地区访问速度** | ⭐⭐⭐⭐⭐ 阿里云 CDN,速度极快 | ⭐⭐ 国外服务器,可能较慢 | ❌ **已停运** |
|
|
29
|
-
| **iOS 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
30
|
-
| **Android 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
31
|
-
| **鸿蒙支持** | ✅ 支持 | ❌ 不支持 | ❌ **已停运** |
|
|
32
|
-
| **Expo 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
33
|
-
| **RN 版本支持** | ⭐⭐⭐⭐⭐ 第一时间支持最新版本 | ⭐⭐⭐⭐ 跟随 Expo SDK | ❌ **已停运** |
|
|
34
|
-
| **新架构支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
35
|
-
| **Hermes 支持** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
36
|
-
| **崩溃回滚** | ✅ 自动回滚机制 | ✅ 支持 | ❌ **已停运** |
|
|
37
|
-
| **管理界面** | ✅ 命令行工具 + Web 管理界面 | ✅ Expo Dashboard | ❌ **已停运** |
|
|
38
|
-
| **CI/CD 集成** | ✅ 支持 | ✅ 支持 | ❌ **已停运** |
|
|
39
|
-
| **API 扩展性** | ✅ Meta 信息 + 开放 API | ⚠️ 有限 | ❌ **已停运** |
|
|
40
|
-
| **中文文档/支持** | ⭐⭐⭐⭐⭐ 完整中文文档,中文社区支持 | ⭐⭐ 英文为主 | ❌ **已停运** |
|
|
41
|
-
| **技术支持** | ✅ 付费专人技术支持 | ⚠️ 社区支持 | ❌ **已停运** |
|
|
42
|
-
| **服务器部署** | ✅ 可托管也可付费私有部署 | ✅ Expo 托管(EAS Update) | ❌ **已停运** |
|
|
43
|
-
| **更新策略** | 灵活配置(静默/提示/立即/延迟) | 相对固定 | ❌ **已停运** |
|
|
44
|
-
| **流量消耗** | ⭐⭐⭐⭐⭐ 极低(增量更新) | ⭐⭐⭐ 较高(全量更新) | ❌ **已停运** |
|
|
45
|
-
| **更新成功率** | ⭐⭐⭐⭐⭐ 极高(国内 CDN 优势) | ⭐⭐⭐ 中等 | ❌ **已停运** |
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### 本地开发
|
|
20
|
+
See the docs:
|
|
50
21
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
22
|
+
- Chinese docs: <https://pushy.reactnative.cn/docs/getting-started.html>
|
|
23
|
+
- English docs: <https://cresc.dev/docs/getting-started>
|
|
24
|
+
|
|
25
|
+
## Advantages
|
|
26
|
+
|
|
27
|
+
1. For users in China, updates are distributed through Alibaba Cloud CDN for high stability and excellent delivery success. For developers outside mainland China, Cresc provides a dedicated global service with fast and reliable worldwide delivery.
|
|
28
|
+
2. **Tiny update packages** generated with bsdiff/hdiff are typically only tens to hundreds of KB, instead of the tens of MB usually required by full-bundle update systems.
|
|
29
|
+
3. The library tracks new React Native stable releases closely, supports Hermes bytecode, and supports the new architecture. Note: Android RN 0.73.0 to 0.76.0 new architecture is unavailable because of upstream issues; versions below 0.73 or above 0.76.1 are supported.
|
|
30
|
+
4. When updating across multiple versions, clients only need to download **one update package** instead of applying every intermediate version in sequence.
|
|
31
|
+
5. Command-line tools and a web dashboard are both available, making release workflows simple and CI-friendly.
|
|
32
|
+
6. Built-in crash rollback keeps updates safe and reliable.
|
|
33
|
+
7. Meta information and open APIs make the system more extensible.
|
|
34
|
+
8. Paid technical support is available.
|
|
35
|
+
|
|
36
|
+
## Comparison With Other OTA Libraries
|
|
37
|
+
|
|
38
|
+
| Category | react-native-update | expo-update | react-native-code-push |
|
|
39
|
+
|---------|---------------------|-------------|------------------------|
|
|
40
|
+
| **Price / Cost** | Free tier with multiple paid plans (starting at about CNY 66/month), bandwidth included | Free tier with multiple paid plans (starting at about CNY 136/month), extra bandwidth charges apply | ❌ **Discontinued** (Microsoft App Center shut down on March 31, 2025) |
|
|
41
|
+
| **Package Size** | ⭐⭐⭐⭐⭐ Tens to hundreds of KB (incremental) | ⭐⭐⭐ Full bundle updates (usually tens of MB) | ❌ **Discontinued** |
|
|
42
|
+
| **China Access Speed** | ⭐⭐⭐⭐⭐ Alibaba Cloud CDN, very fast | ⭐⭐ Overseas servers, may be slower | ❌ **Discontinued** |
|
|
43
|
+
| **iOS Support** | ✅ Supported | ✅ Supported | ❌ **Discontinued** |
|
|
44
|
+
| **Android Support** | ✅ Supported | ✅ Supported | ❌ **Discontinued** |
|
|
45
|
+
| **HarmonyOS Support** | ✅ Supported | ❌ Not supported | ❌ **Discontinued** |
|
|
46
|
+
| **Expo Support** | ✅ Supported | ✅ Supported | ❌ **Discontinued** |
|
|
47
|
+
| **RN Version Support** | ⭐⭐⭐⭐⭐ Fast support for latest stable RN versions | ⭐⭐⭐⭐ Follows Expo SDK cadence | ❌ **Discontinued** |
|
|
48
|
+
| **New Architecture** | ✅ Supported | ✅ Supported | ❌ **Discontinued** |
|
|
49
|
+
| **Hermes Support** | ✅ Supported | ✅ Supported | ❌ **Discontinued** |
|
|
50
|
+
| **Crash Rollback** | ✅ Automatic rollback | ✅ Supported | ❌ **Discontinued** |
|
|
51
|
+
| **Management UI** | ✅ CLI + Web dashboard | ✅ Expo Dashboard | ❌ **Discontinued** |
|
|
52
|
+
| **CI/CD Integration** | ✅ Supported | ✅ Supported | ❌ **Discontinued** |
|
|
53
|
+
| **API Extensibility** | ✅ Meta info + Open API | ⚠️ Limited | ❌ **Discontinued** |
|
|
54
|
+
| **Chinese Docs / Support** | ⭐⭐⭐⭐⭐ Complete Chinese docs and community support | ⭐⭐ Mostly English | ❌ **Discontinued** |
|
|
55
|
+
| **Technical Support** | ✅ Paid dedicated support | ⚠️ Community support | ❌ **Discontinued** |
|
|
56
|
+
| **Server Deployment** | ✅ Hosted service or paid private deployment | ✅ Hosted by Expo (EAS Update) | ❌ **Discontinued** |
|
|
57
|
+
| **Update Strategy** | Flexible configuration (silent / prompted / immediate / delayed) | More fixed workflow | ❌ **Discontinued** |
|
|
58
|
+
| **Bandwidth Usage** | ⭐⭐⭐⭐⭐ Very low (incremental) | ⭐⭐⭐ Higher (full bundle) | ❌ **Discontinued** |
|
|
59
|
+
| **Update Success Rate** | ⭐⭐⭐⭐⭐ Excellent, especially in China | ⭐⭐⭐ Moderate | ❌ **Discontinued** |
|
|
60
|
+
|
|
61
|
+
## Local Development
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
git clone git@github.com:reactnativecn/react-native-update.git
|
|
65
|
+
cd react-native-pushy/Example/testHotUpdate
|
|
66
|
+
yarn
|
|
67
|
+
yarn start
|
|
56
68
|
```
|
|
57
69
|
|
|
58
|
-
|
|
70
|
+
The local library is linked with `yarn link`, so you can modify the source files directly and debug with the `testHotUpdate` example project.
|
|
59
71
|
|
|
60
|
-
|
|
72
|
+
## About
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
This package is published by [React Native Chinese](https://reactnative.cn/). For custom integration or service inquiries, see [Contact Us](https://reactnative.cn/about.html#content).
|
|
63
75
|
|
|
64
|
-
|
|
76
|
+
If you find any issues, please open a thread in [Issues](https://github.com/reactnativecn/react-native-update/issues).
|
package/android/build.gradle
CHANGED
|
@@ -22,6 +22,41 @@ def supportsNamespace() {
|
|
|
22
22
|
return major >= 8
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
def parseMajorVersion(String versionString) {
|
|
26
|
+
if (!versionString) {
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def matcher = (versionString =~ /(\d+)/)
|
|
31
|
+
if (matcher.find()) {
|
|
32
|
+
return matcher[0][0].toInteger()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return null
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
def resolveInstalledExpoMajorVersion(File projectDir) {
|
|
39
|
+
try {
|
|
40
|
+
def stdout = new ByteArrayOutputStream()
|
|
41
|
+
def stderr = new ByteArrayOutputStream()
|
|
42
|
+
def result = project.exec {
|
|
43
|
+
workingDir projectDir
|
|
44
|
+
commandLine 'node', '--print', "require('expo/package.json').version"
|
|
45
|
+
standardOutput = stdout
|
|
46
|
+
errorOutput = stderr
|
|
47
|
+
ignoreExitValue true
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (result.exitValue != 0) {
|
|
51
|
+
return null
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return parseMajorVersion(stdout.toString().trim())
|
|
55
|
+
} catch (Exception ignored) {
|
|
56
|
+
return null
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
25
60
|
def checkProjectInfo() {
|
|
26
61
|
def hasExpoModulesCore = rootProject.subprojects.any { it.name == 'expo-modules-core' }
|
|
27
62
|
def packageJsonFile = new File(rootProject.projectDir.parentFile, 'package.json')
|
|
@@ -33,24 +68,19 @@ def checkProjectInfo() {
|
|
|
33
68
|
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
|
|
34
69
|
projectVersion = packageJson.version ?: '1.0.0' // Get project version
|
|
35
70
|
|
|
36
|
-
// Check for expo dependency and version >= 50
|
|
71
|
+
// Check for expo dependency and version >= 50.
|
|
72
|
+
// For pnpm catalogs (e.g. "catalog:native"), the version string in package.json
|
|
73
|
+
// is not numeric, so we resolve the installed expo package version as fallback.
|
|
37
74
|
String expoVersionString = packageJson.dependencies?.expo ?: packageJson.devDependencies?.expo
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
} catch (NumberFormatException e) {
|
|
50
|
-
// Handle error if version parsing fails, maybe log a warning
|
|
51
|
-
println "Warning: Could not parse Expo version string: ${expoVersionString}"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
75
|
+
Integer declaredExpoMajorVersion = parseMajorVersion(expoVersionString)
|
|
76
|
+
Integer installedExpoMajorVersion = expoVersionString ?
|
|
77
|
+
resolveInstalledExpoMajorVersion(packageJsonFile.parentFile) :
|
|
78
|
+
null
|
|
79
|
+
Integer expoMajorVersion = installedExpoMajorVersion ?: declaredExpoMajorVersion
|
|
80
|
+
|
|
81
|
+
boolean expoVersionIsHighEnough =
|
|
82
|
+
expoMajorVersion != null && expoMajorVersion >= 50
|
|
83
|
+
|
|
54
84
|
hasExpoDependency = expoVersionIsHighEnough // Update based on version check
|
|
55
85
|
}
|
|
56
86
|
|
package/bunfig.toml
ADDED