react-native-update 7.4.1 → 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/ios/pushy_build_time.txt +1 -1
- package/lib/main.js +1 -11
- package/lib/simpleUpdate.js +5 -4
- package/package.json +2 -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/ios/pushy_build_time.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1654072539
|
package/lib/main.js
CHANGED
|
@@ -181,11 +181,7 @@ export async function downloadUpdate(options, eventListeners) {
|
|
|
181
181
|
}
|
|
182
182
|
if (downloadedHash === options.hash) {
|
|
183
183
|
logger(`duplicated downloaded hash ${downloadedHash}, ignored`);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (readyHash) {
|
|
187
|
-
logger(`hash ${readyHash} applied. reboot first`);
|
|
188
|
-
return;
|
|
184
|
+
return downloadedHash;
|
|
189
185
|
}
|
|
190
186
|
if (downloadingThrottling) {
|
|
191
187
|
logger('repeated downloading, ignored');
|
|
@@ -261,7 +257,6 @@ export async function downloadUpdate(options, eventListeners) {
|
|
|
261
257
|
return options.hash;
|
|
262
258
|
}
|
|
263
259
|
|
|
264
|
-
let readyHash;
|
|
265
260
|
function assertHash(hash) {
|
|
266
261
|
if (!downloadedHash) {
|
|
267
262
|
logger(`no downloaded hash`);
|
|
@@ -271,11 +266,6 @@ function assertHash(hash) {
|
|
|
271
266
|
logger(`use downloaded hash ${downloadedHash} first`);
|
|
272
267
|
return;
|
|
273
268
|
}
|
|
274
|
-
if (readyHash === hash) {
|
|
275
|
-
logger(`hash ${readyHash} already applied. reboot first.`);
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
readyHash = hash;
|
|
279
269
|
return true;
|
|
280
270
|
}
|
|
281
271
|
|
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 {
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-update",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "react-native hot update",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"prepublish": "yarn submodule",
|
|
7
8
|
"submodule": "git submodule update --init --recursive",
|
|
8
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
10
|
"build-lib": "yarn submodule && $ANDROID_HOME/ndk/20.1.5948944/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib"
|