dreaction-react-native 1.3.3 → 1.3.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"dreaction.d.ts","sourceRoot":"","sources":["../src/dreaction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EAExB,SAAS,EACT,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAGpF,OAAqB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAqB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAA0B,EACxB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,YAAY,EAAE,aAAa,EAAE,CAAC;AAM9B,eAAO,MAAM,sBAAsB,OAOO,CAAC;AAE3C,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC;IACvC,YAAY,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC;IAC7C,UAAU,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,yBAAyB,GAAG,wBAAwB,CACvD,aAAa,EACb,OAAO,sBAAsB,CAC9B,CAAC;AAEF,MAAM,WAAW,oBACf,SAAQ,SAAS,EAEf,yBAAyB;IAC3B,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC1D,mBAAmB,CAAC,EAA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AG,OAAO,CAAC;IACvC,YAAY,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC;IAC7C,UAAU,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,yBAAyB,GAAG,wBAAwB,CACvD,aAAa,EACb,OAAO,sBAAsB,CAC9B,CAAC;AAEF,MAAM,WAAW,oBACf,SAAQ,SAAS,EAEf,yBAAyB;IAC3B,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC1D,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;IACzC,sBAAsB,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACnE,mBAAmB,EAAE,CAAC,CAAC,GAAG,OAAO,EAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC9B,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,KACE;QACH,iBAAiB,EAAE,CAAC,GAAG,SAAS,CAAC;QACjC,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;QAC1C,iBAAiB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;KAC9C,CAAC;CACH;AAkFD,eAAO,MAAM,SAAS,sBAA+C,CAAC"}
package/lib/dreaction.js CHANGED
@@ -17,6 +17,7 @@ const trackGlobalLogs_1 = __importDefault(require("./plugins/trackGlobalLogs"));
17
17
  const getReactNativePlatformConstants_1 = __importDefault(require("./helpers/getReactNativePlatformConstants"));
18
18
  const react_1 = require("react");
19
19
  const getHost_1 = require("./helpers/getHost");
20
+ const common_1 = require("./helpers/common");
20
21
  const DREACTION_ASYNC_CLIENT_ID = '@DREACTION/clientId';
21
22
  let tempClientId = null;
22
23
  exports.reactNativeCorePlugins = [
@@ -33,7 +34,7 @@ const DEFAULTS = {
33
34
  host: (0, getHost_1.getHost)('localhost'),
34
35
  port: 9600,
35
36
  name: 'React Native App',
36
- environment: process.env.NODE_ENV || (__DEV__ ? 'development' : 'production'),
37
+ environment: process.env.NODE_ENV || ((0, common_1.isDev)() ? 'development' : 'production'),
37
38
  client: {
38
39
  dreactionLibraryName: 'dreaction-react-native',
39
40
  dreactionLibraryVersion: 'DREACTION_REACT_NATIVE_VERSION',
@@ -0,0 +1,2 @@
1
+ export declare function isDev(): boolean;
2
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/helpers/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,IAAI,OAAO,CAE/B"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDev = isDev;
4
+ function isDev() {
5
+ return !!__DEV__;
6
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"devTools.d.ts","sourceRoot":"","sources":["../../src/plugins/devTools.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,QAAQ,EAAE,GAmBf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"devTools.d.ts","sourceRoot":"","sources":["../../src/plugins/devTools.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,QAAQ,EAAE,GAmBf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const react_native_1 = require("react-native");
4
+ const common_1 = require("../helpers/common");
4
5
  let DevMenu = { show: () => { }, reload: () => { } };
5
- if (react_native_1.Platform.OS === 'ios') {
6
+ if (react_native_1.Platform.OS === 'ios' && (0, common_1.isDev)()) {
7
+ // this will be crash in ios release mode
8
+ // so add is dev check
6
9
  DevMenu = require('react-native/Libraries/NativeModules/specs/NativeDevMenu');
7
10
  }
8
11
  const devTools = () => () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dreaction-react-native",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "main": "lib/index.js",
@@ -15,7 +15,7 @@
15
15
  "author": "moonrailgun <moonrailgun@gmail.com>",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "dreaction-client-core": "1.1.3",
18
+ "dreaction-client-core": "1.1.4",
19
19
  "dreaction-protocol": "1.0.1"
20
20
  },
21
21
  "devDependencies": {
package/src/dreaction.ts CHANGED
@@ -23,6 +23,7 @@ import getReactNativePlatformConstants from './helpers/getReactNativePlatformCon
23
23
  import { DataWatchPayload } from 'dreaction-protocol';
24
24
  import { useEffect } from 'react';
25
25
  import { getHost } from './helpers/getHost';
26
+ import { isDev } from './helpers/common';
26
27
 
27
28
  export type { ClientOptions };
28
29
 
@@ -92,7 +93,7 @@ const DEFAULTS: ClientOptions<DReactionReactNative> = {
92
93
  host: getHost('localhost'),
93
94
  port: 9600,
94
95
  name: 'React Native App',
95
- environment: process.env.NODE_ENV || (__DEV__ ? 'development' : 'production'),
96
+ environment: process.env.NODE_ENV || (isDev() ? 'development' : 'production'),
96
97
  client: {
97
98
  dreactionLibraryName: 'dreaction-react-native',
98
99
  dreactionLibraryVersion: 'DREACTION_REACT_NATIVE_VERSION',
@@ -0,0 +1,3 @@
1
+ export function isDev(): boolean {
2
+ return !!__DEV__;
3
+ }
@@ -1,8 +1,11 @@
1
1
  import { Platform } from 'react-native';
2
2
  import type { DReactionCore, Plugin } from 'dreaction-client-core';
3
+ import { isDev } from '../helpers/common';
3
4
 
4
5
  let DevMenu = { show: () => {}, reload: () => {} };
5
- if (Platform.OS === 'ios') {
6
+ if (Platform.OS === 'ios' && isDev()) {
7
+ // this will be crash in ios release mode
8
+ // so add is dev check
6
9
  DevMenu = require('react-native/Libraries/NativeModules/specs/NativeDevMenu');
7
10
  }
8
11