react-native-update 10.4.0 → 10.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.4.0",
3
+ "version": "10.4.2",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
package/src/client.tsx CHANGED
@@ -35,6 +35,7 @@ export class Pushy {
35
35
  useAlert: true,
36
36
  strategy: 'both',
37
37
  logger: noop,
38
+ debug: false,
38
39
  };
39
40
 
40
41
  lastChecking?: number;
@@ -146,6 +147,12 @@ export class Pushy {
146
147
  }
147
148
  };
148
149
  checkUpdate = async () => {
150
+ if (__DEV__ && !this.options.debug) {
151
+ console.info(
152
+ '您当前处于开发环境且未启用debug,不会进行热更检查。如需在开发环境中调试热更,请在client中设置debug为true',
153
+ );
154
+ return;
155
+ }
149
156
  const now = Date.now();
150
157
  if (
151
158
  this.lastRespJson &&
package/src/provider.tsx CHANGED
@@ -159,8 +159,10 @@ export const PushyProvider = ({
159
159
  const markSuccess = client.markSuccess;
160
160
 
161
161
  useEffect(() => {
162
- if (__DEV__) {
163
- console.info('检测到在DEV环境,不会进行热更新检查');
162
+ if (__DEV__ && !options.debug) {
163
+ console.info(
164
+ '您当前处于开发环境且未启用debug,不会进行热更检查。如需在开发环境中调试热更,请在client中设置debug为true',
165
+ );
164
166
  return;
165
167
  }
166
168
  const { strategy, dismissErrorAfter, autoMarkSuccess } = options;
package/src/type.ts CHANGED
@@ -73,4 +73,5 @@ export interface PushyOptions {
73
73
  strategy?: 'onAppStart' | 'onAppResume' | 'both' | null;
74
74
  autoMarkSuccess?: boolean;
75
75
  dismissErrorAfter?: number;
76
+ debug?: boolean;
76
77
  }