dreaction-react-native 1.3.0 → 1.3.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.
@@ -1,4 +1,4 @@
1
- import type { ClientOptions, InferFeaturesFromPlugins, Reactotron, DReactionCore } from 'dreaction-client-core';
1
+ import type { ClientOptions, InferFeaturesFromPlugins, DReaction, DReactionCore } from 'dreaction-client-core';
2
2
  import type { AsyncStorageStatic } from '@react-native-async-storage/async-storage';
3
3
  import { AsyncStorageOptions } from './plugins/asyncStorage';
4
4
  import { OpenInEditorOptions } from './plugins/openInEditor';
@@ -16,15 +16,20 @@ export interface UseReactNativeOptions {
16
16
  devTools?: boolean;
17
17
  }
18
18
  type ReactNativePluginFeatures = InferFeaturesFromPlugins<DReactionCore, typeof reactNativeCorePlugins>;
19
- export interface ReactotronReactNative extends Reactotron, ReactNativePluginFeatures {
19
+ export interface DReactionReactNative extends DReaction, ReactNativePluginFeatures {
20
20
  useReactNative: (options?: UseReactNativeOptions) => this;
21
21
  asyncStorageHandler?: AsyncStorageStatic;
22
22
  setAsyncStorageHandler: (asyncStorage: AsyncStorageStatic) => this;
23
- registerDataWatcher: <T = unknown>(name: string, type: DataWatchPayload['type']) => {
23
+ registerDataWatcher: <T = unknown>(name: string, type: DataWatchPayload['type'], options?: {
24
+ /**
25
+ * Is data watcher enabled?
26
+ */
27
+ enabled?: boolean;
28
+ }) => {
24
29
  currentDebugValue: T | undefined;
25
30
  updateDebugValue: (data: unknown) => void;
26
31
  useDebugDataWatch: (target: unknown) => void;
27
32
  };
28
33
  }
29
- export declare const dreaction: ReactotronReactNative;
34
+ export declare const dreaction: DReactionReactNative;
30
35
  //# sourceMappingURL=dreaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dreaction.d.ts","sourceRoot":"","sources":["../src/dreaction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EAExB,UAAU,EACV,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,qBACf,SAAQ,UAAU,EAEhB,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,KAC3B;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,uBAAgD,CAAC"}
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,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,7 +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 DREACTION_ASYNC_CLIENT_ID = '@REACTOTRON/clientId';
20
+ const DREACTION_ASYNC_CLIENT_ID = '@DREACTION/clientId';
21
21
  let tempClientId = null;
22
22
  exports.reactNativeCorePlugins = [
23
23
  (0, asyncStorage_1.default)(),
@@ -2,7 +2,7 @@ import type { DReactionCore } from 'dreaction-client-core';
2
2
  export interface AsyncStorageOptions {
3
3
  ignore?: string[];
4
4
  }
5
- declare const asyncStorage: (options?: AsyncStorageOptions) => (reactotron: DReactionCore) => {
5
+ declare const asyncStorage: (options?: AsyncStorageOptions) => (dreaction: DReactionCore) => {
6
6
  features: {
7
7
  trackAsyncStorage: () => void;
8
8
  untrackAsyncStorage: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"asyncStorage.d.ts","sourceRoot":"","sources":["../../src/plugins/asyncStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,uBAAuB,CAAC;AAGnE,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD,QAAA,MAAM,YAAY,aACL,mBAAmB,kBAAkB,aAAa;;;;;CA+M5D,CAAC;AAEJ,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"asyncStorage.d.ts","sourceRoot":"","sources":["../../src/plugins/asyncStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,uBAAuB,CAAC;AAGnE,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD,QAAA,MAAM,YAAY,aACL,mBAAmB,iBAAiB,aAAa;;;;;CA+M3D,CAAC;AAEJ,eAAe,YAAY,CAAC"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const PLUGIN_DEFAULTS = {
4
4
  ignore: [],
5
5
  };
6
- const asyncStorage = (options) => (reactotron) => {
6
+ const asyncStorage = (options) => (dreaction) => {
7
7
  // setup configuration
8
8
  const config = Object.assign({}, PLUGIN_DEFAULTS, options || {});
9
9
  const ignore = config.ignore || PLUGIN_DEFAULTS.ignore;
@@ -15,13 +15,13 @@ const asyncStorage = (options) => (reactotron) => {
15
15
  let swizzMultiRemove;
16
16
  let swizzMultiMerge;
17
17
  let isSwizzled = false;
18
- const sendToReactotron = (action, data) => {
19
- reactotron.send('asyncStorage.mutation', { action, data });
18
+ const sendToDReaction = (action, data) => {
19
+ dreaction.send('asyncStorage.mutation', { action, data });
20
20
  };
21
21
  const setItem = async (key, value, callback) => {
22
22
  try {
23
23
  if (ignore.indexOf(key) < 0) {
24
- sendToReactotron('setItem', { key, value });
24
+ sendToDReaction('setItem', { key, value });
25
25
  }
26
26
  }
27
27
  catch (e) { }
@@ -30,7 +30,7 @@ const asyncStorage = (options) => (reactotron) => {
30
30
  const removeItem = async (key, callback) => {
31
31
  try {
32
32
  if (ignore.indexOf(key) < 0) {
33
- sendToReactotron('removeItem', { key });
33
+ sendToDReaction('removeItem', { key });
34
34
  }
35
35
  }
36
36
  catch (e) { }
@@ -39,7 +39,7 @@ const asyncStorage = (options) => (reactotron) => {
39
39
  const mergeItem = async (key, value, callback) => {
40
40
  try {
41
41
  if (ignore.indexOf(key) < 0) {
42
- sendToReactotron('mergeItem', { key, value });
42
+ sendToDReaction('mergeItem', { key, value });
43
43
  }
44
44
  }
45
45
  catch (e) { }
@@ -47,7 +47,7 @@ const asyncStorage = (options) => (reactotron) => {
47
47
  };
48
48
  const clear = async (callback) => {
49
49
  try {
50
- sendToReactotron('clear');
50
+ sendToDReaction('clear');
51
51
  }
52
52
  catch (e) { }
53
53
  return swizzClear(callback);
@@ -56,7 +56,7 @@ const asyncStorage = (options) => (reactotron) => {
56
56
  try {
57
57
  const shippablePairs = (pairs || []).filter((pair) => pair && pair[0] && ignore.indexOf(pair[0]) < 0);
58
58
  if (shippablePairs.length > 0) {
59
- sendToReactotron('multiSet', { pairs: shippablePairs });
59
+ sendToDReaction('multiSet', { pairs: shippablePairs });
60
60
  }
61
61
  }
62
62
  catch (e) { }
@@ -66,7 +66,7 @@ const asyncStorage = (options) => (reactotron) => {
66
66
  try {
67
67
  const shippableKeys = (keys || []).filter((key) => ignore.indexOf(key) < 0);
68
68
  if (shippableKeys.length > 0) {
69
- sendToReactotron('multiRemove', { keys: shippableKeys });
69
+ sendToDReaction('multiRemove', { keys: shippableKeys });
70
70
  }
71
71
  }
72
72
  catch (e) { }
@@ -76,7 +76,7 @@ const asyncStorage = (options) => (reactotron) => {
76
76
  try {
77
77
  const shippablePairs = (pairs || []).filter((pair) => pair && pair[0] && ignore.indexOf(pair[0]) < 0);
78
78
  if (shippablePairs.length > 0) {
79
- sendToReactotron('multiMerge', { pairs: shippablePairs });
79
+ sendToDReaction('multiMerge', { pairs: shippablePairs });
80
80
  }
81
81
  }
82
82
  catch (e) { }
@@ -89,78 +89,78 @@ const asyncStorage = (options) => (reactotron) => {
89
89
  if (isSwizzled)
90
90
  return;
91
91
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
92
- // @ts-ignore: reactotron-apis
93
- swizzSetItem = reactotron.asyncStorageHandler.setItem;
92
+ // @ts-ignore: dreaction-apis
93
+ swizzSetItem = dreaction.asyncStorageHandler.setItem;
94
94
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
95
- // @ts-ignore: reactotron-apis
96
- reactotron.asyncStorageHandler.setItem = setItem;
95
+ // @ts-ignore: dreaction-apis
96
+ dreaction.asyncStorageHandler.setItem = setItem;
97
97
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
98
- // @ts-ignore: reactotron-apis
99
- swizzRemoveItem = reactotron.asyncStorageHandler.removeItem;
98
+ // @ts-ignore: dreaction-apis
99
+ swizzRemoveItem = dreaction.asyncStorageHandler.removeItem;
100
100
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
101
- // @ts-ignore: reactotron-apis
102
- reactotron.asyncStorageHandler.removeItem = removeItem;
101
+ // @ts-ignore: dreaction-apis
102
+ dreaction.asyncStorageHandler.removeItem = removeItem;
103
103
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
104
- // @ts-ignore: reactotron-apis
105
- swizzMergeItem = reactotron.asyncStorageHandler.mergeItem;
104
+ // @ts-ignore: dreaction-apis
105
+ swizzMergeItem = dreaction.asyncStorageHandler.mergeItem;
106
106
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
107
- // @ts-ignore: reactotron-apis
108
- reactotron.asyncStorageHandler.mergeItem = mergeItem;
107
+ // @ts-ignore: dreaction-apis
108
+ dreaction.asyncStorageHandler.mergeItem = mergeItem;
109
109
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
110
- // @ts-ignore: reactotron-apis
111
- swizzClear = reactotron.asyncStorageHandler.clear;
110
+ // @ts-ignore: dreaction-apis
111
+ swizzClear = dreaction.asyncStorageHandler.clear;
112
112
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
113
- // @ts-ignore: reactotron-apis
114
- reactotron.asyncStorageHandler.clear = clear;
113
+ // @ts-ignore: dreaction-apis
114
+ dreaction.asyncStorageHandler.clear = clear;
115
115
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
116
- // @ts-ignore: reactotron-apis
117
- swizzMultiSet = reactotron.asyncStorageHandler.multiSet;
116
+ // @ts-ignore: dreaction-apis
117
+ swizzMultiSet = dreaction.asyncStorageHandler.multiSet;
118
118
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
119
- // @ts-ignore: reactotron-apis
120
- reactotron.asyncStorageHandler.multiSet = multiSet;
119
+ // @ts-ignore: dreaction-apis
120
+ dreaction.asyncStorageHandler.multiSet = multiSet;
121
121
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
122
- // @ts-ignore: reactotron-apis
123
- swizzMultiRemove = reactotron.asyncStorageHandler.multiRemove;
122
+ // @ts-ignore: dreaction-apis
123
+ swizzMultiRemove = dreaction.asyncStorageHandler.multiRemove;
124
124
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
125
- // @ts-ignore: reactotron-apis
126
- reactotron.asyncStorageHandler.multiRemove = multiRemove;
125
+ // @ts-ignore: dreaction-apis
126
+ dreaction.asyncStorageHandler.multiRemove = multiRemove;
127
127
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
128
- // @ts-ignore: reactotron-apis
129
- swizzMultiMerge = reactotron.asyncStorageHandler.multiMerge;
128
+ // @ts-ignore: dreaction-apis
129
+ swizzMultiMerge = dreaction.asyncStorageHandler.multiMerge;
130
130
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
131
- // @ts-ignore: reactotron-apis
132
- reactotron.asyncStorageHandler.multiMerge = multiMerge;
131
+ // @ts-ignore: dreaction-apis
132
+ dreaction.asyncStorageHandler.multiMerge = multiMerge;
133
133
  isSwizzled = true;
134
134
  };
135
135
  const untrackAsyncStorage = () => {
136
136
  if (!isSwizzled)
137
137
  return;
138
138
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
139
- // @ts-ignore: reactotron-apis
140
- reactotron.asyncStorageHandler.setItem = swizzSetItem;
139
+ // @ts-ignore: dreaction-apis
140
+ dreaction.asyncStorageHandler.setItem = swizzSetItem;
141
141
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
142
- // @ts-ignore: reactotron-apis
143
- reactotron.asyncStorageHandler.removeItem = swizzRemoveItem;
142
+ // @ts-ignore: dreaction-apis
143
+ dreaction.asyncStorageHandler.removeItem = swizzRemoveItem;
144
144
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
145
- // @ts-ignore: reactotron-apis
146
- reactotron.asyncStorageHandler.mergeItem = swizzMergeItem;
145
+ // @ts-ignore: dreaction-apis
146
+ dreaction.asyncStorageHandler.mergeItem = swizzMergeItem;
147
147
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
148
- // @ts-ignore: reactotron-apis
149
- reactotron.asyncStorageHandler.clear = swizzClear;
148
+ // @ts-ignore: dreaction-apis
149
+ dreaction.asyncStorageHandler.clear = swizzClear;
150
150
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
151
- // @ts-ignore: reactotron-apis
152
- reactotron.asyncStorageHandler.multiSet = swizzMultiSet;
151
+ // @ts-ignore: dreaction-apis
152
+ dreaction.asyncStorageHandler.multiSet = swizzMultiSet;
153
153
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
154
- // @ts-ignore: reactotron-apis
155
- reactotron.asyncStorageHandler.multiRemove = swizzMultiRemove;
154
+ // @ts-ignore: dreaction-apis
155
+ dreaction.asyncStorageHandler.multiRemove = swizzMultiRemove;
156
156
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
157
- // @ts-ignore: reactotron-apis
158
- reactotron.asyncStorageHandler.multiMerge = swizzMultiMerge;
157
+ // @ts-ignore: dreaction-apis
158
+ dreaction.asyncStorageHandler.multiMerge = swizzMultiMerge;
159
159
  isSwizzled = false;
160
160
  };
161
161
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
162
- // @ts-ignore: reactotron-apis
163
- if (reactotron.asyncStorageHandler) {
162
+ // @ts-ignore: dreaction-apis
163
+ if (dreaction.asyncStorageHandler) {
164
164
  trackAsyncStorage();
165
165
  }
166
166
  return {
@@ -3,7 +3,7 @@ export interface NetworkingOptions {
3
3
  ignoreContentTypes?: RegExp;
4
4
  ignoreUrls?: RegExp;
5
5
  }
6
- declare const networking: (pluginConfig?: NetworkingOptions) => (reactotron: DReactionCore) => {
6
+ declare const networking: (pluginConfig?: NetworkingOptions) => (dreaction: DReactionCore) => {
7
7
  onConnect: () => void;
8
8
  };
9
9
  export default networking;
@@ -1 +1 @@
1
- {"version":3,"file":"networking.d.ts","sourceRoot":"","sources":["../../src/plugins/networking.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,uBAAuB,CAAC;AAOnE,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD,QAAA,MAAM,UAAU,kBACC,iBAAiB,kBACnB,aAAa;;CAwJzB,CAAC;AACJ,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"networking.d.ts","sourceRoot":"","sources":["../../src/plugins/networking.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAU,MAAM,uBAAuB,CAAC;AAOnE,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD,QAAA,MAAM,UAAU,kBACC,iBAAiB,iBACpB,aAAa;;CAwJxB,CAAC;AACJ,eAAe,UAAU,CAAC"}
@@ -12,12 +12,12 @@ const DEFAULT_CONTENT_TYPES_RX = /^(image)\/.*$/i;
12
12
  const DEFAULTS = {
13
13
  ignoreUrls: /symbolicate/,
14
14
  };
15
- const networking = (pluginConfig = {}) => (reactotron) => {
15
+ const networking = (pluginConfig = {}) => (dreaction) => {
16
16
  const options = Object.assign({}, DEFAULTS, pluginConfig);
17
17
  // a RegExp to suppress adding the body cuz it costs a lot to serialize
18
18
  const ignoreContentTypes = options.ignoreContentTypes || DEFAULT_CONTENT_TYPES_RX;
19
19
  // a XHR call tracker
20
- let reactotronCounter = 1000;
20
+ let dreactionCounter = 1000;
21
21
  // a temporary cache to hold requests so we can match up the data
22
22
  const requestCache = {};
23
23
  /**
@@ -28,18 +28,18 @@ const networking = (pluginConfig = {}) => (reactotron) => {
28
28
  */
29
29
  function onSend(data, xhr) {
30
30
  if (options.ignoreUrls && options.ignoreUrls.test(xhr._url)) {
31
- xhr._skipReactotron = true;
31
+ xhr._skipDReaction = true;
32
32
  return;
33
33
  }
34
34
  // bump the counter
35
- reactotronCounter++;
35
+ dreactionCounter++;
36
36
  // tag
37
- xhr._trackingName = reactotronCounter;
37
+ xhr._trackingName = dreactionCounter;
38
38
  // cache
39
- requestCache[reactotronCounter] = {
39
+ requestCache[dreactionCounter] = {
40
40
  data,
41
41
  xhr,
42
- stopTimer: reactotron.startTimer(),
42
+ stopTimer: dreaction.startTimer(),
43
43
  };
44
44
  }
45
45
  /**
@@ -53,7 +53,7 @@ const networking = (pluginConfig = {}) => (reactotron) => {
53
53
  * @param {*} xhr - The XMLHttpRequest instance.
54
54
  */
55
55
  function onResponse(status, timeout, response, url, type, xhr) {
56
- if (xhr._skipReactotron) {
56
+ if (xhr._skipDReaction) {
57
57
  return;
58
58
  }
59
59
  let params = null;
@@ -103,7 +103,7 @@ const networking = (pluginConfig = {}) => (reactotron) => {
103
103
  status,
104
104
  headers: xhr.responseHeaders || null,
105
105
  };
106
- reactotron.apiResponse(tronRequest, tronResponse, stopTimer ? stopTimer() : null); // TODO: Fix
106
+ dreaction.apiResponse(tronRequest, tronResponse, stopTimer ? stopTimer() : null); // TODO: Fix
107
107
  };
108
108
  // can we use the real response?
109
109
  const useRealResponse = (typeof response === 'string' || typeof response === 'object') &&
@@ -20,9 +20,9 @@ export interface TrackGlobalErrorsOptions {
20
20
  veto?: (frame: ErrorStackFrame) => boolean;
21
21
  }
22
22
  /**
23
- * Track global errors and send them to Reactotron logger.
23
+ * Track global errors and send them to DReaction logger.
24
24
  */
25
- declare const trackGlobalErrors: (options?: TrackGlobalErrorsOptions) => (reactotron: DReactionCore) => {
25
+ declare const trackGlobalErrors: (options?: TrackGlobalErrorsOptions) => (dreaction: DReactionCore) => {
26
26
  onConnect: () => void;
27
27
  features: {
28
28
  reportError: (error: Parameters<typeof LogBox.addException>[0]) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"trackGlobalErrors.d.ts","sourceRoot":"","sources":["../../src/plugins/trackGlobalErrors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAGL,aAAa,EAGd,MAAM,uBAAuB,CAAC;AAC/B,OAAgB,EACd,YAAY,IAAI,kBAAkB,EAEnC,MAAM,sCAAsC,CAAC;AAM9C,UAAU,mBAAoB,SAAQ,kBAAkB;IACtD;;OAEG;IAEH,YAAY,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACpC;AAED,QAAA,MAAM,MAAM,EAAyB,mBAAmB,CAAC;AAOzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC;CAC5C;AAiBD;;GAEG;AACH,QAAA,MAAM,iBAAiB,aACV,wBAAwB,kBAAkB,aAAa;;;6BAUpC,UAAU,CAAC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;;CA+EtE,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"trackGlobalErrors.d.ts","sourceRoot":"","sources":["../../src/plugins/trackGlobalErrors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAGL,aAAa,EAGd,MAAM,uBAAuB,CAAC;AAC/B,OAAgB,EACd,YAAY,IAAI,kBAAkB,EAEnC,MAAM,sCAAsC,CAAC;AAM9C,UAAU,mBAAoB,SAAQ,kBAAkB;IACtD;;OAEG;IAEH,YAAY,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACpC;AAED,QAAA,MAAM,MAAM,EAAyB,mBAAmB,CAAC;AAOzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC;CAC5C;AAiBD;;GAEG;AACH,QAAA,MAAM,iBAAiB,aACV,wBAAwB,iBAAiB,aAAa;;;6BAUnC,UAAU,CAAC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;;CA+EtE,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
@@ -26,12 +26,12 @@ const objectifyError = (error) => {
26
26
  };
27
27
  // const reactNativeFrameFinder = frame => contains('/node_modules/react-native/', frame.fileName)
28
28
  /**
29
- * Track global errors and send them to Reactotron logger.
29
+ * Track global errors and send them to DReaction logger.
30
30
  */
31
- const trackGlobalErrors = (options) => (reactotron) => {
31
+ const trackGlobalErrors = (options) => (dreaction) => {
32
32
  // make sure we have the logger plugin
33
- (0, dreaction_client_core_1.assertHasLoggerPlugin)(reactotron);
34
- const client = reactotron;
33
+ (0, dreaction_client_core_1.assertHasLoggerPlugin)(dreaction);
34
+ const client = dreaction;
35
35
  // setup configuration
36
36
  const config = Object.assign({}, PLUGIN_DEFAULTS, options || {});
37
37
  // manually fire an error
@@ -80,7 +80,7 @@ const trackGlobalErrors = (options) => (reactotron) => {
80
80
  client.debug(objectifyError(e));
81
81
  });
82
82
  }
83
- // the reactotron plugin interface
83
+ // the dreaction plugin interface
84
84
  return {
85
85
  onConnect: () => {
86
86
  LogBox.addException = new Proxy(LogBox.addException, {
@@ -91,7 +91,7 @@ const trackGlobalErrors = (options) => (reactotron) => {
91
91
  },
92
92
  });
93
93
  },
94
- // attach these functions to the Reactotron
94
+ // attach these functions to the DReaction
95
95
  features: {
96
96
  reportError,
97
97
  },
@@ -1,8 +1,8 @@
1
1
  import { DReactionCore } from 'dreaction-client-core';
2
2
  /**
3
- * Track calls to console.log, console.warn, and console.debug and send them to Reactotron logger
3
+ * Track calls to console.log, console.warn, and console.debug and send them to DReaction logger
4
4
  */
5
- declare const trackGlobalLogs: () => (reactotron: DReactionCore) => {
5
+ declare const trackGlobalLogs: () => (dreaction: DReactionCore) => {
6
6
  onConnect: () => void;
7
7
  };
8
8
  export default trackGlobalLogs;
@@ -1 +1 @@
1
- {"version":3,"file":"trackGlobalLogs.d.ts","sourceRoot":"","sources":["../../src/plugins/trackGlobalLogs.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EAGd,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,QAAA,MAAM,eAAe,qBAAsB,aAAa;;CA4BvD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"trackGlobalLogs.d.ts","sourceRoot":"","sources":["../../src/plugins/trackGlobalLogs.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EAGd,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,QAAA,MAAM,eAAe,oBAAqB,aAAa;;CA4BtD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const dreaction_client_core_1 = require("dreaction-client-core");
4
4
  /**
5
- * Track calls to console.log, console.warn, and console.debug and send them to Reactotron logger
5
+ * Track calls to console.log, console.warn, and console.debug and send them to DReaction logger
6
6
  */
7
- const trackGlobalLogs = () => (reactotron) => {
8
- (0, dreaction_client_core_1.assertHasLoggerPlugin)(reactotron);
9
- const client = reactotron;
7
+ const trackGlobalLogs = () => (dreaction) => {
8
+ (0, dreaction_client_core_1.assertHasLoggerPlugin)(dreaction);
9
+ const client = dreaction;
10
10
  return {
11
11
  onConnect: () => {
12
12
  const originalConsoleLog = console.log;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dreaction-react-native",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "main": "lib/index.js",
@@ -15,8 +15,8 @@
15
15
  "author": "moonrailgun <moonrailgun@gmail.com>",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "dreaction-client-core": "1.1.1",
19
- "dreaction-protocol": "1.0.0"
18
+ "dreaction-protocol": "1.0.1",
19
+ "dreaction-client-core": "1.1.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/react-native": "^0.73.0",
package/src/dreaction.ts CHANGED
@@ -4,7 +4,7 @@ import type {
4
4
  ClientOptions,
5
5
  InferFeaturesFromPlugins,
6
6
  PluginCreator,
7
- Reactotron,
7
+ DReaction,
8
8
  DReactionCore,
9
9
  } from 'dreaction-client-core';
10
10
  // @ts-ignore
@@ -26,7 +26,7 @@ import { getHost } from './helpers/getHost';
26
26
 
27
27
  export type { ClientOptions };
28
28
 
29
- const DREACTION_ASYNC_CLIENT_ID = '@REACTOTRON/clientId';
29
+ const DREACTION_ASYNC_CLIENT_ID = '@DREACTION/clientId';
30
30
 
31
31
  let tempClientId: string | null = null;
32
32
 
@@ -53,8 +53,8 @@ type ReactNativePluginFeatures = InferFeaturesFromPlugins<
53
53
  typeof reactNativeCorePlugins
54
54
  >;
55
55
 
56
- export interface ReactotronReactNative
57
- extends Reactotron,
56
+ export interface DReactionReactNative
57
+ extends DReaction,
58
58
  // @ts-ignore
59
59
  ReactNativePluginFeatures {
60
60
  useReactNative: (options?: UseReactNativeOptions) => this;
@@ -62,7 +62,13 @@ export interface ReactotronReactNative
62
62
  setAsyncStorageHandler: (asyncStorage: AsyncStorageStatic) => this;
63
63
  registerDataWatcher: <T = unknown>(
64
64
  name: string,
65
- type: DataWatchPayload['type']
65
+ type: DataWatchPayload['type'],
66
+ options?: {
67
+ /**
68
+ * Is data watcher enabled?
69
+ */
70
+ enabled?: boolean;
71
+ }
66
72
  ) => {
67
73
  currentDebugValue: T | undefined;
68
74
  updateDebugValue: (data: unknown) => void;
@@ -81,7 +87,7 @@ const {
81
87
  serial,
82
88
  } = getReactNativePlatformConstants();
83
89
 
84
- const DEFAULTS: ClientOptions<ReactotronReactNative> = {
90
+ const DEFAULTS: ClientOptions<DReactionReactNative> = {
85
91
  createSocket: (path: string) => new WebSocket(path), // eslint-disable-line
86
92
  host: getHost('localhost'),
87
93
  port: 9600,
@@ -150,7 +156,7 @@ const DEFAULTS: ClientOptions<ReactotronReactNative> = {
150
156
  proxyHack: true,
151
157
  };
152
158
 
153
- export const dreaction = createClient<ReactotronReactNative>(DEFAULTS);
159
+ export const dreaction = createClient<DReactionReactNative>(DEFAULTS);
154
160
 
155
161
  function getPluginOptions<T>(options?: T | boolean): T | null {
156
162
  return typeof options === 'object' ? options : null;
@@ -10,7 +10,7 @@ const PLUGIN_DEFAULTS: AsyncStorageOptions = {
10
10
  };
11
11
 
12
12
  const asyncStorage =
13
- (options?: AsyncStorageOptions) => (reactotron: DReactionCore) => {
13
+ (options?: AsyncStorageOptions) => (dreaction: DReactionCore) => {
14
14
  // setup configuration
15
15
  const config = Object.assign({}, PLUGIN_DEFAULTS, options || {});
16
16
  const ignore = config.ignore || PLUGIN_DEFAULTS.ignore;
@@ -24,8 +24,8 @@ const asyncStorage =
24
24
  let swizzMultiMerge: AsyncStorageStatic['multiMerge'];
25
25
  let isSwizzled = false;
26
26
 
27
- const sendToReactotron = (action: string, data?: any) => {
28
- reactotron.send('asyncStorage.mutation', { action, data });
27
+ const sendToDReaction = (action: string, data?: any) => {
28
+ dreaction.send('asyncStorage.mutation', { action, data });
29
29
  };
30
30
 
31
31
  const setItem: AsyncStorageStatic['setItem'] = async (
@@ -35,7 +35,7 @@ const asyncStorage =
35
35
  ) => {
36
36
  try {
37
37
  if (ignore!.indexOf(key) < 0) {
38
- sendToReactotron('setItem', { key, value });
38
+ sendToDReaction('setItem', { key, value });
39
39
  }
40
40
  } catch (e) {}
41
41
  return swizzSetItem(key, value, callback);
@@ -47,7 +47,7 @@ const asyncStorage =
47
47
  ) => {
48
48
  try {
49
49
  if (ignore!.indexOf(key) < 0) {
50
- sendToReactotron('removeItem', { key });
50
+ sendToDReaction('removeItem', { key });
51
51
  }
52
52
  } catch (e) {}
53
53
  return swizzRemoveItem(key, callback);
@@ -60,7 +60,7 @@ const asyncStorage =
60
60
  ) => {
61
61
  try {
62
62
  if (ignore!.indexOf(key) < 0) {
63
- sendToReactotron('mergeItem', { key, value });
63
+ sendToDReaction('mergeItem', { key, value });
64
64
  }
65
65
  } catch (e) {}
66
66
  return swizzMergeItem(key, value, callback);
@@ -68,7 +68,7 @@ const asyncStorage =
68
68
 
69
69
  const clear: AsyncStorageStatic['clear'] = async (callback: any) => {
70
70
  try {
71
- sendToReactotron('clear');
71
+ sendToDReaction('clear');
72
72
  } catch (e) {}
73
73
  return swizzClear(callback);
74
74
  };
@@ -82,7 +82,7 @@ const asyncStorage =
82
82
  (pair: any) => pair && pair[0] && ignore!.indexOf(pair[0]) < 0
83
83
  );
84
84
  if (shippablePairs.length > 0) {
85
- sendToReactotron('multiSet', { pairs: shippablePairs });
85
+ sendToDReaction('multiSet', { pairs: shippablePairs });
86
86
  }
87
87
  } catch (e) {}
88
88
  return swizzMultiSet(pairs, callback);
@@ -97,7 +97,7 @@ const asyncStorage =
97
97
  (key: any) => ignore!.indexOf(key) < 0
98
98
  );
99
99
  if (shippableKeys.length > 0) {
100
- sendToReactotron('multiRemove', { keys: shippableKeys });
100
+ sendToDReaction('multiRemove', { keys: shippableKeys });
101
101
  }
102
102
  } catch (e) {}
103
103
  return swizzMultiRemove(keys, callback);
@@ -112,7 +112,7 @@ const asyncStorage =
112
112
  (pair: any) => pair && pair[0] && ignore!.indexOf(pair[0]) < 0
113
113
  );
114
114
  if (shippablePairs.length > 0) {
115
- sendToReactotron('multiMerge', { pairs: shippablePairs });
115
+ sendToDReaction('multiMerge', { pairs: shippablePairs });
116
116
  }
117
117
  } catch (e) {}
118
118
  return swizzMultiMerge(pairs, callback);
@@ -125,54 +125,54 @@ const asyncStorage =
125
125
  if (isSwizzled) return;
126
126
 
127
127
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
128
- // @ts-ignore: reactotron-apis
129
- swizzSetItem = reactotron.asyncStorageHandler.setItem;
128
+ // @ts-ignore: dreaction-apis
129
+ swizzSetItem = dreaction.asyncStorageHandler.setItem;
130
130
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
131
- // @ts-ignore: reactotron-apis
132
- reactotron.asyncStorageHandler.setItem = setItem;
131
+ // @ts-ignore: dreaction-apis
132
+ dreaction.asyncStorageHandler.setItem = setItem;
133
133
 
134
134
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
135
- // @ts-ignore: reactotron-apis
136
- swizzRemoveItem = reactotron.asyncStorageHandler.removeItem;
135
+ // @ts-ignore: dreaction-apis
136
+ swizzRemoveItem = dreaction.asyncStorageHandler.removeItem;
137
137
 
138
138
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
139
- // @ts-ignore: reactotron-apis
140
- reactotron.asyncStorageHandler.removeItem = removeItem;
139
+ // @ts-ignore: dreaction-apis
140
+ dreaction.asyncStorageHandler.removeItem = removeItem;
141
141
 
142
142
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
143
- // @ts-ignore: reactotron-apis
144
- swizzMergeItem = reactotron.asyncStorageHandler.mergeItem;
143
+ // @ts-ignore: dreaction-apis
144
+ swizzMergeItem = dreaction.asyncStorageHandler.mergeItem;
145
145
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
146
- // @ts-ignore: reactotron-apis
147
- reactotron.asyncStorageHandler.mergeItem = mergeItem;
146
+ // @ts-ignore: dreaction-apis
147
+ dreaction.asyncStorageHandler.mergeItem = mergeItem;
148
148
 
149
149
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
150
- // @ts-ignore: reactotron-apis
151
- swizzClear = reactotron.asyncStorageHandler.clear;
150
+ // @ts-ignore: dreaction-apis
151
+ swizzClear = dreaction.asyncStorageHandler.clear;
152
152
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
153
- // @ts-ignore: reactotron-apis
154
- reactotron.asyncStorageHandler.clear = clear;
153
+ // @ts-ignore: dreaction-apis
154
+ dreaction.asyncStorageHandler.clear = clear;
155
155
 
156
156
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
157
- // @ts-ignore: reactotron-apis
158
- swizzMultiSet = reactotron.asyncStorageHandler.multiSet;
157
+ // @ts-ignore: dreaction-apis
158
+ swizzMultiSet = dreaction.asyncStorageHandler.multiSet;
159
159
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
160
- // @ts-ignore: reactotron-apis
161
- reactotron.asyncStorageHandler.multiSet = multiSet;
160
+ // @ts-ignore: dreaction-apis
161
+ dreaction.asyncStorageHandler.multiSet = multiSet;
162
162
 
163
163
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
164
- // @ts-ignore: reactotron-apis
165
- swizzMultiRemove = reactotron.asyncStorageHandler.multiRemove;
164
+ // @ts-ignore: dreaction-apis
165
+ swizzMultiRemove = dreaction.asyncStorageHandler.multiRemove;
166
166
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
167
- // @ts-ignore: reactotron-apis
168
- reactotron.asyncStorageHandler.multiRemove = multiRemove;
167
+ // @ts-ignore: dreaction-apis
168
+ dreaction.asyncStorageHandler.multiRemove = multiRemove;
169
169
 
170
170
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
171
- // @ts-ignore: reactotron-apis
172
- swizzMultiMerge = reactotron.asyncStorageHandler.multiMerge;
171
+ // @ts-ignore: dreaction-apis
172
+ swizzMultiMerge = dreaction.asyncStorageHandler.multiMerge;
173
173
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
174
- // @ts-ignore: reactotron-apis
175
- reactotron.asyncStorageHandler.multiMerge = multiMerge;
174
+ // @ts-ignore: dreaction-apis
175
+ dreaction.asyncStorageHandler.multiMerge = multiMerge;
176
176
 
177
177
  isSwizzled = true;
178
178
  };
@@ -181,33 +181,33 @@ const asyncStorage =
181
181
  if (!isSwizzled) return;
182
182
 
183
183
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
184
- // @ts-ignore: reactotron-apis
185
- reactotron.asyncStorageHandler.setItem = swizzSetItem;
184
+ // @ts-ignore: dreaction-apis
185
+ dreaction.asyncStorageHandler.setItem = swizzSetItem;
186
186
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
187
- // @ts-ignore: reactotron-apis
188
- reactotron.asyncStorageHandler.removeItem = swizzRemoveItem;
187
+ // @ts-ignore: dreaction-apis
188
+ dreaction.asyncStorageHandler.removeItem = swizzRemoveItem;
189
189
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
190
- // @ts-ignore: reactotron-apis
191
- reactotron.asyncStorageHandler.mergeItem = swizzMergeItem;
190
+ // @ts-ignore: dreaction-apis
191
+ dreaction.asyncStorageHandler.mergeItem = swizzMergeItem;
192
192
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
193
- // @ts-ignore: reactotron-apis
194
- reactotron.asyncStorageHandler.clear = swizzClear;
193
+ // @ts-ignore: dreaction-apis
194
+ dreaction.asyncStorageHandler.clear = swizzClear;
195
195
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
196
- // @ts-ignore: reactotron-apis
197
- reactotron.asyncStorageHandler.multiSet = swizzMultiSet;
196
+ // @ts-ignore: dreaction-apis
197
+ dreaction.asyncStorageHandler.multiSet = swizzMultiSet;
198
198
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
199
- // @ts-ignore: reactotron-apis
200
- reactotron.asyncStorageHandler.multiRemove = swizzMultiRemove;
199
+ // @ts-ignore: dreaction-apis
200
+ dreaction.asyncStorageHandler.multiRemove = swizzMultiRemove;
201
201
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
202
- // @ts-ignore: reactotron-apis
203
- reactotron.asyncStorageHandler.multiMerge = swizzMultiMerge;
202
+ // @ts-ignore: dreaction-apis
203
+ dreaction.asyncStorageHandler.multiMerge = swizzMultiMerge;
204
204
 
205
205
  isSwizzled = false;
206
206
  };
207
207
 
208
208
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
209
- // @ts-ignore: reactotron-apis
210
- if (reactotron.asyncStorageHandler) {
209
+ // @ts-ignore: dreaction-apis
210
+ if (dreaction.asyncStorageHandler) {
211
211
  trackAsyncStorage();
212
212
  }
213
213
 
@@ -18,7 +18,7 @@ const DEFAULTS: NetworkingOptions = {
18
18
 
19
19
  const networking =
20
20
  (pluginConfig: NetworkingOptions = {}) =>
21
- (reactotron: DReactionCore) => {
21
+ (dreaction: DReactionCore) => {
22
22
  const options = Object.assign({}, DEFAULTS, pluginConfig);
23
23
 
24
24
  // a RegExp to suppress adding the body cuz it costs a lot to serialize
@@ -26,7 +26,7 @@ const networking =
26
26
  options.ignoreContentTypes || DEFAULT_CONTENT_TYPES_RX;
27
27
 
28
28
  // a XHR call tracker
29
- let reactotronCounter = 1000;
29
+ let dreactionCounter = 1000;
30
30
 
31
31
  // a temporary cache to hold requests so we can match up the data
32
32
  const requestCache = {};
@@ -39,21 +39,21 @@ const networking =
39
39
  */
40
40
  function onSend(data: any, xhr: any) {
41
41
  if (options.ignoreUrls && options.ignoreUrls.test(xhr._url)) {
42
- xhr._skipReactotron = true;
42
+ xhr._skipDReaction = true;
43
43
  return;
44
44
  }
45
45
 
46
46
  // bump the counter
47
- reactotronCounter++;
47
+ dreactionCounter++;
48
48
 
49
49
  // tag
50
- xhr._trackingName = reactotronCounter;
50
+ xhr._trackingName = dreactionCounter;
51
51
 
52
52
  // cache
53
- (requestCache as any)[reactotronCounter] = {
53
+ (requestCache as any)[dreactionCounter] = {
54
54
  data,
55
55
  xhr,
56
- stopTimer: reactotron.startTimer(),
56
+ stopTimer: dreaction.startTimer(),
57
57
  };
58
58
  }
59
59
 
@@ -75,7 +75,7 @@ const networking =
75
75
  type: any,
76
76
  xhr: any
77
77
  ) {
78
- if (xhr._skipReactotron) {
78
+ if (xhr._skipDReaction) {
79
79
  return;
80
80
  }
81
81
 
@@ -130,7 +130,7 @@ const networking =
130
130
  status,
131
131
  headers: xhr.responseHeaders || null,
132
132
  };
133
- (reactotron as any).apiResponse(
133
+ (dreaction as any).apiResponse(
134
134
  tronRequest,
135
135
  tronResponse,
136
136
  stopTimer ? stopTimer() : null
@@ -59,13 +59,13 @@ const objectifyError = (error: Error) => {
59
59
  // const reactNativeFrameFinder = frame => contains('/node_modules/react-native/', frame.fileName)
60
60
 
61
61
  /**
62
- * Track global errors and send them to Reactotron logger.
62
+ * Track global errors and send them to DReaction logger.
63
63
  */
64
64
  const trackGlobalErrors =
65
- (options?: TrackGlobalErrorsOptions) => (reactotron: DReactionCore) => {
65
+ (options?: TrackGlobalErrorsOptions) => (dreaction: DReactionCore) => {
66
66
  // make sure we have the logger plugin
67
- assertHasLoggerPlugin(reactotron);
68
- const client = reactotron as DReactionCore &
67
+ assertHasLoggerPlugin(dreaction);
68
+ const client = dreaction as DReactionCore &
69
69
  InferFeatures<DReactionCore, LoggerPlugin>;
70
70
 
71
71
  // setup configuration
@@ -130,7 +130,7 @@ const trackGlobalErrors =
130
130
  });
131
131
  }
132
132
 
133
- // the reactotron plugin interface
133
+ // the dreaction plugin interface
134
134
  return {
135
135
  onConnect: () => {
136
136
  LogBox.addException = new Proxy(LogBox.addException, {
@@ -146,7 +146,7 @@ const trackGlobalErrors =
146
146
  });
147
147
  },
148
148
 
149
- // attach these functions to the Reactotron
149
+ // attach these functions to the DReaction
150
150
  features: {
151
151
  reportError,
152
152
  },
@@ -7,11 +7,11 @@ import {
7
7
  } from 'dreaction-client-core';
8
8
 
9
9
  /**
10
- * Track calls to console.log, console.warn, and console.debug and send them to Reactotron logger
10
+ * Track calls to console.log, console.warn, and console.debug and send them to DReaction logger
11
11
  */
12
- const trackGlobalLogs = () => (reactotron: DReactionCore) => {
13
- assertHasLoggerPlugin(reactotron);
14
- const client = reactotron as DReactionCore &
12
+ const trackGlobalLogs = () => (dreaction: DReactionCore) => {
13
+ assertHasLoggerPlugin(dreaction);
14
+ const client = dreaction as DReactionCore &
15
15
  InferFeatures<DReactionCore, LoggerPlugin>;
16
16
 
17
17
  return {