react-native-inapp-inspector 2.2.0 → 2.2.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/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +28 -6
- package/dist/commonjs/analytics.d.ts +7 -0
- package/dist/commonjs/analytics.js +28 -0
- package/dist/commonjs/bundle.d.ts +6 -0
- package/dist/commonjs/bundle.js +20 -0
- package/dist/commonjs/console.d.ts +7 -0
- package/dist/commonjs/console.js +20 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/crash.d.ts +7 -0
- package/dist/commonjs/crash.js +27 -0
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +3 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +23 -2
- package/dist/commonjs/customHooks/consoleLogger.d.ts +3 -0
- package/dist/commonjs/customHooks/consoleLogger.js +24 -4
- package/dist/commonjs/customHooks/crashHandler.d.ts +2 -0
- package/dist/commonjs/customHooks/crashHandler.js +15 -1
- package/dist/commonjs/customHooks/networkLogger.d.ts +3 -0
- package/dist/commonjs/customHooks/networkLogger.js +23 -2
- package/dist/commonjs/customHooks/performanceTracker.d.ts +3 -0
- package/dist/commonjs/customHooks/performanceTracker.js +34 -3
- package/dist/commonjs/customHooks/reduxLogger.d.ts +3 -0
- package/dist/commonjs/customHooks/reduxLogger.js +24 -4
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +1 -0
- package/dist/commonjs/helpers/memoryManager.d.ts +29 -0
- package/dist/commonjs/helpers/memoryManager.js +112 -0
- package/dist/commonjs/index.d.ts +7 -1
- package/dist/commonjs/index.js +36 -2
- package/dist/commonjs/network.d.ts +6 -0
- package/dist/commonjs/network.js +17 -0
- package/dist/commonjs/performance.d.ts +6 -0
- package/dist/commonjs/performance.js +33 -0
- package/dist/commonjs/redux.d.ts +5 -0
- package/dist/commonjs/redux.js +24 -0
- package/dist/esm/analytics.d.ts +7 -0
- package/dist/esm/analytics.js +6 -0
- package/dist/esm/bundle.d.ts +6 -0
- package/dist/esm/bundle.js +6 -0
- package/dist/esm/console.d.ts +7 -0
- package/dist/esm/console.js +6 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/crash.d.ts +7 -0
- package/dist/esm/crash.js +6 -0
- package/dist/esm/customHooks/analyticsLogger.d.ts +3 -0
- package/dist/esm/customHooks/analyticsLogger.js +19 -1
- package/dist/esm/customHooks/consoleLogger.d.ts +3 -0
- package/dist/esm/customHooks/consoleLogger.js +20 -3
- package/dist/esm/customHooks/crashHandler.d.ts +2 -0
- package/dist/esm/customHooks/crashHandler.js +12 -0
- package/dist/esm/customHooks/networkLogger.d.ts +3 -0
- package/dist/esm/customHooks/networkLogger.js +19 -1
- package/dist/esm/customHooks/performanceTracker.d.ts +3 -0
- package/dist/esm/customHooks/performanceTracker.js +30 -2
- package/dist/esm/customHooks/reduxLogger.d.ts +3 -0
- package/dist/esm/customHooks/reduxLogger.js +20 -3
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/memoryManager.d.ts +29 -0
- package/dist/esm/helpers/memoryManager.js +104 -0
- package/dist/esm/index.d.ts +7 -1
- package/dist/esm/index.js +17 -3
- package/dist/esm/network.d.ts +6 -0
- package/dist/esm/network.js +5 -0
- package/dist/esm/performance.d.ts +6 -0
- package/dist/esm/performance.js +6 -0
- package/dist/esm/redux.d.ts +5 -0
- package/dist/esm/redux.js +5 -0
- package/package.json +53 -2
|
@@ -217,7 +217,7 @@ class NetworkInspectorModule(private val reactContext: ReactApplicationContext)
|
|
|
217
217
|
|
|
218
218
|
@ReactMethod
|
|
219
219
|
fun showFloatingButton(options: com.facebook.react.bridge.ReadableMap?, promise: Promise) {
|
|
220
|
-
val activity = currentActivity ?: run {
|
|
220
|
+
val activity = reactContext.currentActivity ?: run {
|
|
221
221
|
promise.resolve(false)
|
|
222
222
|
return
|
|
223
223
|
}
|
|
@@ -275,7 +275,7 @@ class NetworkInspectorModule(private val reactContext: ReactApplicationContext)
|
|
|
275
275
|
|
|
276
276
|
@ReactMethod
|
|
277
277
|
fun hideFloatingButton(promise: Promise) {
|
|
278
|
-
val activity = currentActivity ?: run {
|
|
278
|
+
val activity = reactContext.currentActivity ?: run {
|
|
279
279
|
promise.resolve(false)
|
|
280
280
|
return
|
|
281
281
|
}
|
|
@@ -294,7 +294,7 @@ class NetworkInspectorModule(private val reactContext: ReactApplicationContext)
|
|
|
294
294
|
|
|
295
295
|
@ReactMethod
|
|
296
296
|
fun setFloatingButtonBadge(hasBadge: Boolean, promise: Promise) {
|
|
297
|
-
val activity = currentActivity ?: run {
|
|
297
|
+
val activity = reactContext.currentActivity ?: run {
|
|
298
298
|
promise.resolve(false)
|
|
299
299
|
return
|
|
300
300
|
}
|
|
@@ -307,7 +307,7 @@ class NetworkInspectorModule(private val reactContext: ReactApplicationContext)
|
|
|
307
307
|
|
|
308
308
|
@ReactMethod
|
|
309
309
|
fun setFloatingButtonPosition(x: Double, y: Double, promise: Promise) {
|
|
310
|
-
val activity = currentActivity ?: run {
|
|
310
|
+
val activity = reactContext.currentActivity ?: run {
|
|
311
311
|
promise.resolve(false)
|
|
312
312
|
return
|
|
313
313
|
}
|
|
@@ -387,7 +387,7 @@ class NetworkInspectorModule(private val reactContext: ReactApplicationContext)
|
|
|
387
387
|
|
|
388
388
|
@ReactMethod
|
|
389
389
|
fun startFpsMonitoring(promise: Promise) {
|
|
390
|
-
val activity = currentActivity ?: run {
|
|
390
|
+
val activity = reactContext.currentActivity ?: run {
|
|
391
391
|
promise.resolve(false)
|
|
392
392
|
return
|
|
393
393
|
}
|
|
@@ -406,7 +406,7 @@ class NetworkInspectorModule(private val reactContext: ReactApplicationContext)
|
|
|
406
406
|
|
|
407
407
|
@ReactMethod
|
|
408
408
|
fun stopFpsMonitoring(promise: Promise) {
|
|
409
|
-
val activity = currentActivity ?: run {
|
|
409
|
+
val activity = reactContext.currentActivity ?: run {
|
|
410
410
|
promise.resolve(false)
|
|
411
411
|
return
|
|
412
412
|
}
|
|
@@ -650,6 +650,28 @@ class NetworkInspectorModule(private val reactContext: ReactApplicationContext)
|
|
|
650
650
|
fun removeListeners(count: Double) {
|
|
651
651
|
// Required for React Native NativeEventEmitter
|
|
652
652
|
}
|
|
653
|
+
|
|
654
|
+
override fun invalidate() {
|
|
655
|
+
super.invalidate()
|
|
656
|
+
try {
|
|
657
|
+
sensorManager?.unregisterListener(shakeListener)
|
|
658
|
+
if (isFpsMonitoring) {
|
|
659
|
+
isFpsMonitoring = false
|
|
660
|
+
android.view.Choreographer.getInstance().removeFrameCallback(frameCallback)
|
|
661
|
+
}
|
|
662
|
+
floatingButton?.let { btn ->
|
|
663
|
+
val parent = btn.parent as? android.view.ViewGroup
|
|
664
|
+
parent?.post {
|
|
665
|
+
try {
|
|
666
|
+
parent.removeView(btn)
|
|
667
|
+
} catch (e: Exception) {}
|
|
668
|
+
}
|
|
669
|
+
floatingButton = null
|
|
670
|
+
}
|
|
671
|
+
} catch (e: Exception) {
|
|
672
|
+
// Ignore cleanup errors
|
|
673
|
+
}
|
|
674
|
+
}
|
|
653
675
|
}
|
|
654
676
|
|
|
655
677
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-module entry point: react-native-inapp-inspector/analytics
|
|
3
|
+
* Clean tree-shaking & isolated Firebase/custom Analytics logger.
|
|
4
|
+
*/
|
|
5
|
+
export { setupAnalyticsLogger, autoSetupAnalyticsLogger, logAnalyticsEvent, subscribeAnalyticsEvents, clearAnalyticsEvents, getAnalyticsEvents, isAnalyticsConnected, isFirebaseAnalyticsPatched, setAnalyticsModuleEnabled, getAnalyticsModuleEnabled, getCurrentUserProperties, getCurrentUserId, getDefaultEventParameters, getCollectionEnabled, setMaxAnalyticsLogsLimit, getMaxAnalyticsLogsLimit, pruneAnalyticsLogs, } from './customHooks/analyticsLogger';
|
|
6
|
+
export { getEventCategory, registerGAPlugin, type GAPlugin, } from './helpers/gaAnalyticsRegistry';
|
|
7
|
+
export type { AnalyticsEvent, AnalyticsEventSource, GAEventCategory, } from './types';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerGAPlugin = exports.getEventCategory = exports.pruneAnalyticsLogs = exports.getMaxAnalyticsLogsLimit = exports.setMaxAnalyticsLogsLimit = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.getAnalyticsModuleEnabled = exports.setAnalyticsModuleEnabled = exports.isFirebaseAnalyticsPatched = exports.isAnalyticsConnected = exports.getAnalyticsEvents = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.logAnalyticsEvent = exports.autoSetupAnalyticsLogger = exports.setupAnalyticsLogger = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sub-module entry point: react-native-inapp-inspector/analytics
|
|
6
|
+
* Clean tree-shaking & isolated Firebase/custom Analytics logger.
|
|
7
|
+
*/
|
|
8
|
+
var analyticsLogger_1 = require("./customHooks/analyticsLogger");
|
|
9
|
+
Object.defineProperty(exports, "setupAnalyticsLogger", { enumerable: true, get: function () { return analyticsLogger_1.setupAnalyticsLogger; } });
|
|
10
|
+
Object.defineProperty(exports, "autoSetupAnalyticsLogger", { enumerable: true, get: function () { return analyticsLogger_1.autoSetupAnalyticsLogger; } });
|
|
11
|
+
Object.defineProperty(exports, "logAnalyticsEvent", { enumerable: true, get: function () { return analyticsLogger_1.logAnalyticsEvent; } });
|
|
12
|
+
Object.defineProperty(exports, "subscribeAnalyticsEvents", { enumerable: true, get: function () { return analyticsLogger_1.subscribeAnalyticsEvents; } });
|
|
13
|
+
Object.defineProperty(exports, "clearAnalyticsEvents", { enumerable: true, get: function () { return analyticsLogger_1.clearAnalyticsEvents; } });
|
|
14
|
+
Object.defineProperty(exports, "getAnalyticsEvents", { enumerable: true, get: function () { return analyticsLogger_1.getAnalyticsEvents; } });
|
|
15
|
+
Object.defineProperty(exports, "isAnalyticsConnected", { enumerable: true, get: function () { return analyticsLogger_1.isAnalyticsConnected; } });
|
|
16
|
+
Object.defineProperty(exports, "isFirebaseAnalyticsPatched", { enumerable: true, get: function () { return analyticsLogger_1.isFirebaseAnalyticsPatched; } });
|
|
17
|
+
Object.defineProperty(exports, "setAnalyticsModuleEnabled", { enumerable: true, get: function () { return analyticsLogger_1.setAnalyticsModuleEnabled; } });
|
|
18
|
+
Object.defineProperty(exports, "getAnalyticsModuleEnabled", { enumerable: true, get: function () { return analyticsLogger_1.getAnalyticsModuleEnabled; } });
|
|
19
|
+
Object.defineProperty(exports, "getCurrentUserProperties", { enumerable: true, get: function () { return analyticsLogger_1.getCurrentUserProperties; } });
|
|
20
|
+
Object.defineProperty(exports, "getCurrentUserId", { enumerable: true, get: function () { return analyticsLogger_1.getCurrentUserId; } });
|
|
21
|
+
Object.defineProperty(exports, "getDefaultEventParameters", { enumerable: true, get: function () { return analyticsLogger_1.getDefaultEventParameters; } });
|
|
22
|
+
Object.defineProperty(exports, "getCollectionEnabled", { enumerable: true, get: function () { return analyticsLogger_1.getCollectionEnabled; } });
|
|
23
|
+
Object.defineProperty(exports, "setMaxAnalyticsLogsLimit", { enumerable: true, get: function () { return analyticsLogger_1.setMaxAnalyticsLogsLimit; } });
|
|
24
|
+
Object.defineProperty(exports, "getMaxAnalyticsLogsLimit", { enumerable: true, get: function () { return analyticsLogger_1.getMaxAnalyticsLogsLimit; } });
|
|
25
|
+
Object.defineProperty(exports, "pruneAnalyticsLogs", { enumerable: true, get: function () { return analyticsLogger_1.pruneAnalyticsLogs; } });
|
|
26
|
+
var gaAnalyticsRegistry_1 = require("./helpers/gaAnalyticsRegistry");
|
|
27
|
+
Object.defineProperty(exports, "getEventCategory", { enumerable: true, get: function () { return gaAnalyticsRegistry_1.getEventCategory; } });
|
|
28
|
+
Object.defineProperty(exports, "registerGAPlugin", { enumerable: true, get: function () { return gaAnalyticsRegistry_1.registerGAPlugin; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-module entry point: react-native-inapp-inspector/bundle
|
|
3
|
+
* Clean tree-shaking & isolated JS bundle size analyzer.
|
|
4
|
+
*/
|
|
5
|
+
export { analyzeHostAppBundle, parseBundleSource, getInitialBundleAnalysis, getCachedBundleAnalysis, clearCachedBundleAnalysis, setBundleModuleEnabled, getBundleModuleEnabled, getHostScriptURL, trackRuntimeModuleExecution, trackRuntimeDefine, type HostBundleAnalysisResult, type HostBundleFileItem, type HostBundlePackageItem, type HostBinaryComponentItem, type FileTypeCategory, } from './customHooks/bundleAnalyzer';
|
|
6
|
+
export { BundleSubTab, } from './types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BundleSubTab = exports.trackRuntimeDefine = exports.trackRuntimeModuleExecution = exports.getHostScriptURL = exports.getBundleModuleEnabled = exports.setBundleModuleEnabled = exports.clearCachedBundleAnalysis = exports.getCachedBundleAnalysis = exports.getInitialBundleAnalysis = exports.parseBundleSource = exports.analyzeHostAppBundle = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sub-module entry point: react-native-inapp-inspector/bundle
|
|
6
|
+
* Clean tree-shaking & isolated JS bundle size analyzer.
|
|
7
|
+
*/
|
|
8
|
+
var bundleAnalyzer_1 = require("./customHooks/bundleAnalyzer");
|
|
9
|
+
Object.defineProperty(exports, "analyzeHostAppBundle", { enumerable: true, get: function () { return bundleAnalyzer_1.analyzeHostAppBundle; } });
|
|
10
|
+
Object.defineProperty(exports, "parseBundleSource", { enumerable: true, get: function () { return bundleAnalyzer_1.parseBundleSource; } });
|
|
11
|
+
Object.defineProperty(exports, "getInitialBundleAnalysis", { enumerable: true, get: function () { return bundleAnalyzer_1.getInitialBundleAnalysis; } });
|
|
12
|
+
Object.defineProperty(exports, "getCachedBundleAnalysis", { enumerable: true, get: function () { return bundleAnalyzer_1.getCachedBundleAnalysis; } });
|
|
13
|
+
Object.defineProperty(exports, "clearCachedBundleAnalysis", { enumerable: true, get: function () { return bundleAnalyzer_1.clearCachedBundleAnalysis; } });
|
|
14
|
+
Object.defineProperty(exports, "setBundleModuleEnabled", { enumerable: true, get: function () { return bundleAnalyzer_1.setBundleModuleEnabled; } });
|
|
15
|
+
Object.defineProperty(exports, "getBundleModuleEnabled", { enumerable: true, get: function () { return bundleAnalyzer_1.getBundleModuleEnabled; } });
|
|
16
|
+
Object.defineProperty(exports, "getHostScriptURL", { enumerable: true, get: function () { return bundleAnalyzer_1.getHostScriptURL; } });
|
|
17
|
+
Object.defineProperty(exports, "trackRuntimeModuleExecution", { enumerable: true, get: function () { return bundleAnalyzer_1.trackRuntimeModuleExecution; } });
|
|
18
|
+
Object.defineProperty(exports, "trackRuntimeDefine", { enumerable: true, get: function () { return bundleAnalyzer_1.trackRuntimeDefine; } });
|
|
19
|
+
var types_1 = require("./types");
|
|
20
|
+
Object.defineProperty(exports, "BundleSubTab", { enumerable: true, get: function () { return types_1.BundleSubTab; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-module entry point: react-native-inapp-inspector/console
|
|
3
|
+
* Clean tree-shaking & isolated console logger.
|
|
4
|
+
*/
|
|
5
|
+
export { setupConsoleLogger, clearConsoleLogs, subscribeConsoleLogs, getConsoleLogs, setConsoleModuleEnabled, getConsoleModuleEnabled, setMaxConsoleLogsLimit, getMaxConsoleLogsLimit, pruneConsoleLogs, } from './customHooks/consoleLogger';
|
|
6
|
+
export type { ConsoleLog, } from './types';
|
|
7
|
+
export { ConsoleLogType, LogFilter, } from './types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogFilter = exports.ConsoleLogType = exports.pruneConsoleLogs = exports.getMaxConsoleLogsLimit = exports.setMaxConsoleLogsLimit = exports.getConsoleModuleEnabled = exports.setConsoleModuleEnabled = exports.getConsoleLogs = exports.subscribeConsoleLogs = exports.clearConsoleLogs = exports.setupConsoleLogger = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sub-module entry point: react-native-inapp-inspector/console
|
|
6
|
+
* Clean tree-shaking & isolated console logger.
|
|
7
|
+
*/
|
|
8
|
+
var consoleLogger_1 = require("./customHooks/consoleLogger");
|
|
9
|
+
Object.defineProperty(exports, "setupConsoleLogger", { enumerable: true, get: function () { return consoleLogger_1.setupConsoleLogger; } });
|
|
10
|
+
Object.defineProperty(exports, "clearConsoleLogs", { enumerable: true, get: function () { return consoleLogger_1.clearConsoleLogs; } });
|
|
11
|
+
Object.defineProperty(exports, "subscribeConsoleLogs", { enumerable: true, get: function () { return consoleLogger_1.subscribeConsoleLogs; } });
|
|
12
|
+
Object.defineProperty(exports, "getConsoleLogs", { enumerable: true, get: function () { return consoleLogger_1.getConsoleLogs; } });
|
|
13
|
+
Object.defineProperty(exports, "setConsoleModuleEnabled", { enumerable: true, get: function () { return consoleLogger_1.setConsoleModuleEnabled; } });
|
|
14
|
+
Object.defineProperty(exports, "getConsoleModuleEnabled", { enumerable: true, get: function () { return consoleLogger_1.getConsoleModuleEnabled; } });
|
|
15
|
+
Object.defineProperty(exports, "setMaxConsoleLogsLimit", { enumerable: true, get: function () { return consoleLogger_1.setMaxConsoleLogsLimit; } });
|
|
16
|
+
Object.defineProperty(exports, "getMaxConsoleLogsLimit", { enumerable: true, get: function () { return consoleLogger_1.getMaxConsoleLogsLimit; } });
|
|
17
|
+
Object.defineProperty(exports, "pruneConsoleLogs", { enumerable: true, get: function () { return consoleLogger_1.pruneConsoleLogs; } });
|
|
18
|
+
var types_1 = require("./types");
|
|
19
|
+
Object.defineProperty(exports, "ConsoleLogType", { enumerable: true, get: function () { return types_1.ConsoleLogType; } });
|
|
20
|
+
Object.defineProperty(exports, "LogFilter", { enumerable: true, get: function () { return types_1.LogFilter; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.2.
|
|
1
|
+
export declare const LIB_VERSION = "2.2.2";
|
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LIB_VERSION = void 0;
|
|
4
4
|
// AUTO-GENERATED FILE — do not edit by hand.
|
|
5
5
|
// Regenerated from package.json on every build by scripts/gen-version.js.
|
|
6
|
-
exports.LIB_VERSION = '2.2.
|
|
6
|
+
exports.LIB_VERSION = '2.2.2';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-module entry point: react-native-inapp-inspector/crash
|
|
3
|
+
* Clean tree-shaking & isolated global crash handler and reporting.
|
|
4
|
+
*/
|
|
5
|
+
export { setupGlobalCrashHandler, subscribeCrashEvents, emitCrashEvent, getCrashRecords, clearCrashRecords, simulateTestCrash, exportCrashReport, parseCrashStackTrace, setMaxCrashLogsLimit, getMaxCrashLogsLimit, pruneCrashRecords, setCrashModuleEnabled, getCrashModuleEnabled, } from './customHooks/crashHandler';
|
|
6
|
+
export type { CrashRecord, CrashBreadcrumb, } from './types';
|
|
7
|
+
export { CrashType, CrashExportFormat, CrashDetailSubTab, CrashFilterType, BreadcrumbType, } from './types';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BreadcrumbType = exports.CrashFilterType = exports.CrashDetailSubTab = exports.CrashExportFormat = exports.CrashType = exports.getCrashModuleEnabled = exports.setCrashModuleEnabled = exports.pruneCrashRecords = exports.getMaxCrashLogsLimit = exports.setMaxCrashLogsLimit = exports.parseCrashStackTrace = exports.exportCrashReport = exports.simulateTestCrash = exports.clearCrashRecords = exports.getCrashRecords = exports.emitCrashEvent = exports.subscribeCrashEvents = exports.setupGlobalCrashHandler = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sub-module entry point: react-native-inapp-inspector/crash
|
|
6
|
+
* Clean tree-shaking & isolated global crash handler and reporting.
|
|
7
|
+
*/
|
|
8
|
+
var crashHandler_1 = require("./customHooks/crashHandler");
|
|
9
|
+
Object.defineProperty(exports, "setupGlobalCrashHandler", { enumerable: true, get: function () { return crashHandler_1.setupGlobalCrashHandler; } });
|
|
10
|
+
Object.defineProperty(exports, "subscribeCrashEvents", { enumerable: true, get: function () { return crashHandler_1.subscribeCrashEvents; } });
|
|
11
|
+
Object.defineProperty(exports, "emitCrashEvent", { enumerable: true, get: function () { return crashHandler_1.emitCrashEvent; } });
|
|
12
|
+
Object.defineProperty(exports, "getCrashRecords", { enumerable: true, get: function () { return crashHandler_1.getCrashRecords; } });
|
|
13
|
+
Object.defineProperty(exports, "clearCrashRecords", { enumerable: true, get: function () { return crashHandler_1.clearCrashRecords; } });
|
|
14
|
+
Object.defineProperty(exports, "simulateTestCrash", { enumerable: true, get: function () { return crashHandler_1.simulateTestCrash; } });
|
|
15
|
+
Object.defineProperty(exports, "exportCrashReport", { enumerable: true, get: function () { return crashHandler_1.exportCrashReport; } });
|
|
16
|
+
Object.defineProperty(exports, "parseCrashStackTrace", { enumerable: true, get: function () { return crashHandler_1.parseCrashStackTrace; } });
|
|
17
|
+
Object.defineProperty(exports, "setMaxCrashLogsLimit", { enumerable: true, get: function () { return crashHandler_1.setMaxCrashLogsLimit; } });
|
|
18
|
+
Object.defineProperty(exports, "getMaxCrashLogsLimit", { enumerable: true, get: function () { return crashHandler_1.getMaxCrashLogsLimit; } });
|
|
19
|
+
Object.defineProperty(exports, "pruneCrashRecords", { enumerable: true, get: function () { return crashHandler_1.pruneCrashRecords; } });
|
|
20
|
+
Object.defineProperty(exports, "setCrashModuleEnabled", { enumerable: true, get: function () { return crashHandler_1.setCrashModuleEnabled; } });
|
|
21
|
+
Object.defineProperty(exports, "getCrashModuleEnabled", { enumerable: true, get: function () { return crashHandler_1.getCrashModuleEnabled; } });
|
|
22
|
+
var types_1 = require("./types");
|
|
23
|
+
Object.defineProperty(exports, "CrashType", { enumerable: true, get: function () { return types_1.CrashType; } });
|
|
24
|
+
Object.defineProperty(exports, "CrashExportFormat", { enumerable: true, get: function () { return types_1.CrashExportFormat; } });
|
|
25
|
+
Object.defineProperty(exports, "CrashDetailSubTab", { enumerable: true, get: function () { return types_1.CrashDetailSubTab; } });
|
|
26
|
+
Object.defineProperty(exports, "CrashFilterType", { enumerable: true, get: function () { return types_1.CrashFilterType; } });
|
|
27
|
+
Object.defineProperty(exports, "BreadcrumbType", { enumerable: true, get: function () { return types_1.BreadcrumbType; } });
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AnalyticsEvent } from '../types';
|
|
2
2
|
export declare const setAnalyticsModuleEnabled: (enabled: boolean) => void;
|
|
3
3
|
export declare const getAnalyticsModuleEnabled: () => boolean;
|
|
4
|
+
export declare const setMaxAnalyticsLogsLimit: (limit: number) => void;
|
|
5
|
+
export declare const getMaxAnalyticsLogsLimit: () => number;
|
|
6
|
+
export declare const pruneAnalyticsLogs: (targetCount?: number) => number;
|
|
4
7
|
export declare const subscribeAnalyticsEvents: (callback: (events: AnalyticsEvent[]) => void) => () => void;
|
|
5
8
|
export declare const clearAnalyticsEvents: () => void;
|
|
6
9
|
export declare const getAnalyticsEvents: () => AnalyticsEvent[];
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// setUserId(id)
|
|
23
23
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.autoSetupAnalyticsLogger = exports.setupAnalyticsLogger = exports.isFirebaseAnalyticsPatched = exports.isAnalyticsConnected = exports.logAnalyticsEvent = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.getAnalyticsEvents = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.getAnalyticsModuleEnabled = exports.setAnalyticsModuleEnabled = void 0;
|
|
25
|
+
exports.autoSetupAnalyticsLogger = exports.setupAnalyticsLogger = exports.isFirebaseAnalyticsPatched = exports.isAnalyticsConnected = exports.logAnalyticsEvent = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.getAnalyticsEvents = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.pruneAnalyticsLogs = exports.getMaxAnalyticsLogsLimit = exports.setMaxAnalyticsLogsLimit = exports.getAnalyticsModuleEnabled = exports.setAnalyticsModuleEnabled = void 0;
|
|
26
26
|
// ─── Internal state ───────────────────────────────────────────────────────────
|
|
27
27
|
let events = [];
|
|
28
28
|
let listeners = [];
|
|
@@ -39,6 +39,27 @@ let currentUserProperties = {};
|
|
|
39
39
|
let currentUserId;
|
|
40
40
|
let currentDefaultEventParameters = {};
|
|
41
41
|
let isCollectionEnabled = true;
|
|
42
|
+
let maxAnalyticsLogsLimit = 75;
|
|
43
|
+
const setMaxAnalyticsLogsLimit = (limit) => {
|
|
44
|
+
maxAnalyticsLogsLimit = Math.max(10, limit);
|
|
45
|
+
if (events.length > maxAnalyticsLogsLimit) {
|
|
46
|
+
events = events.slice(0, maxAnalyticsLogsLimit);
|
|
47
|
+
notify();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.setMaxAnalyticsLogsLimit = setMaxAnalyticsLogsLimit;
|
|
51
|
+
const getMaxAnalyticsLogsLimit = () => maxAnalyticsLogsLimit;
|
|
52
|
+
exports.getMaxAnalyticsLogsLimit = getMaxAnalyticsLogsLimit;
|
|
53
|
+
const pruneAnalyticsLogs = (targetCount) => {
|
|
54
|
+
const countToKeep = targetCount !== undefined ? Math.max(0, targetCount) : Math.floor(events.length / 2);
|
|
55
|
+
const pruned = events.length - countToKeep;
|
|
56
|
+
if (pruned > 0) {
|
|
57
|
+
events = events.slice(0, countToKeep);
|
|
58
|
+
notify();
|
|
59
|
+
}
|
|
60
|
+
return Math.max(0, pruned);
|
|
61
|
+
};
|
|
62
|
+
exports.pruneAnalyticsLogs = pruneAnalyticsLogs;
|
|
42
63
|
// ─── Core helpers ─────────────────────────────────────────────────────────────
|
|
43
64
|
const notify = () => {
|
|
44
65
|
const snapshot = [...events];
|
|
@@ -48,7 +69,7 @@ const addEvent = (event) => {
|
|
|
48
69
|
if (!isAnalyticsModuleEnabled)
|
|
49
70
|
return;
|
|
50
71
|
events.unshift(event);
|
|
51
|
-
events = events.slice(0,
|
|
72
|
+
events = events.slice(0, maxAnalyticsLogsLimit);
|
|
52
73
|
notify();
|
|
53
74
|
};
|
|
54
75
|
// ─── Public subscribe / query API ────────────────────────────────────────────
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ConsoleLog } from '../types';
|
|
2
2
|
export declare const setConsoleModuleEnabled: (enabled: boolean) => void;
|
|
3
3
|
export declare const getConsoleModuleEnabled: () => boolean;
|
|
4
|
+
export declare const setMaxConsoleLogsLimit: (limit: number) => void;
|
|
5
|
+
export declare const getMaxConsoleLogsLimit: () => number;
|
|
6
|
+
export declare const pruneConsoleLogs: (targetCount?: number) => number;
|
|
4
7
|
export declare const addLogFromCrash: (error: any, message: string, stack?: string, isFatal?: boolean) => ConsoleLog;
|
|
5
8
|
export declare const subscribeConsoleLogs: (callback: (logs: ConsoleLog[]) => void) => () => void;
|
|
6
9
|
export declare const clearConsoleLogs: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupConsoleLogger = exports.getConsoleLogs = exports.clearConsoleLogs = exports.subscribeConsoleLogs = exports.addLogFromCrash = exports.getConsoleModuleEnabled = exports.setConsoleModuleEnabled = void 0;
|
|
3
|
+
exports.setupConsoleLogger = exports.getConsoleLogs = exports.clearConsoleLogs = exports.subscribeConsoleLogs = exports.addLogFromCrash = exports.pruneConsoleLogs = exports.getMaxConsoleLogsLimit = exports.setMaxConsoleLogsLimit = exports.getConsoleModuleEnabled = exports.setConsoleModuleEnabled = void 0;
|
|
4
4
|
const react_native_1 = require("react-native");
|
|
5
5
|
const logFilters_1 = require("./logFilters");
|
|
6
6
|
const crashHandler_1 = require("./crashHandler");
|
|
@@ -15,7 +15,27 @@ const setConsoleModuleEnabled = (enabled) => {
|
|
|
15
15
|
exports.setConsoleModuleEnabled = setConsoleModuleEnabled;
|
|
16
16
|
const getConsoleModuleEnabled = () => isConsoleModuleEnabled;
|
|
17
17
|
exports.getConsoleModuleEnabled = getConsoleModuleEnabled;
|
|
18
|
-
|
|
18
|
+
let maxConsoleLogsLimit = 100;
|
|
19
|
+
const setMaxConsoleLogsLimit = (limit) => {
|
|
20
|
+
maxConsoleLogsLimit = Math.max(10, limit);
|
|
21
|
+
if (logs.length > maxConsoleLogsLimit) {
|
|
22
|
+
logs = logs.slice(0, maxConsoleLogsLimit);
|
|
23
|
+
notify();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.setMaxConsoleLogsLimit = setMaxConsoleLogsLimit;
|
|
27
|
+
const getMaxConsoleLogsLimit = () => maxConsoleLogsLimit;
|
|
28
|
+
exports.getMaxConsoleLogsLimit = getMaxConsoleLogsLimit;
|
|
29
|
+
const pruneConsoleLogs = (targetCount) => {
|
|
30
|
+
const countToKeep = targetCount !== undefined ? Math.max(0, targetCount) : Math.floor(logs.length / 2);
|
|
31
|
+
const pruned = logs.length - countToKeep;
|
|
32
|
+
if (pruned > 0) {
|
|
33
|
+
logs = logs.slice(0, countToKeep);
|
|
34
|
+
notify();
|
|
35
|
+
}
|
|
36
|
+
return Math.max(0, pruned);
|
|
37
|
+
};
|
|
38
|
+
exports.pruneConsoleLogs = pruneConsoleLogs;
|
|
19
39
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
20
40
|
const formatArgs = (args) => {
|
|
21
41
|
return args
|
|
@@ -229,7 +249,7 @@ const addLog = (type, args, sourceMethod) => {
|
|
|
229
249
|
sourceMethod,
|
|
230
250
|
};
|
|
231
251
|
logs.unshift(newLog);
|
|
232
|
-
logs = logs.slice(0,
|
|
252
|
+
logs = logs.slice(0, maxConsoleLogsLimit);
|
|
233
253
|
notify();
|
|
234
254
|
// Asynchronously symbolicate stack trace via Metro in development
|
|
235
255
|
const stackToSymbolicate = errorStack || stackToUse || stack;
|
|
@@ -315,7 +335,7 @@ const addLogFromCrash = (error, message, stack, isFatal) => {
|
|
|
315
335
|
sourceMethod: 'error',
|
|
316
336
|
};
|
|
317
337
|
logs.unshift(newLog);
|
|
318
|
-
logs = logs.slice(0,
|
|
338
|
+
logs = logs.slice(0, maxConsoleLogsLimit);
|
|
319
339
|
notify();
|
|
320
340
|
const stackToSym = stack || error?.stack || errorStack;
|
|
321
341
|
if (stackToSym && typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
@@ -14,6 +14,8 @@ type CrashListener = (payload: CrashEventPayload) => void;
|
|
|
14
14
|
export declare const setCrashModuleEnabled: (enabled: boolean) => void;
|
|
15
15
|
export declare const getCrashModuleEnabled: () => boolean;
|
|
16
16
|
export declare const setMaxCrashLogsLimit: (max: number) => void;
|
|
17
|
+
export declare const getMaxCrashLogsLimit: () => number;
|
|
18
|
+
export declare const pruneCrashRecords: (targetCount?: number) => number;
|
|
17
19
|
export declare const addCrashBreadcrumb: (type: CrashBreadcrumb["type"], message: string, data?: any) => void;
|
|
18
20
|
export declare const recordNavigationBreadcrumb: (fromRoute: string, toRoute: string) => void;
|
|
19
21
|
export declare const recordNetworkBreadcrumb: (url: string, method: string, status?: number, duration?: number) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupGlobalCrashHandler = exports.exportCrashReport = exports.simulateTestCrash = exports.recordCustomCrash = exports.handleInterceptedCrash = exports.emitCrashEvent = exports.subscribeCrashEvents = exports.clearCrashRecords = exports.getCrashRecords = exports.computeCrashFingerprint = exports.parseCrashStackTrace = exports.getCrashBreadcrumbs = exports.clearCrashBreadcrumbs = exports.recordUserActionBreadcrumb = exports.recordReduxBreadcrumb = exports.recordNetworkBreadcrumb = exports.recordNavigationBreadcrumb = exports.addCrashBreadcrumb = exports.setMaxCrashLogsLimit = exports.getCrashModuleEnabled = exports.setCrashModuleEnabled = exports.CrashExportFormat = void 0;
|
|
3
|
+
exports.setupGlobalCrashHandler = exports.exportCrashReport = exports.simulateTestCrash = exports.recordCustomCrash = exports.handleInterceptedCrash = exports.emitCrashEvent = exports.subscribeCrashEvents = exports.clearCrashRecords = exports.getCrashRecords = exports.computeCrashFingerprint = exports.parseCrashStackTrace = exports.getCrashBreadcrumbs = exports.clearCrashBreadcrumbs = exports.recordUserActionBreadcrumb = exports.recordReduxBreadcrumb = exports.recordNetworkBreadcrumb = exports.recordNavigationBreadcrumb = exports.addCrashBreadcrumb = exports.pruneCrashRecords = exports.getMaxCrashLogsLimit = exports.setMaxCrashLogsLimit = exports.getCrashModuleEnabled = exports.setCrashModuleEnabled = exports.CrashExportFormat = void 0;
|
|
4
4
|
const react_native_1 = require("react-native");
|
|
5
5
|
const enums_1 = require("../types/enums");
|
|
6
6
|
Object.defineProperty(exports, "CrashExportFormat", { enumerable: true, get: function () { return enums_1.CrashExportFormat; } });
|
|
@@ -30,6 +30,20 @@ const setMaxCrashLogsLimit = (max) => {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
exports.setMaxCrashLogsLimit = setMaxCrashLogsLimit;
|
|
33
|
+
const getMaxCrashLogsLimit = () => maxStoredCrashes;
|
|
34
|
+
exports.getMaxCrashLogsLimit = getMaxCrashLogsLimit;
|
|
35
|
+
const pruneCrashRecords = (targetCount) => {
|
|
36
|
+
const countToKeep = targetCount !== undefined ? Math.max(0, targetCount) : Math.floor(crashRecordsStore.length / 2);
|
|
37
|
+
const pruned = crashRecordsStore.length - countToKeep;
|
|
38
|
+
if (pruned > 0) {
|
|
39
|
+
crashRecordsStore = crashRecordsStore.slice(0, countToKeep);
|
|
40
|
+
}
|
|
41
|
+
if (breadcrumbsStore.length > 20) {
|
|
42
|
+
breadcrumbsStore = breadcrumbsStore.slice(0, 20);
|
|
43
|
+
}
|
|
44
|
+
return Math.max(0, pruned);
|
|
45
|
+
};
|
|
46
|
+
exports.pruneCrashRecords = pruneCrashRecords;
|
|
33
47
|
const addCrashBreadcrumb = (type, message, data) => {
|
|
34
48
|
if (!isCrashModuleEnabled)
|
|
35
49
|
return;
|
|
@@ -17,6 +17,9 @@ export declare const getNetworkModuleEnabled: () => boolean;
|
|
|
17
17
|
export declare const subscribeNetworkLogs: (callback: (logs: NetworkLog[]) => void) => () => void;
|
|
18
18
|
export declare const clearNetworkLogs: () => void;
|
|
19
19
|
export declare const getNetworkLogs: () => NetworkLog[];
|
|
20
|
+
export declare const setMaxNetworkLogsLimit: (limit: number) => void;
|
|
21
|
+
export declare const getMaxNetworkLogsLimit: () => number;
|
|
22
|
+
export declare const pruneNetworkLogs: (targetCount?: number) => number;
|
|
20
23
|
export declare const setupNetworkLogger: () => void;
|
|
21
24
|
export declare const addAxiosInterceptors: (axiosInstance: any) => void;
|
|
22
25
|
export {};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addAxiosInterceptors = exports.setupNetworkLogger = exports.getNetworkLogs = exports.clearNetworkLogs = exports.subscribeNetworkLogs = exports.getNetworkModuleEnabled = exports.setNetworkModuleEnabled = void 0;
|
|
6
|
+
exports.addAxiosInterceptors = exports.setupNetworkLogger = exports.pruneNetworkLogs = exports.getMaxNetworkLogsLimit = exports.setMaxNetworkLogsLimit = exports.getNetworkLogs = exports.clearNetworkLogs = exports.subscribeNetworkLogs = exports.getNetworkModuleEnabled = exports.setNetworkModuleEnabled = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const crashHandler_1 = require("./crashHandler");
|
|
9
9
|
let logs = [];
|
|
@@ -122,6 +122,27 @@ const clearNetworkLogs = () => {
|
|
|
122
122
|
exports.clearNetworkLogs = clearNetworkLogs;
|
|
123
123
|
const getNetworkLogs = () => [...logs];
|
|
124
124
|
exports.getNetworkLogs = getNetworkLogs;
|
|
125
|
+
let maxNetworkLogsLimit = 100;
|
|
126
|
+
const setMaxNetworkLogsLimit = (limit) => {
|
|
127
|
+
maxNetworkLogsLimit = Math.max(10, limit);
|
|
128
|
+
if (logs.length > maxNetworkLogsLimit) {
|
|
129
|
+
logs = logs.slice(0, maxNetworkLogsLimit);
|
|
130
|
+
notify();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
exports.setMaxNetworkLogsLimit = setMaxNetworkLogsLimit;
|
|
134
|
+
const getMaxNetworkLogsLimit = () => maxNetworkLogsLimit;
|
|
135
|
+
exports.getMaxNetworkLogsLimit = getMaxNetworkLogsLimit;
|
|
136
|
+
const pruneNetworkLogs = (targetCount) => {
|
|
137
|
+
const countToKeep = targetCount !== undefined ? Math.max(0, targetCount) : Math.floor(logs.length / 2);
|
|
138
|
+
const pruned = logs.length - countToKeep;
|
|
139
|
+
if (pruned > 0) {
|
|
140
|
+
logs = logs.slice(0, countToKeep);
|
|
141
|
+
notify();
|
|
142
|
+
}
|
|
143
|
+
return Math.max(0, pruned);
|
|
144
|
+
};
|
|
145
|
+
exports.pruneNetworkLogs = pruneNetworkLogs;
|
|
125
146
|
// ─── Internal ─────────────────────────────────────────────────────────────────
|
|
126
147
|
const notify = () => {
|
|
127
148
|
const snapshot = [...logs];
|
|
@@ -142,7 +163,7 @@ const addOrUpdateLog = (log) => {
|
|
|
142
163
|
else {
|
|
143
164
|
logs.unshift(log);
|
|
144
165
|
}
|
|
145
|
-
logs = logs.slice(0,
|
|
166
|
+
logs = logs.slice(0, maxNetworkLogsLimit);
|
|
146
167
|
notify();
|
|
147
168
|
};
|
|
148
169
|
// ─── Setup ────────────────────────────────────────────────────────────────────
|
|
@@ -159,6 +159,9 @@ export declare const usePerformanceTracker: (enabled?: boolean) => {
|
|
|
159
159
|
clearEvents: () => void;
|
|
160
160
|
triggerGc: () => void;
|
|
161
161
|
};
|
|
162
|
+
export declare const setMaxPerformanceEventsLimit: (limit: number) => void;
|
|
163
|
+
export declare const getMaxPerformanceEventsLimit: () => number;
|
|
164
|
+
export declare const prunePerformanceEvents: (targetCount?: number) => number;
|
|
162
165
|
export declare const logPerformanceEvent: (event: Omit<PerformanceEvent, "id" | "timestamp"> & {
|
|
163
166
|
id?: string;
|
|
164
167
|
timestamp?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPerformanceEvents = exports.subscribePerformanceEvents = exports.clearPerformanceEvents = exports.logPerformanceEvent = exports.usePerformanceTracker = exports.useComponentProfiler = exports.measureAsync = exports.trackHeavyTask = exports.useNavigationProfiler = exports.trackNavigationTransition = exports.getHermesMemoryStats = exports.trackComponentRender = exports.registerComponentProfile = exports.getRenderProfiles = exports.subscribeRenderProfiles = exports.getPerformanceModuleEnabled = exports.setPerformanceModuleEnabled = exports.INITIAL_EVENTS = exports.getInitialPerformanceEvents = exports.getInitialRenderProfiles = exports.generateFixSnippet = void 0;
|
|
3
|
+
exports.getPerformanceEvents = exports.subscribePerformanceEvents = exports.clearPerformanceEvents = exports.logPerformanceEvent = exports.prunePerformanceEvents = exports.getMaxPerformanceEventsLimit = exports.setMaxPerformanceEventsLimit = exports.usePerformanceTracker = exports.useComponentProfiler = exports.measureAsync = exports.trackHeavyTask = exports.useNavigationProfiler = exports.trackNavigationTransition = exports.getHermesMemoryStats = exports.trackComponentRender = exports.registerComponentProfile = exports.getRenderProfiles = exports.subscribeRenderProfiles = exports.getPerformanceModuleEnabled = exports.setPerformanceModuleEnabled = exports.INITIAL_EVENTS = exports.getInitialPerformanceEvents = exports.getInitialRenderProfiles = exports.generateFixSnippet = void 0;
|
|
4
4
|
exports.getCallerSourceFile = getCallerSourceFile;
|
|
5
5
|
const AppColors_1 = require("../styles/AppColors");
|
|
6
6
|
const i18n_1 = require("../i18n");
|
|
@@ -707,6 +707,37 @@ const usePerformanceTracker = (enabled = true) => {
|
|
|
707
707
|
exports.usePerformanceTracker = usePerformanceTracker;
|
|
708
708
|
const globalPerformanceEvents = [...exports.INITIAL_EVENTS];
|
|
709
709
|
const performanceListeners = new Set();
|
|
710
|
+
let maxPerformanceEventsLimit = 100;
|
|
711
|
+
const setMaxPerformanceEventsLimit = (limit) => {
|
|
712
|
+
maxPerformanceEventsLimit = Math.max(10, limit);
|
|
713
|
+
if (globalPerformanceEvents.length > maxPerformanceEventsLimit) {
|
|
714
|
+
globalPerformanceEvents.length = maxPerformanceEventsLimit;
|
|
715
|
+
performanceListeners.forEach(listener => {
|
|
716
|
+
try {
|
|
717
|
+
listener([...globalPerformanceEvents]);
|
|
718
|
+
}
|
|
719
|
+
catch { }
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
exports.setMaxPerformanceEventsLimit = setMaxPerformanceEventsLimit;
|
|
724
|
+
const getMaxPerformanceEventsLimit = () => maxPerformanceEventsLimit;
|
|
725
|
+
exports.getMaxPerformanceEventsLimit = getMaxPerformanceEventsLimit;
|
|
726
|
+
const prunePerformanceEvents = (targetCount) => {
|
|
727
|
+
const countToKeep = targetCount !== undefined ? Math.max(0, targetCount) : Math.floor(globalPerformanceEvents.length / 2);
|
|
728
|
+
const pruned = globalPerformanceEvents.length - countToKeep;
|
|
729
|
+
if (pruned > 0) {
|
|
730
|
+
globalPerformanceEvents.length = countToKeep;
|
|
731
|
+
performanceListeners.forEach(listener => {
|
|
732
|
+
try {
|
|
733
|
+
listener([...globalPerformanceEvents]);
|
|
734
|
+
}
|
|
735
|
+
catch { }
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
return Math.max(0, pruned);
|
|
739
|
+
};
|
|
740
|
+
exports.prunePerformanceEvents = prunePerformanceEvents;
|
|
710
741
|
const logPerformanceEvent = (event) => {
|
|
711
742
|
const fullEvent = {
|
|
712
743
|
id: event.id ||
|
|
@@ -716,8 +747,8 @@ const logPerformanceEvent = (event) => {
|
|
|
716
747
|
...event,
|
|
717
748
|
};
|
|
718
749
|
globalPerformanceEvents.unshift(fullEvent);
|
|
719
|
-
if (globalPerformanceEvents.length >
|
|
720
|
-
globalPerformanceEvents.
|
|
750
|
+
if (globalPerformanceEvents.length > maxPerformanceEventsLimit) {
|
|
751
|
+
globalPerformanceEvents.length = maxPerformanceEventsLimit;
|
|
721
752
|
}
|
|
722
753
|
performanceListeners.forEach(listener => {
|
|
723
754
|
try {
|
|
@@ -2,6 +2,9 @@ import { ReduxHistoryEntry } from '../types';
|
|
|
2
2
|
export { ReduxHistoryEntry };
|
|
3
3
|
export declare const setReduxModuleEnabled: (enabled: boolean) => void;
|
|
4
4
|
export declare const getReduxModuleEnabled: () => boolean;
|
|
5
|
+
export declare const setMaxReduxHistoryLimit: (limit: number) => void;
|
|
6
|
+
export declare const getMaxReduxHistoryLimit: () => number;
|
|
7
|
+
export declare const pruneReduxHistory: (targetCount?: number) => number;
|
|
5
8
|
export declare const isReduxConnected: () => boolean;
|
|
6
9
|
export declare const getReduxState: () => any;
|
|
7
10
|
export declare const setReduxAutoRefresh: (val: boolean) => void;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// dispatch reference at store-creation time) still update the state tree
|
|
14
14
|
// and per-reducer "last action" consistently.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.connectReduxStore = exports.inspectorReduxMiddleware = exports.subscribeReduxState = exports.setReduxState = exports.clearActionHistory = exports.getActionHistory = exports.clearLastActionForReducer = exports.getLastActionForReducer = exports.getReduxAutoRefresh = exports.setReduxAutoRefresh = exports.getReduxState = exports.isReduxConnected = exports.getReduxModuleEnabled = exports.setReduxModuleEnabled = void 0;
|
|
16
|
+
exports.connectReduxStore = exports.inspectorReduxMiddleware = exports.subscribeReduxState = exports.setReduxState = exports.clearActionHistory = exports.getActionHistory = exports.clearLastActionForReducer = exports.getLastActionForReducer = exports.getReduxAutoRefresh = exports.setReduxAutoRefresh = exports.getReduxState = exports.isReduxConnected = exports.pruneReduxHistory = exports.getMaxReduxHistoryLimit = exports.setMaxReduxHistoryLimit = exports.getReduxModuleEnabled = exports.setReduxModuleEnabled = void 0;
|
|
17
17
|
const helpers_1 = require("../helpers");
|
|
18
18
|
let currentReduxState = null;
|
|
19
19
|
const listeners = new Set();
|
|
@@ -27,8 +27,28 @@ const getReduxModuleEnabled = () => isReduxModuleEnabled;
|
|
|
27
27
|
exports.getReduxModuleEnabled = getReduxModuleEnabled;
|
|
28
28
|
let lastActionForReducer = {};
|
|
29
29
|
let actionHistory = [];
|
|
30
|
-
|
|
30
|
+
let maxReduxHistoryLimit = 50;
|
|
31
31
|
let historyIdSeq = 0;
|
|
32
|
+
const setMaxReduxHistoryLimit = (limit) => {
|
|
33
|
+
maxReduxHistoryLimit = Math.max(10, limit);
|
|
34
|
+
if (actionHistory.length > maxReduxHistoryLimit) {
|
|
35
|
+
actionHistory = actionHistory.slice(0, maxReduxHistoryLimit);
|
|
36
|
+
notify();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.setMaxReduxHistoryLimit = setMaxReduxHistoryLimit;
|
|
40
|
+
const getMaxReduxHistoryLimit = () => maxReduxHistoryLimit;
|
|
41
|
+
exports.getMaxReduxHistoryLimit = getMaxReduxHistoryLimit;
|
|
42
|
+
const pruneReduxHistory = (targetCount) => {
|
|
43
|
+
const countToKeep = targetCount !== undefined ? Math.max(0, targetCount) : Math.floor(actionHistory.length / 2);
|
|
44
|
+
const pruned = actionHistory.length - countToKeep;
|
|
45
|
+
if (pruned > 0) {
|
|
46
|
+
actionHistory = actionHistory.slice(0, countToKeep);
|
|
47
|
+
notify();
|
|
48
|
+
}
|
|
49
|
+
return Math.max(0, pruned);
|
|
50
|
+
};
|
|
51
|
+
exports.pruneReduxHistory = pruneReduxHistory;
|
|
32
52
|
// Guards against double-instrumentation (e.g. connectReduxStore called twice,
|
|
33
53
|
// or middleware + connect used together) which previously produced duplicate
|
|
34
54
|
// timeline entries and inconsistent counts.
|
|
@@ -234,8 +254,8 @@ function recordAction(action, prevState, nextState, rawStack) {
|
|
|
234
254
|
originType: origin.originType,
|
|
235
255
|
sliceName,
|
|
236
256
|
});
|
|
237
|
-
if (actionHistory.length >
|
|
238
|
-
actionHistory.length =
|
|
257
|
+
if (actionHistory.length > maxReduxHistoryLimit) {
|
|
258
|
+
actionHistory.length = maxReduxHistoryLimit;
|
|
239
259
|
}
|
|
240
260
|
if (globalReduxAutoRefresh) {
|
|
241
261
|
currentReduxState = nextState;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NetworkLog, RouteInfo, DiffResult, JsonContent, StackFrameType } from '../types';
|
|
2
2
|
export * from './searchQueryParser';
|
|
3
3
|
export * from './telemetry';
|
|
4
|
+
export * from './memoryManager';
|
|
4
5
|
export declare const getDomainColor: (domain: string) => string;
|
|
5
6
|
export declare const formatDateTime: (timestamp: number) => string;
|
|
6
7
|
export declare const formatTimestamp: (timestamp: number) => string;
|
|
@@ -27,6 +27,7 @@ const AppColors_1 = require("../styles/AppColors");
|
|
|
27
27
|
const constants_1 = require("../constants");
|
|
28
28
|
__exportStar(require("./searchQueryParser"), exports);
|
|
29
29
|
__exportStar(require("./telemetry"), exports);
|
|
30
|
+
__exportStar(require("./memoryManager"), exports);
|
|
30
31
|
const getDomainColor = (domain) => {
|
|
31
32
|
if (!domain)
|
|
32
33
|
return constants_1.DOMAIN_COLORS[0];
|