@wavemaker/app-rn-runtime 11.14.1-14.6394 → 11.14.1-15.6409
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/components/basic/bottomsheet/bottomsheet.component.js +12 -0
- package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
- package/components/basic/progress-circle/progress-circle.component.js +3 -3
- package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- package/components/chart/area-chart/area-chart.component.js +26 -9
- package/components/chart/area-chart/area-chart.component.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.component.js +35 -6
- package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.props.js +1 -0
- package/components/chart/bar-chart/bar-chart.props.js.map +1 -1
- package/components/chart/basechart.component.js +8 -7
- package/components/chart/basechart.component.js.map +1 -1
- package/components/chart/basechart.props.js +1 -0
- package/components/chart/basechart.props.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.component.js +22 -5
- package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- package/components/chart/line-chart/line-chart.component.js +22 -5
- package/components/chart/line-chart/line-chart.component.js.map +1 -1
- package/components/chart/pie-chart/pie-chart.component.js +14 -2
- package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- package/components/container/wizard/wizard.component.js +1 -1
- package/components/container/wizard/wizard.component.js.map +1 -1
- package/components/container/wizard/wizard.props.js +0 -1
- package/components/container/wizard/wizard.props.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.component.js +2 -2
- package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- package/components/input/radioset/radioset.component.js +3 -6
- package/components/input/radioset/radioset.component.js.map +1 -1
- package/components/input/text/text.component.js +1 -0
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.styles.js +4 -0
- package/components/input/text/text.styles.js.map +1 -1
- package/components/navigation/popover/popover.component.js +3 -3
- package/components/navigation/popover/popover.component.js.map +1 -1
- package/core/base.component.js +0 -5
- package/core/base.component.js.map +1 -1
- package/core/components/error-fallback/error-fallback.component.js +18 -50
- package/core/components/error-fallback/error-fallback.component.js.map +1 -1
- package/core/components/error-fallback/error-fallback.styles.js +1 -4
- package/core/components/error-fallback/error-fallback.styles.js.map +1 -1
- package/core/components/textinput.component.js +6 -2
- package/core/components/textinput.component.js.map +1 -1
- package/core/error-boundary.component.js +1 -17
- package/core/error-boundary.component.js.map +1 -1
- package/core/fixed-view.component.js +19 -2
- package/core/fixed-view.component.js.map +1 -1
- package/core/tappable.component.js +1 -1
- package/core/tappable.component.js.map +1 -1
- package/npm-shrinkwrap.json +138 -137
- package/package-lock.json +138 -137
- package/package.json +2 -2
- package/runtime/App.js +12 -122
- package/runtime/App.js.map +1 -1
- package/runtime/base-page.component.js +2 -11
- package/runtime/base-page.component.js.map +1 -1
- package/styles/theme.js +6 -0
- package/styles/theme.js.map +1 -1
- package/core/advanced-promise-rejection-tracker.js +0 -208
- package/core/advanced-promise-rejection-tracker.js.map +0 -1
- package/core/global-error-handler.service.js +0 -103
- package/core/global-error-handler.service.js.map +0 -1
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global Error Handler Service for WaveMaker Runtime
|
|
3
|
-
*
|
|
4
|
-
* This service provides comprehensive error handling for React Native applications:
|
|
5
|
-
* 1. JavaScript Error Handling: Uses ErrorUtils.setGlobalHandler for sync errors
|
|
6
|
-
* 2. Promise Rejection Tracking: Multi-engine approach for unhandled promise rejections
|
|
7
|
-
* - Web: Uses browser's 'unhandledrejection' event
|
|
8
|
-
* - Hermes: Uses HermesInternal.enablePromiseRejectionTracker
|
|
9
|
-
* - JSC: Uses React Native's 'promise/setimmediate/rejection-tracking' module
|
|
10
|
-
*
|
|
11
|
-
* Key Features:
|
|
12
|
-
* - Catches ALL API call failures (fetch, axios, any HTTP library)
|
|
13
|
-
* - Handles async function errors and manual Promise.reject calls
|
|
14
|
-
* - Automatic engine detection and optimal method selection
|
|
15
|
-
* - Production-ready with proper cleanup mechanisms
|
|
16
|
-
* - Configurable suppression of React Native's default error screens
|
|
17
|
-
*
|
|
18
|
-
* Research Background:
|
|
19
|
-
* This implementation was developed after extensive research into React Native's
|
|
20
|
-
* error handling mechanisms across different JavaScript engines. It addresses
|
|
21
|
-
* the common problem where API call failures and async errors are not caught
|
|
22
|
-
* by standard error boundaries, providing a unified solution for all error types.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import { Platform } from 'react-native';
|
|
26
|
-
import { isWebPreviewMode } from './utils';
|
|
27
|
-
import { setupAdvancedPromiseRejectionTracking } from './advanced-promise-rejection-tracker';
|
|
28
|
-
let globalErrorHandler = null;
|
|
29
|
-
let promiseRejectionTracker = null;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Sets up global error handling for JavaScript errors and unhandled promise rejections
|
|
33
|
-
* @param onError Callback function to handle errors
|
|
34
|
-
* @param suppressDefaultErrorScreen Whether to suppress React Native's default error screen
|
|
35
|
-
* @returns Cleanup function to remove the error handlers
|
|
36
|
-
*/
|
|
37
|
-
export const setupGlobalErrorHandler = (onError, suppressDefaultErrorScreen = false) => {
|
|
38
|
-
let originalHandler = null;
|
|
39
|
-
const ErrorUtilsRef = globalThis === null || globalThis === void 0 ? void 0 : globalThis.ErrorUtils;
|
|
40
|
-
if (ErrorUtilsRef) {
|
|
41
|
-
var _ErrorUtilsRef$getGlo, _ErrorUtilsRef$setGlo;
|
|
42
|
-
// Store the original error handler to restore it later
|
|
43
|
-
originalHandler = ErrorUtilsRef === null || ErrorUtilsRef === void 0 || (_ErrorUtilsRef$getGlo = ErrorUtilsRef.getGlobalHandler) === null || _ErrorUtilsRef$getGlo === void 0 ? void 0 : _ErrorUtilsRef$getGlo.call(ErrorUtilsRef);
|
|
44
|
-
|
|
45
|
-
// Setup JavaScript error handler
|
|
46
|
-
globalErrorHandler = (error, isFatal = false) => {
|
|
47
|
-
const errorInfo = __DEV__ ? `${error.stack || error.toString()}` : 'An unexpected error occurred';
|
|
48
|
-
|
|
49
|
-
// Call our custom error handler
|
|
50
|
-
onError(error, isFatal, errorInfo);
|
|
51
|
-
|
|
52
|
-
// Call the original handler for development/debugging if not suppressed
|
|
53
|
-
// This controls whether React Native's default red error screen is shown
|
|
54
|
-
if (originalHandler && __DEV__ && !suppressDefaultErrorScreen) {
|
|
55
|
-
originalHandler(error, isFatal);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Set our custom global error handler
|
|
60
|
-
ErrorUtilsRef === null || ErrorUtilsRef === void 0 || (_ErrorUtilsRef$setGlo = ErrorUtilsRef.setGlobalHandler) === null || _ErrorUtilsRef$setGlo === void 0 || _ErrorUtilsRef$setGlo.call(ErrorUtilsRef, globalErrorHandler);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Setup Advanced Promise Rejection Tracking
|
|
64
|
-
// This automatically detects the best method for the current JavaScript engine:
|
|
65
|
-
// - Web: Uses unhandledrejection event for complete coverage
|
|
66
|
-
// - Hermes: Uses HermesInternal.enablePromiseRejectionTracker for native tracking
|
|
67
|
-
// - JSC: Uses promise/setimmediate/rejection-tracking module for comprehensive handling
|
|
68
|
-
promiseRejectionTracker = setupAdvancedPromiseRejectionTracking(error => {
|
|
69
|
-
// Convert promise rejection to our error handler format
|
|
70
|
-
const promiseError = error instanceof Error ? error : new Error(String(error));
|
|
71
|
-
const errorInfo = __DEV__ ? `Promise rejection: ${promiseError.stack || promiseError.toString()}` : 'An unexpected error occurred';
|
|
72
|
-
|
|
73
|
-
// Call our custom error handler with promise-specific info
|
|
74
|
-
// This ensures API call failures and async errors trigger the same error flow
|
|
75
|
-
onError(promiseError, false, errorInfo);
|
|
76
|
-
});
|
|
77
|
-
return () => {
|
|
78
|
-
var _ErrorUtilsRef$setGlo2;
|
|
79
|
-
// Cleanup function - restores original error handling mechanisms
|
|
80
|
-
ErrorUtilsRef === null || ErrorUtilsRef === void 0 || (_ErrorUtilsRef$setGlo2 = ErrorUtilsRef.setGlobalHandler) === null || _ErrorUtilsRef$setGlo2 === void 0 || _ErrorUtilsRef$setGlo2.call(ErrorUtilsRef, originalHandler);
|
|
81
|
-
|
|
82
|
-
// Cleanup advanced promise rejection tracking
|
|
83
|
-
if (promiseRejectionTracker) {
|
|
84
|
-
promiseRejectionTracker.cleanup();
|
|
85
|
-
promiseRejectionTracker = null;
|
|
86
|
-
}
|
|
87
|
-
globalErrorHandler = null;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Get current error handling configuration and capabilities
|
|
93
|
-
* Useful for debugging and monitoring the error handling setup
|
|
94
|
-
*/
|
|
95
|
-
export const getErrorHandlingInfo = () => {
|
|
96
|
-
return {
|
|
97
|
-
platform: Platform.OS,
|
|
98
|
-
isWebPreview: isWebPreviewMode(),
|
|
99
|
-
hasPromiseTracking: promiseRejectionTracker !== null,
|
|
100
|
-
hasJavaScriptHandler: globalErrorHandler !== null
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
//# sourceMappingURL=global-error-handler.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","isWebPreviewMode","setupAdvancedPromiseRejectionTracking","globalErrorHandler","promiseRejectionTracker","setupGlobalErrorHandler","onError","suppressDefaultErrorScreen","originalHandler","ErrorUtilsRef","globalThis","ErrorUtils","_ErrorUtilsRef$getGlo","_ErrorUtilsRef$setGlo","getGlobalHandler","call","error","isFatal","errorInfo","__DEV__","stack","toString","setGlobalHandler","promiseError","Error","String","_ErrorUtilsRef$setGlo2","cleanup","getErrorHandlingInfo","platform","OS","isWebPreview","hasPromiseTracking","hasJavaScriptHandler"],"sources":["global-error-handler.service.ts"],"sourcesContent":["/**\n * Global Error Handler Service for WaveMaker Runtime\n *\n * This service provides comprehensive error handling for React Native applications:\n * 1. JavaScript Error Handling: Uses ErrorUtils.setGlobalHandler for sync errors\n * 2. Promise Rejection Tracking: Multi-engine approach for unhandled promise rejections\n * - Web: Uses browser's 'unhandledrejection' event\n * - Hermes: Uses HermesInternal.enablePromiseRejectionTracker\n * - JSC: Uses React Native's 'promise/setimmediate/rejection-tracking' module\n *\n * Key Features:\n * - Catches ALL API call failures (fetch, axios, any HTTP library)\n * - Handles async function errors and manual Promise.reject calls\n * - Automatic engine detection and optimal method selection\n * - Production-ready with proper cleanup mechanisms\n * - Configurable suppression of React Native's default error screens\n *\n * Research Background:\n * This implementation was developed after extensive research into React Native's\n * error handling mechanisms across different JavaScript engines. It addresses\n * the common problem where API call failures and async errors are not caught\n * by standard error boundaries, providing a unified solution for all error types.\n */\n\nimport { Platform } from 'react-native';\nimport { isWebPreviewMode } from './utils';\nimport {\n setupAdvancedPromiseRejectionTracking,\n AdvancedPromiseRejectionTracker,\n} from './advanced-promise-rejection-tracker';\n\nexport interface GlobalErrorState {\n error: Error;\n errorInfo: string;\n errorType: 'javascript';\n isFatal?: boolean;\n}\n\nexport type GlobalErrorCallback = (\n error: Error,\n isFatal: boolean,\n errorInfo: string\n) => void;\n\nlet globalErrorHandler: ((error: any, isFatal?: boolean) => void) | null = null;\nlet promiseRejectionTracker: AdvancedPromiseRejectionTracker | null = null;\n\n/**\n * Sets up global error handling for JavaScript errors and unhandled promise rejections\n * @param onError Callback function to handle errors\n * @param suppressDefaultErrorScreen Whether to suppress React Native's default error screen\n * @returns Cleanup function to remove the error handlers\n */\nexport const setupGlobalErrorHandler = (\n onError: GlobalErrorCallback,\n suppressDefaultErrorScreen: boolean = false\n): (() => void) => {\n let originalHandler: any = null;\n const ErrorUtilsRef = (globalThis as any)?.ErrorUtils;\n if (ErrorUtilsRef) {\n // Store the original error handler to restore it later\n originalHandler = ErrorUtilsRef?.getGlobalHandler?.();\n\n // Setup JavaScript error handler\n globalErrorHandler = (error: any, isFatal: boolean = false) => {\n const errorInfo = __DEV__\n ? `${error.stack || error.toString()}`\n : 'An unexpected error occurred';\n\n // Call our custom error handler\n onError(error, isFatal, errorInfo);\n\n // Call the original handler for development/debugging if not suppressed\n // This controls whether React Native's default red error screen is shown\n if (originalHandler && __DEV__ && !suppressDefaultErrorScreen) {\n originalHandler(error, isFatal);\n }\n };\n\n // Set our custom global error handler\n ErrorUtilsRef?.setGlobalHandler?.(globalErrorHandler);\n }\n\n // Setup Advanced Promise Rejection Tracking\n // This automatically detects the best method for the current JavaScript engine:\n // - Web: Uses unhandledrejection event for complete coverage\n // - Hermes: Uses HermesInternal.enablePromiseRejectionTracker for native tracking\n // - JSC: Uses promise/setimmediate/rejection-tracking module for comprehensive handling\n promiseRejectionTracker = setupAdvancedPromiseRejectionTracking(\n (error: any) => {\n // Convert promise rejection to our error handler format\n const promiseError =\n error instanceof Error ? error : new Error(String(error));\n const errorInfo = __DEV__\n ? `Promise rejection: ${promiseError.stack || promiseError.toString()}`\n : 'An unexpected error occurred';\n\n // Call our custom error handler with promise-specific info\n // This ensures API call failures and async errors trigger the same error flow\n onError(promiseError, false, errorInfo);\n }\n );\n\n return () => {\n // Cleanup function - restores original error handling mechanisms\n ErrorUtilsRef?.setGlobalHandler?.(originalHandler);\n\n // Cleanup advanced promise rejection tracking\n if (promiseRejectionTracker) {\n promiseRejectionTracker.cleanup();\n promiseRejectionTracker = null;\n }\n\n globalErrorHandler = null;\n };\n};\n\n/**\n * Get current error handling configuration and capabilities\n * Useful for debugging and monitoring the error handling setup\n */\nexport const getErrorHandlingInfo = () => {\n return {\n platform: Platform.OS,\n isWebPreview: isWebPreviewMode(),\n hasPromiseTracking: promiseRejectionTracker !== null,\n hasJavaScriptHandler: globalErrorHandler !== null,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SACEC,qCAAqC,QAEhC,sCAAsC;AAe7C,IAAIC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