react-native-update 10.29.0-beta.2 → 10.29.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.
@@ -152,8 +152,13 @@ public class UpdateModuleImpl {
152
152
  reactHostDelegateField.setAccessible(true);
153
153
  Object reactHostDelegate = reactHostDelegateField.get(reactHost);
154
154
 
155
+ String bundleFieldName = "jsBundleLoader";
156
+ if (reactHostDelegate.getClass().getCanonicalName().equals("expo.modules.ExpoReactHostFactory.ExpoReactHostDelegate")) {
157
+ bundleFieldName = "_jsBundleLoader";
158
+ }
159
+
155
160
  // Modify the jsBundleLoader field
156
- Field jsBundleLoaderField = reactHostDelegate.getClass().getDeclaredField("jsBundleLoader");
161
+ Field jsBundleLoaderField = reactHostDelegate.getClass().getDeclaredField(bundleFieldName);
157
162
  jsBundleLoaderField.setAccessible(true);
158
163
  jsBundleLoaderField.set(reactHostDelegate, loader);
159
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.29.0-beta.2",
3
+ "version": "10.29.0",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
@@ -72,6 +72,5 @@
72
72
  "react-native": "0.73",
73
73
  "ts-jest": "^29.3.2",
74
74
  "typescript": "^5.6.3"
75
- },
76
- "packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
75
+ }
77
76
  }
package/src/client.ts CHANGED
@@ -1,33 +1,33 @@
1
- import { CheckResult, ClientOptions, ProgressData, EventType } from './type';
2
- import {
3
- assertWeb,
4
- emptyObj,
5
- enhancedFetch,
6
- joinUrls,
7
- log,
8
- noop,
9
- promiseAny,
10
- testUrls,
11
- } from './utils';
12
1
  import {
2
+ DeviceEventEmitter,
13
3
  EmitterSubscription,
14
4
  Platform,
15
- DeviceEventEmitter,
16
5
  } from 'react-native';
17
- import { PermissionsAndroid } from './permissions';
18
6
  import {
19
7
  PushyModule,
20
8
  buildTime,
21
9
  cInfo,
22
- pushyNativeEventEmitter,
23
10
  currentVersion,
11
+ getCurrentVersionInfo,
12
+ isFirstTime,
13
+ isRolledBack,
24
14
  packageVersion,
15
+ pushyNativeEventEmitter,
25
16
  rolledBackVersion,
26
17
  setLocalHashInfo,
27
- isFirstTime,
28
- isRolledBack,
29
- getCurrentVersionInfo,
30
18
  } from './core';
19
+ import { PermissionsAndroid } from './permissions';
20
+ import { CheckResult, ClientOptions, EventType, ProgressData } from './type';
21
+ import {
22
+ assertWeb,
23
+ emptyObj,
24
+ enhancedFetch,
25
+ joinUrls,
26
+ log,
27
+ noop,
28
+ promiseAny,
29
+ testUrls,
30
+ } from './utils';
31
31
 
