react-native-update 7.4.3 → 8.0.0
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.md +2 -1
- package/lib/simpleUpdate.js +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
### 优势
|
|
10
10
|
|
|
11
11
|
1. 基于阿里云高速 CDN 分发,对比其他服务器在国外的热更新服务,分发更稳定,更新成功率极高。
|
|
12
|
-
2. 基于 bsdiff/hdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB
|
|
12
|
+
2. 基于 bsdiff/hdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间(其他全量热更新服务所需流量通常在 1-10MB 级别)。
|
|
13
13
|
3. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
|
14
14
|
4. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
|
15
15
|
5. 支持崩溃回滚,安全可靠。
|
|
16
16
|
6. meta 信息及开放 API,提供更高扩展性。
|
|
17
|
+
7. 提供付费的专人技术支持。
|
|
17
18
|
|
|
18
19
|
### 本地开发
|
|
19
20
|
|
package/lib/simpleUpdate.js
CHANGED
|
@@ -12,10 +12,11 @@ import {
|
|
|
12
12
|
downloadAndInstallApk,
|
|
13
13
|
} from './main';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
const { appKey } =
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export function simpleUpdate(WrappedComponent, options = {}) {
|
|
16
|
+
const { appKey } = options;
|
|
17
|
+
if (!appKey) {
|
|
18
|
+
throw new Error('appKey is required for simpleUpdate()');
|
|
19
|
+
}
|
|
19
20
|
return __DEV__
|
|
20
21
|
? WrappedComponent
|
|
21
22
|
: class AppUpdate extends Component {
|