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.
@@ -40,9 +40,6 @@ const _restoreConsole = () => {
40
40
  };
41
41
 
42
42
  const setup = () => {
43
- if (!__DEV__) {
44
- return; // No need to return 'this' in a functional approach
45
- }
46
43
  _interceptConsole();
47
44
  };
48
45
 
@@ -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 (!__DEV__ || this.isSetup) {
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 (!__DEV__ || !this.isSetup) return this;
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 (!__DEV__ || !this.isSetup) return this;
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 (!__DEV__ || !this.isSetup) return this;
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 (!__DEV__ || !this.isSetup) {
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 (!__DEV__ || !this.isSetup || !this.resourceLoggingEnabled) return this;
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' })
@@ -37,9 +37,7 @@ const getPlatformLibs = () => {
37
37
 
38
38
  // Setup function is minimal since we're just presenting UI options
39
39
  const setup = () => {
40
- if (!__DEV__) {
41
- return;
42
- }
40
+
43
41
  // No additional setup needed beyond initialization
44
42
  };
45
43
 
@@ -9,9 +9,6 @@ const setup = () => {
9
9
 
10
10
  // Function to add track event log
11
11
  export const addTrackLog = (eventData) => {
12
- if (!__DEV__) {
13
- return;
14
- }
15
12
 
16
13
  // Store log data
17
14
  const logEntry = {
@@ -20,9 +20,7 @@ export const addZustandLog = (action, prevState, nextState, actionCompleteTime,
20
20
  };
21
21
 
22
22
  const setup = () => {
23
- if (!__DEV__) {
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
  };
@@ -27,7 +27,7 @@ export function useNavigationLogger(navigationRef) {
27
27
  const routeRef = useRef(null);
28
28
 
29
29
  useEffect(() => {
30
- if (!__DEV__ || !navigationRef.current) {
30
+ if (!navigationRef.current) {
31
31
  return;
32
32
  }
33
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-debug-toolkit",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "A simple yet powerful debugging toolkit for React Native with a convenient floating UI for development",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",