32
32
  const SERVER_PRESETS = {
33
33
  // cn
@@ -395,7 +395,7 @@ export class Pushy {
395
395
  let lastError: any;
396
396
  let errorMessages: string[] = [];
397
397
  const diffUrl = await testUrls(joinUrls(paths, diff));
398
- if (diffUrl) {
398
+ if (diffUrl && !__DEV__) {
399
399
  log('downloading diff');
400
400
  try {
401
401
  await PushyModule.downloadPatchFromPpk({
@@ -408,16 +408,12 @@ export class Pushy {
408
408
  const errorMessage = `diff error: ${e.message}`;
409
409
  errorMessages.push(errorMessage);
410
410
  lastError = new Error(errorMessage);
411
- if (__DEV__) {
412
- succeeded = 'diff';
413
- } else {
414
- log(errorMessage);
415
- }
411
+ log(errorMessage);
416
412
  }
417
413
  }
418
414
  if (!succeeded) {
419
415
  const pdiffUrl = await testUrls(joinUrls(paths, pdiff));
420
- if (pdiffUrl) {
416
+ if (pdiffUrl && !__DEV__) {
421
417
  log('downloading pdiff');
422
418
  try {
423
419
  await PushyModule.downloadPatchFromPackage({
@@ -429,12 +425,7 @@ export class Pushy {
429
425
  const errorMessage = `pdiff error: ${e.message}`;
430
426
  errorMessages.push(errorMessage);
431
427
  lastError = new Error(errorMessage);
432
- if (__DEV__ && !full) {
433
- succeeded = 'pdiff';
434
- log('当前是开发环境,无法执行增量式热更新。如果需要在开发环境中测试全量热更新,请打开“忽略时间戳”开关再重试。');
435
- } else {
436
- log(errorMessage);
437
- }
428
+ log(errorMessage);
438
429
  }
439
430
  }
440
431
  }
@@ -452,12 +443,15 @@ export class Pushy {
452
443
  const errorMessage = `full patch error: ${e.message}`;
453
444
  errorMessages.push(errorMessage);
454
445
  lastError = new Error(errorMessage);
455
- if (__DEV__) {
456
- succeeded = 'full';
457
- } else {
458
- log(errorMessage);
459
- }
446
+ log(errorMessage);
460
447
  }
448
+ } else if (__DEV__) {
449
+ log(
450
+ `当前是开发环境,无法执行增量式热更新,重启不会生效。
451
+ 如果需要在开发环境中测试可生效的全量热更新(但也会在再次重启后重新连接 metro),
452
+ 请打开“忽略时间戳”开关再重试。`,
453
+ );
454
+ succeeded = 'full';
461
455
  }
462
456
  }
463
457
  if (sharedState.progressHandlers[hash]) {
package/android/.project DELETED
@@ -1,28 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <projectDescription>
3
- <name>react-native-update</name>
4
- <comment>Project react-native-update created by Buildship.</comment>
5
- <projects>
6
- </projects>
7
- <buildSpec>
8
- <buildCommand>
9
- <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10
- <arguments>
11
- </arguments>
12
- </buildCommand>
13
- </buildSpec>
14
- <natures>
15
- <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16
- </natures>
17
- <filteredResources>
18
- <filter>
19
- <id>1727963310481</id>
20
- <name></name>
21
- <type>30</type>
22
- <matcher>
23
- <id>org.eclipse.core.resources.regexFilterMatcher</id>
24
- <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25
- </matcher>
26
- </filter>
27
- </filteredResources>
28
- </projectDescription>
@@ -1,34 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <projectDescription>
3
- <name>react-native-update</name>
4
- <comment>Project react-native-update created by Buildship.</comment>
5
- <projects>
6
- </projects>
7
- <buildSpec>
8
- <buildCommand>
9
- <name>org.eclipse.jdt.core.javabuilder</name>
10
- <arguments>
11
- </arguments>
12
- </buildCommand>
13
- <buildCommand>
14
- <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15
- <arguments>
16
- </arguments>
17
- </buildCommand>
18
- </buildSpec>
19
- <natures>
20
- <nature>org.eclipse.jdt.core.javanature</nature>
21
- <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22
- </natures>
23
- <filteredResources>
24
- <filter>
25
- <id>1727963310481</id>
26
- <name></name>
27
- <type>30</type>
28
- <matcher>
29
- <id>org.eclipse.core.resources.regexFilterMatcher</id>
30
- <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31
- </matcher>
32
- </filter>
33
- </filteredResources>
34
- </projectDescription>
@@ -1,13 +0,0 @@
1
- arguments=--init-script /var/folders/l6/0fn3x28s5s585ld3p04gsy1h0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/l6/0fn3x28s5s585ld3p04gsy1h0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
2
- auto.sync=false
3
- build.scans.enabled=false
4
- connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
5
- connection.project.dir=
6
- eclipse.preferences.version=1
7
- gradle.user.home=
8
- java.home=/Users/sunny/.sdkman/candidates/java/17.0.9-zulu/zulu-17.jdk/Contents/Home
9
- jvm.arguments=
10
- offline.mode=false
11
- override.workspace.settings=true
12
- show.console.view=true
13
- show.executions.view=true