react-native-debug-toolkit 0.6.0 → 0.6.1
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/lib/features/ConsoleLogFeature.js +0 -3
- package/lib/features/NavigationLogFeature.js +0 -3
- package/lib/features/NetworkFeature.js +0 -9
- package/lib/features/PerformanceFeature.js +6 -6
- package/lib/features/ThirdPartyLibsFeature.js +1 -3
- package/lib/features/TrackFeature.js +0 -3
- package/lib/features/ZustandLogFeature.js +1 -3
- package/lib/hooks/useNavigationLogger.js +1 -1
- package/package.json +1 -1
|
@@ -3,9 +3,6 @@ const logs = [];
|
|
|
3
3
|
const originalNavigationMethods = {}; // Store original navigation methods
|
|
4
4
|
|
|
5
5
|
const setup = () => {
|
|
6
|
-
if (!__DEV__) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
6
|
// Note: Actual navigation interception will be done in the main app code
|
|
10
7
|
// This is just a setup function for compatibility with the feature API
|
|
11
8
|
};
|
|
@@ -18,9 +18,6 @@ class NetworkFeature {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
setup() {
|
|
21
|
-
if (!__DEV__) {
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
21
|
|
|
25
22
|
// this._interceptFetch()
|
|
26
23
|
return this
|
|
@@ -74,9 +71,6 @@ class NetworkFeature {
|
|
|
74
71
|
}
|
|
75
72
|
|
|
76
73
|
setupAxiosInterceptors(axiosInstance) {
|
|
77
|
-
if (!__DEV__) {
|
|
78
|
-
return
|
|
79
|
-
}
|
|
80
74
|
|
|
81
75
|
axiosInstance.interceptors.request.use(
|
|
82
76
|
(config) => {
|
|
@@ -233,9 +227,6 @@ class NetworkFeature {
|
|
|
233
227
|
}
|
|
234
228
|
|
|
235
229
|
_interceptFetch() {
|
|
236
|
-
if (!__DEV__) {
|
|
237
|
-
return
|
|
238
|
-
}
|
|
239
230
|
|
|
240
231
|
this.originalFetch = global.fetch
|
|
241
232
|
|
|
@@ -40,7 +40,7 @@ class PerformanceFeature {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
setup(options = {}) {
|
|
43
|
-
if (
|
|
43
|
+
if (this.isSetup) {
|
|
44
44
|
return this;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -207,7 +207,7 @@ class PerformanceFeature {
|
|
|
207
207
|
|
|
208
208
|
// Mark events (following pattern from vanilla example)
|
|
209
209
|
mark(name, detail = {}) {
|
|
210
|
-
if (!
|
|
210
|
+
if (!this.isSetup) return this;
|
|
211
211
|
|
|
212
212
|
if (typeof detail !== 'object') {
|
|
213
213
|
detail = { value: detail };
|
|
@@ -218,7 +218,7 @@ class PerformanceFeature {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
measure(name, startMarkOrOptions, endMark, detail = {}) {
|
|
221
|
-
if (!
|
|
221
|
+
if (!this.isSetup) return this;
|
|
222
222
|
|
|
223
223
|
try {
|
|
224
224
|
if (typeof startMarkOrOptions === 'string' && endMark) {
|
|
@@ -236,7 +236,7 @@ class PerformanceFeature {
|
|
|
236
236
|
|
|
237
237
|
// Record custom metrics (following pattern from vanilla example)
|
|
238
238
|
metric(name, value, detail = {}) {
|
|
239
|
-
if (!
|
|
239
|
+
if (!this.isSetup) return this;
|
|
240
240
|
|
|
241
241
|
if (typeof detail !== 'object') {
|
|
242
242
|
detail = { info: detail };
|
|
@@ -248,7 +248,7 @@ class PerformanceFeature {
|
|
|
248
248
|
|
|
249
249
|
// Measure execution time of a function
|
|
250
250
|
measureFunction(name, fn, ...args) {
|
|
251
|
-
if (!
|
|
251
|
+
if (!this.isSetup) {
|
|
252
252
|
return fn(...args);
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -310,7 +310,7 @@ class PerformanceFeature {
|
|
|
310
310
|
|
|
311
311
|
// Trigger a test network request (for demo purposes)
|
|
312
312
|
generateTestNetworkRequest() {
|
|
313
|
-
if (!
|
|
313
|
+
if (!this.isSetup || !this.resourceLoggingEnabled) return this;
|
|
314
314
|
|
|
315
315
|
// Similar to the fetch in the vanilla example
|
|
316
316
|
fetch('https://jsonplaceholder.typicode.com/todos/1', { cache: 'no-cache' })
|
|
@@ -20,9 +20,7 @@ export const addZustandLog = (action, prevState, nextState, actionCompleteTime,
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const setup = () => {
|
|
23
|
-
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
23
|
+
|
|
26
24
|
// Note: The actual middleware setup happens in the store creation
|
|
27
25
|
// This function is mainly for compatibility with the feature API
|
|
28
26
|
};
|
package/package.json
CHANGED