@expo/metro-runtime 3.1.3 → 3.2.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/README.md +1 -1
- package/build/async-require/fetchAsync.native.d.ts.map +1 -1
- package/build/async-require/fetchAsync.native.js +1 -2
- package/build/async-require/fetchAsync.native.js.map +1 -1
- package/build/async-require/fetchThenEval.web.d.ts.map +1 -1
- package/build/async-require/fetchThenEval.web.js +15 -4
- package/build/async-require/fetchThenEval.web.js.map +1 -1
- package/build/async-require/loadBundle.d.ts.map +1 -1
- package/build/async-require/loadBundle.js +2 -3
- package/build/async-require/loadBundle.js.map +1 -1
- package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
- package/build/error-overlay/Data/LogBoxData.js +2 -1
- package/build/error-overlay/Data/LogBoxData.js.map +1 -1
- package/build/error-overlay/Data/LogContext.d.ts.map +1 -1
- package/build/error-overlay/Data/LogContext.js +1 -2
- package/build/error-overlay/Data/LogContext.js.map +1 -1
- package/build/error-overlay/UI/constants.d.ts.map +1 -1
- package/build/error-overlay/UI/constants.js +8 -6
- package/build/error-overlay/UI/constants.js.map +1 -1
- package/build/error-overlay/index.d.ts.map +1 -1
- package/build/error-overlay/index.js +5 -9
- package/build/error-overlay/index.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts +7 -0
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +8 -7
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
- package/build/error-overlay/toast/ErrorToast.js.map +1 -1
- package/package.json +2 -2
- package/src/async-require/fetchAsync.native.ts +1 -2
- package/src/async-require/fetchThenEval.web.ts +16 -2
- package/src/async-require/loadBundle.ts +2 -3
- package/src/error-overlay/Data/LogBoxData.tsx +2 -0
- package/src/error-overlay/Data/LogContext.tsx +1 -2
- package/src/error-overlay/UI/constants.ts +9 -7
- package/src/error-overlay/index.tsx +7 -12
- package/src/error-overlay/overlay/LogBoxInspectorFooter.tsx +2 -2
- package/src/error-overlay/overlay/LogBoxInspectorHeader.tsx +1 -1
- package/src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx +3 -0
- package/src/error-overlay/toast/ErrorToast.tsx +2 -2
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ yarn add @expo/metro-runtime
|
|
|
13
13
|
Import this somewhere in the initial bundle. For example, the `App.js`:
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
|
-
import '@expo/metro-
|
|
16
|
+
import '@expo/metro-runtime';
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
`expo/metro-config` will automatically move this import to be first in the bundle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAsync.native.d.ts","sourceRoot":"","sources":["../../src/async-require/fetchAsync.native.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"fetchAsync.native.d.ts","sourceRoot":"","sources":["../../src/async-require/fetchAsync.native.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,CA2D5E"}
|
|
@@ -11,7 +11,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.fetchAsync = void 0;
|
|
14
|
-
const react_native_1 = require("react-native");
|
|
15
14
|
// @ts-expect-error
|
|
16
15
|
const RCTNetworking_1 = __importDefault(require("react-native/Libraries/Network/RCTNetworking"));
|
|
17
16
|
function fetchAsync(url) {
|
|
@@ -46,7 +45,7 @@ function fetchAsync(url) {
|
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
RCTNetworking_1.default.sendRequest('GET', 'asyncRequest', url, {
|
|
49
|
-
'expo-platform':
|
|
48
|
+
'expo-platform': process.env.EXPO_OS,
|
|
50
49
|
}, '', 'text', false, 0, (requestId) => {
|
|
51
50
|
id = requestId;
|
|
52
51
|
}, true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAsync.native.js","sourceRoot":"","sources":["../../src/async-require/fetchAsync.native.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAEH
|
|
1
|
+
{"version":3,"file":"fetchAsync.native.js","sourceRoot":"","sources":["../../src/async-require/fetchAsync.native.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAEH,mBAAmB;AACnB,iGAAsE;AAItE,SAAgB,UAAU,CACxB,GAAW;IAEX,IAAI,EAAE,GAAkB,IAAI,CAAC;IAC7B,IAAI,UAAU,GAAkB,IAAI,CAAC;IACrC,IAAI,YAAY,GAAkB,IAAI,CAAC;IACvC,IAAI,OAAO,GAA2B,EAAE,CAAC;IACzC,IAAI,YAAY,GAAsB,IAAI,CAAC;IAC3C,IAAI,gBAAgB,GAAsB,IAAI,CAAC;IAC/C,IAAI,gBAAgB,GAAsB,IAAI,CAAC;IAC/C,OAAO,IAAI,OAAO,CAChB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAClB,MAAM,WAAW,GAAG,uBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,uBAAU,CAG3C,CAAC;QAChB,YAAY,GAAG,WAAW,CAAC,uBAAuB,EAAE,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,EAAE;YAC5E,IAAI,SAAS,KAAK,EAAE,EAAE;gBACpB,YAAY,GAAG,QAAQ,CAAC;aACzB;QACH,CAAC,CAAC,CAAC;QACH,gBAAgB,GAAG,WAAW,CAC5B,2BAA2B,EAC3B,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,EAAE;YACvC,IAAI,SAAS,KAAK,EAAE,EAAE;gBACpB,UAAU,GAAG,MAAM,CAAC;gBACpB,OAAO,GAAG,eAAe,CAAC;aAC3B;QACH,CAAC,CACF,CAAC;QACF,gBAAgB,GAAG,WAAW,CAAC,4BAA4B,EAAE,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE;YAClF,IAAI,SAAS,KAAK,EAAE,EAAE;gBACpB,IAAI,KAAK,EAAE;oBACT,MAAM,CAAC,KAAK,CAAC,CAAC;iBACf;qBAAM;oBACL,OAAO,CAAC,EAAE,IAAI,EAAE,YAAa,EAAE,MAAM,EAAE,UAAW,EAAE,OAAO,EAAE,CAAC,CAAC;iBAChE;aACF;QACH,CAAC,CAAC,CAAC;QACF,uBAAU,CAAC,WAAmB,CAC7B,KAAK,EACL,cAAc,EACd,GAAG,EACH;YACE,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;SACrC,EACD,EAAE,EACF,MAAM,EACN,KAAK,EACL,CAAC,EACD,CAAC,SAAiB,EAAE,EAAE;YACpB,EAAE,GAAG,SAAS,CAAC;QACjB,CAAC,EACD,IAAI,CACL,CAAC;IACJ,CAAC,CACF,CAAC,OAAO,CAAC,GAAG,EAAE;QACb,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC;AA7DD,gCA6DC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// @ts-expect-error\nimport Networking from 'react-native/Libraries/Network/RCTNetworking';\n\ntype Subscriber = { remove: () => void };\n\nexport function fetchAsync(\n url: string\n): Promise<{ body: string; status: number; headers: Record<string, string> }> {\n let id: string | null = null;\n let statusCode: number | null = null;\n let responseText: string | null = null;\n let headers: Record<string, string> = {};\n let dataListener: Subscriber | null = null;\n let completeListener: Subscriber | null = null;\n let responseListener: Subscriber | null = null;\n return new Promise<{ body: string; status: number; headers: Record<string, string> }>(\n (resolve, reject) => {\n const addListener = Networking.addListener.bind(Networking) as (\n event: string,\n callback: (props: [string, any, any]) => any\n ) => Subscriber;\n dataListener = addListener('didReceiveNetworkData', ([requestId, response]) => {\n if (requestId === id) {\n responseText = response;\n }\n });\n responseListener = addListener(\n 'didReceiveNetworkResponse',\n ([requestId, status, responseHeaders]) => {\n if (requestId === id) {\n statusCode = status;\n headers = responseHeaders;\n }\n }\n );\n completeListener = addListener('didCompleteNetworkResponse', ([requestId, error]) => {\n if (requestId === id) {\n if (error) {\n reject(error);\n } else {\n resolve({ body: responseText!, status: statusCode!, headers });\n }\n }\n });\n (Networking.sendRequest as any)(\n 'GET',\n 'asyncRequest',\n url,\n {\n 'expo-platform': process.env.EXPO_OS,\n },\n '',\n 'text',\n false,\n 0,\n (requestId: string) => {\n id = requestId;\n },\n true\n );\n }\n ).finally(() => {\n dataListener?.remove();\n completeListener?.remove();\n responseListener?.remove();\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchThenEval.web.d.ts","sourceRoot":"","sources":["../../src/async-require/fetchThenEval.web.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"fetchThenEval.web.d.ts","sourceRoot":"","sources":["../../src/async-require/fetchThenEval.web.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,EACE,UAAU,EACV,KAAK,EACL,WAAW,GACZ,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACpE,OAAO,CAAC,IAAI,CAAC,CAyDf"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchThenEvalAsync = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* Copyright © 2022 650 Industries.
|
|
6
4
|
*
|
|
7
5
|
* This source code is licensed under the MIT license found in the
|
|
8
6
|
* LICENSE file in the root directory of this source tree.
|
|
9
7
|
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.fetchThenEvalAsync = void 0;
|
|
10
|
+
const currentSrc = typeof document !== 'undefined' && document.currentScript
|
|
11
|
+
? ('src' in document.currentScript && document.currentScript.src) || null
|
|
12
|
+
: null;
|
|
10
13
|
// Basically `__webpack_require__.l`.
|
|
11
14
|
function fetchThenEvalAsync(url, { scriptType, nonce, crossOrigin, } = {}) {
|
|
12
|
-
if (typeof
|
|
15
|
+
if (typeof window === 'undefined') {
|
|
13
16
|
return require('./fetchThenEvalJs').fetchThenEvalAsync(url);
|
|
14
17
|
}
|
|
15
18
|
return new Promise((resolve, reject) => {
|
|
@@ -53,7 +56,15 @@ function fetchThenEvalAsync(url, { scriptType, nonce, crossOrigin, } = {}) {
|
|
|
53
56
|
script.parentNode && script.parentNode.removeChild(script);
|
|
54
57
|
reject(error);
|
|
55
58
|
};
|
|
56
|
-
|
|
59
|
+
if (script.src === currentSrc) {
|
|
60
|
+
// NOTE(kitten): We always prevent `fetchThenEval` from loading the "current script".
|
|
61
|
+
// This points at our entrypoint bundle, and we should never reload and reevaluate the
|
|
62
|
+
// entrypoint bundle
|
|
63
|
+
resolve();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
document.head.appendChild(script);
|
|
67
|
+
}
|
|
57
68
|
});
|
|
58
69
|
}
|
|
59
70
|
exports.fetchThenEvalAsync = fetchThenEvalAsync;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchThenEval.web.js","sourceRoot":"","sources":["../../src/async-require/fetchThenEval.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchThenEval.web.js","sourceRoot":"","sources":["../../src/async-require/fetchThenEval.web.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,MAAM,UAAU,GACd,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,CAAC,aAAa;IACvD,CAAC,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,aAAa,IAAI,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,IAAI;IACzE,CAAC,CAAC,IAAI,CAAC;AAEX,qCAAqC;AACrC,SAAgB,kBAAkB,CAChC,GAAW,EACX,EACE,UAAU,EACV,KAAK,EACL,WAAW,MACsD,EAAE;IAErE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,OAAO,CAAC,mBAAmB,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;KAC7D;IACD,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,IAAI,UAAU;YAAE,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC;QACzC,IAAI,KAAK;YAAE,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC/C,+CAA+C;QAC/C,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;QAEjB,IAAI,WAAW,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;YACzE,MAAM,CAAC,WAAW,GAAG,WA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ACX;aAAM;YACL,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACnC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAhED,gDAgEC;AAED,MAAM,iBAAkB,SAAQ,KAAK;IAC1B,IAAI,GAAG,mBAAmB,CAAC;IACpC,IAAI,CAAU;IACd,OAAO,CAAU;CAClB","sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nconst currentSrc =\n typeof document !== 'undefined' && document.currentScript\n ? ('src' in document.currentScript && document.currentScript.src) || null\n : null;\n\n// Basically `__webpack_require__.l`.\nexport function fetchThenEvalAsync(\n url: string,\n {\n scriptType,\n nonce,\n crossOrigin,\n }: { scriptType?: string; nonce?: string; crossOrigin?: string } = {}\n): Promise<void> {\n if (typeof window === 'undefined') {\n return require('./fetchThenEvalJs').fetchThenEvalAsync(url);\n }\n return new Promise<void>((resolve, reject) => {\n const script = document.createElement('script');\n if (scriptType) script.type = scriptType;\n if (nonce) script.setAttribute('nonce', nonce);\n // script.setAttribute('data-expo-metro', ...);\n script.src = url;\n\n if (crossOrigin && script.src.indexOf(window.location.origin + '/') !== 0) {\n script.crossOrigin = crossOrigin;\n }\n\n script.onload = () => {\n script.parentNode && script.parentNode.removeChild(script);\n resolve();\n };\n // Create a new error object to preserve the original stack trace.\n const error = new AsyncRequireError();\n\n // Server error or network error.\n script.onerror = (ev) => {\n let event: Event;\n if (typeof ev === 'string') {\n event = {\n type: 'error',\n target: {\n // @ts-expect-error\n src: event,\n },\n };\n } else {\n event = ev;\n }\n\n const errorType = event && (event.type === 'load' ? 'missing' : event.type);\n // @ts-expect-error\n const realSrc = event?.target?.src;\n error.message = 'Loading module ' + url + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n error.type = errorType;\n error.request = realSrc;\n\n script.parentNode && script.parentNode.removeChild(script);\n reject(error);\n };\n\n if (script.src === currentSrc) {\n // NOTE(kitten): We always prevent `fetchThenEval` from loading the \"current script\".\n // This points at our entrypoint bundle, and we should never reload and reevaluate the\n // entrypoint bundle\n resolve();\n } else {\n document.head.appendChild(script);\n }\n });\n}\n\nclass AsyncRequireError extends Error {\n readonly name = 'AsyncRequireError';\n type?: string;\n request?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadBundle.d.ts","sourceRoot":"","sources":["../../src/async-require/loadBundle.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"loadBundle.d.ts","sourceRoot":"","sources":["../../src/async-require/loadBundle.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBvE"}
|
|
@@ -21,10 +21,9 @@ async function loadBundleAsync(bundlePath) {
|
|
|
21
21
|
return (0, fetchThenEval_1.fetchThenEvalAsync)(requestUrl);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
const Platform = require('react-native').Platform;
|
|
25
24
|
const LoadingView = require('../LoadingView')
|
|
26
25
|
.default;
|
|
27
|
-
if (
|
|
26
|
+
if (process.env.EXPO_OS !== 'web') {
|
|
28
27
|
// Send a signal to the `expo` package to show the loading indicator.
|
|
29
28
|
LoadingView.showMessage('Downloading...', 'load');
|
|
30
29
|
}
|
|
@@ -35,7 +34,7 @@ async function loadBundleAsync(bundlePath) {
|
|
|
35
34
|
HMRClient.registerBundle(requestUrl);
|
|
36
35
|
})
|
|
37
36
|
.finally(() => {
|
|
38
|
-
if (!--pendingRequests &&
|
|
37
|
+
if (!--pendingRequests && process.env.EXPO_OS !== 'web') {
|
|
39
38
|
LoadingView.hide();
|
|
40
39
|
}
|
|
41
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadBundle.js","sourceRoot":"","sources":["../../src/async-require/loadBundle.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2DAAwD;AACxD,mDAAqD;AAErD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB;;;;GAIG;AACI,KAAK,UAAU,eAAe,CAAC,UAAkB;IACtD,MAAM,UAAU,GAAG,IAAA,qCAAiB,EAAC,UAAU,CAAC,CAAC;IAEjD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,OAAO,IAAA,kCAAkB,EAAC,UAAU,CAAC,CAAC;KACvC;SAAM;QACL,MAAM,
|
|
1
|
+
{"version":3,"file":"loadBundle.js","sourceRoot":"","sources":["../../src/async-require/loadBundle.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2DAAwD;AACxD,mDAAqD;AAErD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB;;;;GAIG;AACI,KAAK,UAAU,eAAe,CAAC,UAAkB;IACtD,MAAM,UAAU,GAAG,IAAA,qCAAiB,EAAC,UAAU,CAAC,CAAC;IAEjD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,OAAO,IAAA,kCAAkB,EAAC,UAAU,CAAC,CAAC;KACvC;SAAM;QACL,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;aAC1C,OAAkD,CAAC;QACtD,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE;YACjC,qEAAqE;YACrE,WAAW,CAAC,WAAW,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;SACnD;QACD,eAAe,EAAE,CAAC;QAElB,OAAO,IAAA,kCAAkB,EAAC,UAAU,CAAC;aAClC,IAAI,CAAC,GAAG,EAAE;YACT,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,OAAgD,CAAC;YAC3F,SAAS,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,EAAE,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE;gBACvD,WAAW,CAAC,IAAI,EAAE,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;KACN;AACH,CAAC;AAzBD,0CAyBC","sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { buildUrlForBundle } from './buildUrlForBundle';\nimport { fetchThenEvalAsync } from './fetchThenEval';\n\nlet pendingRequests = 0;\n\n/**\n * Load a bundle for a URL using fetch + eval on native and script tag injection on web.\n *\n * @param bundlePath Given a statement like `import('./Bacon')` `bundlePath` would be `Bacon.bundle?params=from-metro`.\n */\nexport async function loadBundleAsync(bundlePath: string): Promise<void> {\n const requestUrl = buildUrlForBundle(bundlePath);\n\n if (process.env.NODE_ENV === 'production') {\n return fetchThenEvalAsync(requestUrl);\n } else {\n const LoadingView = require('../LoadingView')\n .default as typeof import('../LoadingView').default;\n if (process.env.EXPO_OS !== 'web') {\n // Send a signal to the `expo` package to show the loading indicator.\n LoadingView.showMessage('Downloading...', 'load');\n }\n pendingRequests++;\n\n return fetchThenEvalAsync(requestUrl)\n .then(() => {\n const HMRClient = require('../HMRClient').default as typeof import('../HMRClient').default;\n HMRClient.registerBundle(requestUrl);\n })\n .finally(() => {\n if (!--pendingRequests && process.env.EXPO_OS !== 'web') {\n LoadingView.hide();\n }\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxData.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogBoxData.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"LogBoxData.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogBoxData.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH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AC,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAiF5F"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) 650 Industries.
|
|
4
3
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -6,6 +5,8 @@
|
|
|
6
5
|
* This source code is licensed under the MIT license found in the
|
|
7
6
|
* LICENSE file in the root directory of this source tree.
|
|
8
7
|
*/
|
|
8
|
+
'use client';
|
|
9
|
+
"use strict";
|
|
9
10
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
11
|
if (k2 === undefined) k2 = k;
|
|
11
12
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxData.js","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogBoxData.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,2CAAmD;AAEnD,6CAA0C;AAC1C,qDAAwD;AAExD,2EAAmD;AACnD,iFAAyD;AA8CzD,MAAM,SAAS,GAAsC,IAAI,GAAG,EAAE,CAAC;AAC/D,MAAM,cAAc,GAAuB,IAAI,GAAG,EAAE,CAAC;AACrD,IAAI,IAAI,GAAe,IAAI,GAAG,EAAE,CAAC;AACjC,IAAI,aAAa,GAA2E,IAAI,CAAC;AACjG,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB,IAAI,cAAc,GAAG,CAAC,CAAC,CAAC;AAExB,MAAM,oBAAoB,GACxB,wEAAwE,CAAC;AAE3E,SAAS,YAAY;IACnB,OAAO;QACL,IAAI;QACJ,UAAU,EAAE,WAAW;QACvB,gBAAgB,EAAE,cAAc;KACjC,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAC,KAAoB,EAAE,cAAuB;IAC7E,MAAM,iBAAiB,GAA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C,CAAC;KACH;IAED,mBAAmB;IACnB,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAjFD,4CAiFC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport * as React from 'react';\n\nimport { LogBoxLog, StackType } from './LogBoxLog';\nimport type { LogLevel } from './LogBoxLog';\nimport { LogContext } from './LogContext';\nimport { parseLogBoxException } from './parseLogBoxLog';\nimport type { Message, Category, ComponentStack, ExtendedExceptionData } from './parseLogBoxLog';\nimport NativeLogBox from '../modules/NativeLogBox';\nimport parseErrorStack from '../modules/parseErrorStack';\n\nexport type LogBoxLogs = Set<LogBoxLog>;\n\nexport type LogData = {\n level: LogLevel;\n message: Message;\n category: Category;\n componentStack: ComponentStack;\n};\n\ntype ExtendedError = any;\n\nexport type Observer = (options: {\n logs: LogBoxLogs;\n isDisabled: boolean;\n selectedLogIndex: number;\n}) => void;\n\nexport type IgnorePattern = string | RegExp;\n\nexport type Subscription = {\n unsubscribe: () => void;\n};\n\nexport type WarningInfo = {\n finalFormat: string;\n forceDialogImmediately: boolean;\n suppressDialog_LEGACY: boolean;\n suppressCompletely: boolean;\n monitorEvent: string | null;\n monitorListVersion: number;\n monitorSampleRate: number;\n};\n\nexport type WarningFilter = (format: string) => WarningInfo;\n\ntype Props = object;\n\ntype State = {\n logs: LogBoxLogs;\n isDisabled: boolean;\n hasError: boolean;\n selectedLogIndex: number;\n};\n\nconst observers: Set<{ observer: Observer } & any> = new Set();\nconst ignorePatterns: Set<IgnorePattern> = new Set();\nlet logs: LogBoxLogs = new Set();\nlet updateTimeout: null | ReturnType<typeof setImmediate> | ReturnType<typeof setTimeout> = null;\nlet _isDisabled = false;\nlet _selectedIndex = -1;\n\nconst LOGBOX_ERROR_MESSAGE =\n 'An error was thrown when attempting to render log messages via LogBox.';\n\nfunction getNextState() {\n return {\n logs,\n isDisabled: _isDisabled,\n selectedLogIndex: _selectedIndex,\n };\n}\n\nexport function reportLogBoxError(error: ExtendedError, componentStack?: string): void {\n const ExceptionsManager = require('../modules/ExceptionsManager').default;\n\n if (componentStack != null) {\n error.componentStack = componentStack;\n }\n ExceptionsManager.handleException(error);\n}\n\nexport function reportUnexpectedLogBoxError(error: ExtendedError, componentStack?: string): void {\n error.message = `${LOGBOX_ERROR_MESSAGE}\\n\\n${error.message}`;\n return reportLogBoxError(error, componentStack);\n}\n\nexport function isLogBoxErrorMessage(message: string): boolean {\n return typeof message === 'string' && message.includes(LOGBOX_ERROR_MESSAGE);\n}\n\nexport function isMessageIgnored(message: string): boolean {\n for (const pattern of ignorePatterns) {\n if (\n (pattern instanceof RegExp && pattern.test(message)) ||\n (typeof pattern === 'string' && message.includes(pattern))\n ) {\n return true;\n }\n }\n return false;\n}\n\nfunction setImmediateShim(callback: () => void) {\n if (!global.setImmediate) {\n return setTimeout(callback, 0);\n }\n return global.setImmediate(callback);\n}\n\nfunction handleUpdate(): void {\n if (updateTimeout == null) {\n updateTimeout = setImmediateShim(() => {\n updateTimeout = null;\n const nextState = getNextState();\n observers.forEach(({ observer }) => observer(nextState));\n });\n }\n}\n\nfunction appendNewLog(newLog: LogBoxLog): void {\n // Don't want store these logs because they trigger a\n // state update when we add them to the store.\n if (isMessageIgnored(newLog.message.content)) {\n return;\n }\n\n // If the next log has the same category as the previous one\n // then roll it up into the last log in the list by incrementing\n // the count (similar to how Chrome does it).\n const lastLog = Array.from(logs).pop();\n if (lastLog && lastLog.category === newLog.category) {\n lastLog.incrementCount();\n handleUpdate();\n return;\n }\n\n if (newLog.level === 'fatal') {\n // If possible, to avoid jank, we don't want to open the error before\n // it's symbolicated. To do that, we optimistically wait for\n // symbolication for up to a second before adding the log.\n const OPTIMISTIC_WAIT_TIME = 1000;\n\n let addPendingLog: null | (() => void) = () => {\n logs.add(newLog);\n if (_selectedIndex < 0) {\n setSelectedLog(logs.size - 1);\n } else {\n handleUpdate();\n }\n addPendingLog = null;\n };\n\n const optimisticTimeout = setTimeout(() => {\n if (addPendingLog) {\n addPendingLog();\n }\n }, OPTIMISTIC_WAIT_TIME);\n\n // TODO: HANDLE THIS\n newLog.symbolicate('component');\n\n newLog.symbolicate('stack', (status) => {\n if (addPendingLog && status !== 'PENDING') {\n addPendingLog();\n clearTimeout(optimisticTimeout);\n } else if (status !== 'PENDING') {\n // The log has already been added but we need to trigger a render.\n handleUpdate();\n }\n });\n } else if (newLog.level === 'syntax') {\n logs.add(newLog);\n setSelectedLog(logs.size - 1);\n } else {\n logs.add(newLog);\n handleUpdate();\n }\n}\n\nexport function addLog(log: LogData): void {\n const errorForStackTrace = new Error();\n\n // Parsing logs are expensive so we schedule this\n // otherwise spammy logs would pause rendering.\n setImmediate(() => {\n try {\n const stack = parseErrorStack(errorForStackTrace?.stack);\n\n appendNewLog(\n new LogBoxLog({\n level: log.level,\n message: log.message,\n isComponentError: false,\n stack,\n category: log.category,\n componentStack: log.componentStack,\n })\n );\n } catch (error) {\n reportUnexpectedLogBoxError(error);\n }\n });\n}\n\nexport function addException(error: ExtendedExceptionData): void {\n // Parsing logs are expensive so we schedule this\n // otherwise spammy logs would pause rendering.\n setImmediate(() => {\n try {\n appendNewLog(new LogBoxLog(parseLogBoxException(error)));\n } catch (loggingError) {\n reportUnexpectedLogBoxError(loggingError);\n }\n });\n}\n\nexport function symbolicateLogNow(type: StackType, log: LogBoxLog) {\n log.symbolicate(type, () => {\n handleUpdate();\n });\n}\n\nexport function retrySymbolicateLogNow(type: StackType, log: LogBoxLog) {\n log.retrySymbolicate(type, () => {\n handleUpdate();\n });\n}\n\nexport function symbolicateLogLazy(type: StackType, log: LogBoxLog) {\n log.symbolicate(type);\n}\n\nexport function clear(): void {\n if (logs.size > 0) {\n logs = new Set();\n setSelectedLog(-1);\n }\n}\n\nexport function setSelectedLog(proposedNewIndex: number): void {\n const oldIndex = _selectedIndex;\n let newIndex = proposedNewIndex;\n\n const logArray = Array.from(logs);\n let index = logArray.length - 1;\n while (index >= 0) {\n // The latest syntax error is selected and displayed before all other logs.\n if (logArray[index].level === 'syntax') {\n newIndex = index;\n break;\n }\n index -= 1;\n }\n _selectedIndex = newIndex;\n handleUpdate();\n if (NativeLogBox) {\n setTimeout(() => {\n if (oldIndex < 0 && newIndex >= 0) {\n NativeLogBox.show();\n } else if (oldIndex >= 0 && newIndex < 0) {\n NativeLogBox.hide();\n }\n }, 0);\n }\n}\n\nexport function clearWarnings(): void {\n const newLogs = Array.from(logs).filter((log) => log.level !== 'warn');\n if (newLogs.length !== logs.size) {\n logs = new Set(newLogs);\n setSelectedLog(-1);\n handleUpdate();\n }\n}\n\nexport function clearErrors(): void {\n const newLogs = Array.from(logs).filter((log) => log.level !== 'error' && log.level !== 'fatal');\n if (newLogs.length !== logs.size) {\n logs = new Set(newLogs);\n setSelectedLog(-1);\n }\n}\n\nexport function dismiss(log: LogBoxLog): void {\n if (logs.has(log)) {\n logs.delete(log);\n handleUpdate();\n }\n}\n\nexport function getIgnorePatterns(): IgnorePattern[] {\n return Array.from(ignorePatterns);\n}\n\nexport function addIgnorePatterns(patterns: IgnorePattern[]): void {\n const existingSize = ignorePatterns.size;\n // The same pattern may be added multiple times, but adding a new pattern\n // can be expensive so let's find only the ones that are new.\n patterns.forEach((pattern: IgnorePattern) => {\n if (pattern instanceof RegExp) {\n for (const existingPattern of ignorePatterns) {\n if (\n existingPattern instanceof RegExp &&\n existingPattern.toString() === pattern.toString()\n ) {\n return;\n }\n }\n ignorePatterns.add(pattern);\n }\n ignorePatterns.add(pattern);\n });\n if (ignorePatterns.size === existingSize) {\n return;\n }\n // We need to recheck all of the existing logs.\n // This allows adding an ignore pattern anywhere in the codebase.\n // Without this, if you ignore a pattern after the a log is created,\n // then we would keep showing the log.\n logs = new Set(Array.from(logs).filter((log) => !isMessageIgnored(log.message.content)));\n handleUpdate();\n}\n\nexport function setDisabled(value: boolean): void {\n if (value === _isDisabled) {\n return;\n }\n _isDisabled = value;\n handleUpdate();\n}\n\nexport function isDisabled(): boolean {\n return _isDisabled;\n}\n\nexport function observe(observer: Observer): Subscription {\n const subscription = { observer };\n observers.add(subscription);\n\n observer(getNextState());\n\n return {\n unsubscribe(): void {\n observers.delete(subscription);\n },\n };\n}\n\nexport function withSubscription(WrappedComponent: React.FC<object>): React.Component<object> {\n class LogBoxStateSubscription extends React.Component<React.PropsWithChildren<Props>, State> {\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(err: Error, errorInfo: { componentStack: string } & any) {\n /* $FlowFixMe[class-object-subtyping] added when improving typing for\n * this parameters */\n reportLogBoxError(err, errorInfo.componentStack);\n }\n\n _subscription?: Subscription;\n\n state = {\n logs: new Set<LogBoxLog>(),\n isDisabled: false,\n hasError: false,\n selectedLogIndex: -1,\n };\n\n render() {\n if (this.state.hasError) {\n // This happens when the component failed to render, in which case we delegate to the native redbox.\n // We can't show any fallback UI here, because the error may be with <View> or <Text>.\n return null;\n }\n\n return (\n <LogContext.Provider\n value={{\n selectedLogIndex: this.state.selectedLogIndex,\n isDisabled: this.state.isDisabled,\n logs: Array.from(this.state.logs),\n }}>\n {this.props.children}\n <WrappedComponent />\n </LogContext.Provider>\n );\n }\n\n componentDidMount(): void {\n this._subscription = observe((data) => {\n this.setState(data);\n });\n }\n\n componentWillUnmount(): void {\n if (this._subscription != null) {\n this._subscription.unsubscribe();\n }\n }\n\n _handleDismiss = (): void => {\n // Here we handle the cases when the log is dismissed and it\n // was either the last log, or when the current index\n // is now outside the bounds of the log array.\n const { selectedLogIndex, logs: stateLogs } = this.state;\n const logsArray = Array.from(stateLogs);\n if (selectedLogIndex != null) {\n if (logsArray.length - 1 <= 0) {\n setSelectedLog(-1);\n } else if (selectedLogIndex >= logsArray.length - 1) {\n setSelectedLog(selectedLogIndex - 1);\n }\n\n dismiss(logsArray[selectedLogIndex]);\n }\n };\n\n _handleMinimize = (): void => {\n setSelectedLog(-1);\n };\n\n _handleSetSelectedLog = (index: number): void => {\n setSelectedLog(index);\n };\n }\n\n // @ts-expect-error\n return LogBoxStateSubscription;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LogBoxData.js","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogBoxData.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,6CAA+B;AAE/B,2CAAmD;AAEnD,6CAA0C;AAC1C,qDAAwD;AAExD,2EAAmD;AACnD,iFAAyD;AA8CzD,MAAM,SAAS,GAAsC,IAAI,GAAG,EAAE,CAAC;AAC/D,MAAM,cAAc,GAAuB,IAAI,GAAG,EAAE,CAAC;AACrD,IAAI,IAAI,GAAe,IAAI,GAAG,EAAE,CAAC;AACjC,IAAI,aAAa,GAA2E,IAAI,CAAC;AACjG,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB,IAAI,cAAc,GAAG,CAAC,CAAC,CAAC;AAExB,MAAM,oBAAoB,GACxB,wEAAwE,CAAC;AAE3E,SAAS,YAAY;IACnB,OAAO;QACL,IAAI;QACJ,UAAU,EAAE,WAAW;QACvB,gBAAgB,EAAE,cAAc;KACjC,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAC,KAAoB,EAAE,cAAuB;IAC7E,MAAM,iBAAiB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC,OAAO,CAAC;IAE1E,IAAI,cAAc,IAAI,IAAI,EAAE;QAC1B,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;KACvC;IACD,iBAAiB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC;AAPD,8CAOC;AAED,SAAgB,2BAA2B,CAAC,KAAoB,EAAE,cAAuB;IACvF,KAAK,CAAC,OAAO,GAAG,GAAG,oBAAoB,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IAC9D,OAAO,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAClD,CAAC;AAHD,kEAGC;AAED,SAA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,WAAW,EAAE,CAAC;aAClC;QACH,CAAC;QAED,cAAc,GAAG,GAAS,EAAE;YAC1B,4DAA4D;YAC5D,qDAAqD;YACrD,8CAA8C;YAC9C,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YACzD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACxC,IAAI,gBAAgB,IAAI,IAAI,EAAE;gBAC5B,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE;oBAC7B,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;iBACpB;qBAAM,IAAI,gBAAgB,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;oBACnD,cAAc,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC;iBACtC;gBAED,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC;aACtC;QACH,CAAC,CAAC;QAEF,eAAe,GAAG,GAAS,EAAE;YAC3B,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC;QAEF,qBAAqB,GAAG,CAAC,KAAa,EAAQ,EAAE;YAC9C,cAAc,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC;KACH;IAED,mBAAmB;IACnB,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAjFD,4CAiFC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use client';\n\nimport * as React from 'react';\n\nimport { LogBoxLog, StackType } from './LogBoxLog';\nimport type { LogLevel } from './LogBoxLog';\nimport { LogContext } from './LogContext';\nimport { parseLogBoxException } from './parseLogBoxLog';\nimport type { Message, Category, ComponentStack, ExtendedExceptionData } from './parseLogBoxLog';\nimport NativeLogBox from '../modules/NativeLogBox';\nimport parseErrorStack from '../modules/parseErrorStack';\n\nexport type LogBoxLogs = Set<LogBoxLog>;\n\nexport type LogData = {\n level: LogLevel;\n message: Message;\n category: Category;\n componentStack: ComponentStack;\n};\n\ntype ExtendedError = any;\n\nexport type Observer = (options: {\n logs: LogBoxLogs;\n isDisabled: boolean;\n selectedLogIndex: number;\n}) => void;\n\nexport type IgnorePattern = string | RegExp;\n\nexport type Subscription = {\n unsubscribe: () => void;\n};\n\nexport type WarningInfo = {\n finalFormat: string;\n forceDialogImmediately: boolean;\n suppressDialog_LEGACY: boolean;\n suppressCompletely: boolean;\n monitorEvent: string | null;\n monitorListVersion: number;\n monitorSampleRate: number;\n};\n\nexport type WarningFilter = (format: string) => WarningInfo;\n\ntype Props = object;\n\ntype State = {\n logs: LogBoxLogs;\n isDisabled: boolean;\n hasError: boolean;\n selectedLogIndex: number;\n};\n\nconst observers: Set<{ observer: Observer } & any> = new Set();\nconst ignorePatterns: Set<IgnorePattern> = new Set();\nlet logs: LogBoxLogs = new Set();\nlet updateTimeout: null | ReturnType<typeof setImmediate> | ReturnType<typeof setTimeout> = null;\nlet _isDisabled = false;\nlet _selectedIndex = -1;\n\nconst LOGBOX_ERROR_MESSAGE =\n 'An error was thrown when attempting to render log messages via LogBox.';\n\nfunction getNextState() {\n return {\n logs,\n isDisabled: _isDisabled,\n selectedLogIndex: _selectedIndex,\n };\n}\n\nexport function reportLogBoxError(error: ExtendedError, componentStack?: string): void {\n const ExceptionsManager = require('../modules/ExceptionsManager').default;\n\n if (componentStack != null) {\n error.componentStack = componentStack;\n }\n ExceptionsManager.handleException(error);\n}\n\nexport function reportUnexpectedLogBoxError(error: ExtendedError, componentStack?: string): void {\n error.message = `${LOGBOX_ERROR_MESSAGE}\\n\\n${error.message}`;\n return reportLogBoxError(error, componentStack);\n}\n\nexport function isLogBoxErrorMessage(message: string): boolean {\n return typeof message === 'string' && message.includes(LOGBOX_ERROR_MESSAGE);\n}\n\nexport function isMessageIgnored(message: string): boolean {\n for (const pattern of ignorePatterns) {\n if (\n (pattern instanceof RegExp && pattern.test(message)) ||\n (typeof pattern === 'string' && message.includes(pattern))\n ) {\n return true;\n }\n }\n return false;\n}\n\nfunction setImmediateShim(callback: () => void) {\n if (!global.setImmediate) {\n return setTimeout(callback, 0);\n }\n return global.setImmediate(callback);\n}\n\nfunction handleUpdate(): void {\n if (updateTimeout == null) {\n updateTimeout = setImmediateShim(() => {\n updateTimeout = null;\n const nextState = getNextState();\n observers.forEach(({ observer }) => observer(nextState));\n });\n }\n}\n\nfunction appendNewLog(newLog: LogBoxLog): void {\n // Don't want store these logs because they trigger a\n // state update when we add them to the store.\n if (isMessageIgnored(newLog.message.content)) {\n return;\n }\n\n // If the next log has the same category as the previous one\n // then roll it up into the last log in the list by incrementing\n // the count (similar to how Chrome does it).\n const lastLog = Array.from(logs).pop();\n if (lastLog && lastLog.category === newLog.category) {\n lastLog.incrementCount();\n handleUpdate();\n return;\n }\n\n if (newLog.level === 'fatal') {\n // If possible, to avoid jank, we don't want to open the error before\n // it's symbolicated. To do that, we optimistically wait for\n // symbolication for up to a second before adding the log.\n const OPTIMISTIC_WAIT_TIME = 1000;\n\n let addPendingLog: null | (() => void) = () => {\n logs.add(newLog);\n if (_selectedIndex < 0) {\n setSelectedLog(logs.size - 1);\n } else {\n handleUpdate();\n }\n addPendingLog = null;\n };\n\n const optimisticTimeout = setTimeout(() => {\n if (addPendingLog) {\n addPendingLog();\n }\n }, OPTIMISTIC_WAIT_TIME);\n\n // TODO: HANDLE THIS\n newLog.symbolicate('component');\n\n newLog.symbolicate('stack', (status) => {\n if (addPendingLog && status !== 'PENDING') {\n addPendingLog();\n clearTimeout(optimisticTimeout);\n } else if (status !== 'PENDING') {\n // The log has already been added but we need to trigger a render.\n handleUpdate();\n }\n });\n } else if (newLog.level === 'syntax') {\n logs.add(newLog);\n setSelectedLog(logs.size - 1);\n } else {\n logs.add(newLog);\n handleUpdate();\n }\n}\n\nexport function addLog(log: LogData): void {\n const errorForStackTrace = new Error();\n\n // Parsing logs are expensive so we schedule this\n // otherwise spammy logs would pause rendering.\n setImmediate(() => {\n try {\n const stack = parseErrorStack(errorForStackTrace?.stack);\n\n appendNewLog(\n new LogBoxLog({\n level: log.level,\n message: log.message,\n isComponentError: false,\n stack,\n category: log.category,\n componentStack: log.componentStack,\n })\n );\n } catch (error) {\n reportUnexpectedLogBoxError(error);\n }\n });\n}\n\nexport function addException(error: ExtendedExceptionData): void {\n // Parsing logs are expensive so we schedule this\n // otherwise spammy logs would pause rendering.\n setImmediate(() => {\n try {\n appendNewLog(new LogBoxLog(parseLogBoxException(error)));\n } catch (loggingError) {\n reportUnexpectedLogBoxError(loggingError);\n }\n });\n}\n\nexport function symbolicateLogNow(type: StackType, log: LogBoxLog) {\n log.symbolicate(type, () => {\n handleUpdate();\n });\n}\n\nexport function retrySymbolicateLogNow(type: StackType, log: LogBoxLog) {\n log.retrySymbolicate(type, () => {\n handleUpdate();\n });\n}\n\nexport function symbolicateLogLazy(type: StackType, log: LogBoxLog) {\n log.symbolicate(type);\n}\n\nexport function clear(): void {\n if (logs.size > 0) {\n logs = new Set();\n setSelectedLog(-1);\n }\n}\n\nexport function setSelectedLog(proposedNewIndex: number): void {\n const oldIndex = _selectedIndex;\n let newIndex = proposedNewIndex;\n\n const logArray = Array.from(logs);\n let index = logArray.length - 1;\n while (index >= 0) {\n // The latest syntax error is selected and displayed before all other logs.\n if (logArray[index].level === 'syntax') {\n newIndex = index;\n break;\n }\n index -= 1;\n }\n _selectedIndex = newIndex;\n handleUpdate();\n if (NativeLogBox) {\n setTimeout(() => {\n if (oldIndex < 0 && newIndex >= 0) {\n NativeLogBox.show();\n } else if (oldIndex >= 0 && newIndex < 0) {\n NativeLogBox.hide();\n }\n }, 0);\n }\n}\n\nexport function clearWarnings(): void {\n const newLogs = Array.from(logs).filter((log) => log.level !== 'warn');\n if (newLogs.length !== logs.size) {\n logs = new Set(newLogs);\n setSelectedLog(-1);\n handleUpdate();\n }\n}\n\nexport function clearErrors(): void {\n const newLogs = Array.from(logs).filter((log) => log.level !== 'error' && log.level !== 'fatal');\n if (newLogs.length !== logs.size) {\n logs = new Set(newLogs);\n setSelectedLog(-1);\n }\n}\n\nexport function dismiss(log: LogBoxLog): void {\n if (logs.has(log)) {\n logs.delete(log);\n handleUpdate();\n }\n}\n\nexport function getIgnorePatterns(): IgnorePattern[] {\n return Array.from(ignorePatterns);\n}\n\nexport function addIgnorePatterns(patterns: IgnorePattern[]): void {\n const existingSize = ignorePatterns.size;\n // The same pattern may be added multiple times, but adding a new pattern\n // can be expensive so let's find only the ones that are new.\n patterns.forEach((pattern: IgnorePattern) => {\n if (pattern instanceof RegExp) {\n for (const existingPattern of ignorePatterns) {\n if (\n existingPattern instanceof RegExp &&\n existingPattern.toString() === pattern.toString()\n ) {\n return;\n }\n }\n ignorePatterns.add(pattern);\n }\n ignorePatterns.add(pattern);\n });\n if (ignorePatterns.size === existingSize) {\n return;\n }\n // We need to recheck all of the existing logs.\n // This allows adding an ignore pattern anywhere in the codebase.\n // Without this, if you ignore a pattern after the a log is created,\n // then we would keep showing the log.\n logs = new Set(Array.from(logs).filter((log) => !isMessageIgnored(log.message.content)));\n handleUpdate();\n}\n\nexport function setDisabled(value: boolean): void {\n if (value === _isDisabled) {\n return;\n }\n _isDisabled = value;\n handleUpdate();\n}\n\nexport function isDisabled(): boolean {\n return _isDisabled;\n}\n\nexport function observe(observer: Observer): Subscription {\n const subscription = { observer };\n observers.add(subscription);\n\n observer(getNextState());\n\n return {\n unsubscribe(): void {\n observers.delete(subscription);\n },\n };\n}\n\nexport function withSubscription(WrappedComponent: React.FC<object>): React.Component<object> {\n class LogBoxStateSubscription extends React.Component<React.PropsWithChildren<Props>, State> {\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(err: Error, errorInfo: { componentStack: string } & any) {\n /* $FlowFixMe[class-object-subtyping] added when improving typing for\n * this parameters */\n reportLogBoxError(err, errorInfo.componentStack);\n }\n\n _subscription?: Subscription;\n\n state = {\n logs: new Set<LogBoxLog>(),\n isDisabled: false,\n hasError: false,\n selectedLogIndex: -1,\n };\n\n render() {\n if (this.state.hasError) {\n // This happens when the component failed to render, in which case we delegate to the native redbox.\n // We can't show any fallback UI here, because the error may be with <View> or <Text>.\n return null;\n }\n\n return (\n <LogContext.Provider\n value={{\n selectedLogIndex: this.state.selectedLogIndex,\n isDisabled: this.state.isDisabled,\n logs: Array.from(this.state.logs),\n }}>\n {this.props.children}\n <WrappedComponent />\n </LogContext.Provider>\n );\n }\n\n componentDidMount(): void {\n this._subscription = observe((data) => {\n this.setState(data);\n });\n }\n\n componentWillUnmount(): void {\n if (this._subscription != null) {\n this._subscription.unsubscribe();\n }\n }\n\n _handleDismiss = (): void => {\n // Here we handle the cases when the log is dismissed and it\n // was either the last log, or when the current index\n // is now outside the bounds of the log array.\n const { selectedLogIndex, logs: stateLogs } = this.state;\n const logsArray = Array.from(stateLogs);\n if (selectedLogIndex != null) {\n if (logsArray.length - 1 <= 0) {\n setSelectedLog(-1);\n } else if (selectedLogIndex >= logsArray.length - 1) {\n setSelectedLog(selectedLogIndex - 1);\n }\n\n dismiss(logsArray[selectedLogIndex]);\n }\n };\n\n _handleMinimize = (): void => {\n setSelectedLog(-1);\n };\n\n _handleSetSelectedLog = (index: number): void => {\n setSelectedLog(index);\n };\n }\n\n // @ts-expect-error\n return LogBoxStateSubscription;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogContext.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LogContext.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,eAAO,MAAM,UAAU;sBACH,MAAM;gBACZ,OAAO;UACb,SAAS,EAAE;SACJ,CAAC;AAEhB,wBAAgB,OAAO,IAAI;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB,CAkBA;AAED,wBAAgB,cAAc,cAG7B"}
|
|
@@ -5,14 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.useSelectedLog = exports.useLogs = exports.LogContext = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const react_native_1 = require("react-native");
|
|
9
8
|
const LogBoxLog_1 = require("./LogBoxLog");
|
|
10
9
|
// Context provider for Array<LogBoxLog>
|
|
11
10
|
exports.LogContext = react_1.default.createContext(null);
|
|
12
11
|
function useLogs() {
|
|
13
12
|
const logs = react_1.default.useContext(exports.LogContext);
|
|
14
13
|
if (!logs) {
|
|
15
|
-
if (
|
|
14
|
+
if (process.env.EXPO_OS === 'web' && typeof window !== 'undefined') {
|
|
16
15
|
// Logbox data that is pre-fetched on the dev server and rendered here.
|
|
17
16
|
const expoCliStaticErrorElement = document.getElementById('_expo-static-error');
|
|
18
17
|
if (expoCliStaticErrorElement?.textContent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogContext.js","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogContext.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"LogContext.js","sourceRoot":"","sources":["../../../src/error-overlay/Data/LogContext.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,2CAAwC;AAExC,wCAAwC;AAE3B,QAAA,UAAU,GAAG,eAAK,CAAC,aAAa,CAInC,IAAI,CAAC,CAAC;AAEhB,SAAgB,OAAO;IAKrB,MAAM,IAAI,GAAG,eAAK,CAAC,UAAU,CAAC,kBAAU,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YAClE,uEAAuE;YACvE,MAAM,yBAAyB,GAAG,QAAQ,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;YAChF,IAAI,yBAAyB,EAAE,WAAW,EAAE;gBAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,WAAW,CAAC,CAAC;gBAC9D,OAAO;oBACL,GAAG,GAAG;oBACN,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,IAAI,qBAAS,CAAC,GAAG,CAAC,CAAC;iBACrD,CAAC;aACH;SACF;QAED,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAtBD,0BAsBC;AAED,SAAgB,cAAc;IAC5B,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7C,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAChC,CAAC;AAHD,wCAGC","sourcesContent":["import React from 'react';\n\nimport { LogBoxLog } from './LogBoxLog';\n\n// Context provider for Array<LogBoxLog>\n\nexport const LogContext = React.createContext<{\n selectedLogIndex: number;\n isDisabled: boolean;\n logs: LogBoxLog[];\n} | null>(null);\n\nexport function useLogs(): {\n selectedLogIndex: number;\n isDisabled: boolean;\n logs: LogBoxLog[];\n} {\n const logs = React.useContext(LogContext);\n if (!logs) {\n if (process.env.EXPO_OS === 'web' && typeof window !== 'undefined') {\n // Logbox data that is pre-fetched on the dev server and rendered here.\n const expoCliStaticErrorElement = document.getElementById('_expo-static-error');\n if (expoCliStaticErrorElement?.textContent) {\n const raw = JSON.parse(expoCliStaticErrorElement.textContent);\n return {\n ...raw,\n logs: raw.logs.map((raw: any) => new LogBoxLog(raw)),\n };\n }\n }\n\n throw new Error('useLogs must be used within a LogProvider');\n }\n return logs;\n}\n\nexport function useSelectedLog() {\n const { selectedLogIndex, logs } = useLogs();\n return logs[selectedLogIndex];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/UI/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/UI/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,QAQL,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CODE_FONT = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
exports.CODE_FONT = process.env.EXPO_OS === 'ios'
|
|
5
|
+
? // iOS
|
|
6
|
+
'Courier New'
|
|
7
|
+
: process.env.EXPO_OS === 'android'
|
|
8
|
+
? // Android
|
|
9
|
+
'monospace'
|
|
10
|
+
: // Default
|
|
11
|
+
'Courier';
|
|
10
12
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/constants.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/error-overlay/UI/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GACpB,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK;IAC3B,CAAC,CAAC,MAAM;QACN,aAAa;IACf,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,SAAS;QACjC,CAAC,CAAC,UAAU;YACV,WAAW;QACb,CAAC,CAAC,UAAU;YACV,SAAS,CAAC","sourcesContent":["export const CODE_FONT =\n process.env.EXPO_OS === 'ios'\n ? // iOS\n 'Courier New'\n : process.env.EXPO_OS === 'android'\n ? // Android\n 'monospace'\n : // Default\n 'Courier';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-overlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-overlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,uCAQzB,GAAG,kBAOxC"}
|
|
@@ -5,26 +5,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.withErrorOverlay = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
// TODO: This will break tree shaking due to how we transpile this package.
|
|
9
|
-
const react_native_1 = require("react-native");
|
|
10
|
-
const ErrorToastContainer_1 = __importDefault(require("./toast/ErrorToastContainer"));
|
|
11
8
|
if (!global.setImmediate) {
|
|
12
9
|
global.setImmediate = function (fn) {
|
|
13
10
|
return setTimeout(fn, 0);
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
|
-
if (process.env.NODE_ENV === 'development') {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
require('./LogBox').default.install();
|
|
20
|
-
}
|
|
13
|
+
if (process.env.NODE_ENV === 'development' && process.env.EXPO_OS === 'web') {
|
|
14
|
+
// Stack traces are big with React Navigation
|
|
15
|
+
require('./LogBox').default.install();
|
|
21
16
|
}
|
|
22
17
|
function withErrorOverlay(Comp) {
|
|
23
18
|
if (process.env.NODE_ENV === 'production') {
|
|
24
19
|
return Comp;
|
|
25
20
|
}
|
|
21
|
+
const { default: ErrorToastContainer } = require('./toast/ErrorToastContainer');
|
|
26
22
|
return function ErrorOverlay(props) {
|
|
27
|
-
return (react_1.default.createElement(
|
|
23
|
+
return (react_1.default.createElement(ErrorToastContainer, null,
|
|
28
24
|
react_1.default.createElement(Comp, { ...props })));
|
|
29
25
|
};
|
|
30
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error-overlay/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error-overlay/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;IACxB,MAAM,CAAC,YAAY,GAAG,UAAU,EAAE;QAChC,OAAO,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC;CACH;AAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE;IAC3E,6CAA6C;IAC7C,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;CACvC;AAED,SAAgB,gBAAgB,CAAC,IAA8B;IAC7D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,OAAO,IAAI,CAAC;KACb;IAED,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,GACpC,OAAO,CAAC,6BAA6B,CAAiD,CAAC;IAEzF,OAAO,SAAS,YAAY,CAAC,KAAU;QACrC,OAAO,CACL,8BAAC,mBAAmB;YAClB,8BAAC,IAAI,OAAK,KAAK,GAAI,CACC,CACvB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAfD,4CAeC","sourcesContent":["import React from 'react';\n\nif (!global.setImmediate) {\n global.setImmediate = function (fn) {\n return setTimeout(fn, 0);\n };\n}\n\nif (process.env.NODE_ENV === 'development' && process.env.EXPO_OS === 'web') {\n // Stack traces are big with React Navigation\n require('./LogBox').default.install();\n}\n\nexport function withErrorOverlay(Comp: React.ComponentType<any>) {\n if (process.env.NODE_ENV === 'production') {\n return Comp;\n }\n\n const { default: ErrorToastContainer } =\n require('./toast/ErrorToastContainer') as typeof import('./toast/ErrorToastContainer');\n\n return function ErrorOverlay(props: any) {\n return (\n <ErrorToastContainer>\n <Comp {...props} />\n </ErrorToastContainer>\n );\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAA2E;AAE3E,mDAAoD;AACpD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,GAAG,GAAG,IAAA,2BAAc,GAAE,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC5C,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;YACtB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,sCAAwC,CACtE,CACF,CACR,CAAC;KACH;IAED,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QACtB,8BAAC,YAAY,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAI;QACzD,8BAAC,YAAY,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,KAAK,CAAC,UAAU,GAAI,CACtD,CACR,CAAC;AACJ,CAAC;AAnBD,sDAmBC;AAED,SAAS,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAyC;IAC5E,OAAO,CACL,8BAAC,wBAAS,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAC5C,CAAC;IACA,uDAAuD;IACvD,OAAO,EACP,OAAO,GACR,EAAE,EAAE,CAAC,CACJ,8BAAC,mBAAI,IACH,KAAK,EAAE;YACL,YAAY,CAAC,QAAQ;YACrB;gBACE,kCAAkC;gBAClC,kBAAkB,EAAE,OAAO;gBAC3B,eAAe,EAAE,OAAO;oBACtB,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAA2E;AAE3E,mDAAoD;AACpD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,GAAG,GAAG,IAAA,2BAAc,GAAE,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC5C,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;YACtB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,sCAAwC,CACtE,CACF,CACR,CAAC;KACH;IAED,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QACtB,8BAAC,YAAY,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,CAA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,EAAE;KACf;CACF,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,eAAe,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAClD,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,SAAS,EAAE,mBAAmB;aAC/B;SACF,CAAC;QACF,aAAa,EAAE,KAAK;KACrB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC;KACR;IACD,eAAe,EAAE;QACf,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from 'react';\nimport { Platform, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { useSelectedLog } from '../Data/LogContext';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\ntype Props = {\n onDismiss: () => void;\n onMinimize: () => void;\n};\n\nexport function LogBoxInspectorFooter(props: Props) {\n const log = useSelectedLog();\n\n if (['static', 'syntax'].includes(log.level)) {\n return (\n <View style={styles.root}>\n <View style={styles.button}>\n <Text style={styles.syntaxErrorText}>This error cannot be dismissed.</Text>\n </View>\n </View>\n );\n }\n\n return (\n <View style={styles.root}>\n <FooterButton text=\"Dismiss\" onPress={props.onDismiss} />\n <FooterButton text=\"Minimize\" onPress={props.onMinimize} />\n </View>\n );\n}\n\nfunction FooterButton({ text, onPress }: { onPress: () => void; text: string }) {\n return (\n <Pressable onPress={onPress} style={{ flex: 1 }}>\n {({\n /** @ts-expect-error: react-native types are broken. */\n hovered,\n pressed,\n }) => (\n <View\n style={[\n buttonStyles.safeArea,\n {\n // @ts-expect-error: web-only type\n transitionDuration: '150ms',\n backgroundColor: pressed\n ? '#323232'\n : hovered\n ? '#111111'\n : LogBoxStyle.getBackgroundColor(),\n },\n ]}>\n <View style={buttonStyles.content}>\n <Text style={buttonStyles.label}>{text}</Text>\n </View>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst buttonStyles = StyleSheet.create({\n safeArea: {\n flex: 1,\n borderTopWidth: 1,\n borderColor: '#323232',\n // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,\n },\n content: {\n alignItems: 'center',\n height: 48,\n justifyContent: 'center',\n },\n label: {\n userSelect: 'none',\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n },\n});\n\nconst styles = StyleSheet.create({\n root: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n ...Platform.select({\n web: {\n boxShadow: `0 -2px 0 2px #000`,\n },\n }),\n flexDirection: 'row',\n },\n button: {\n flex: 1,\n },\n syntaxErrorText: {\n textAlign: 'center',\n width: '100%',\n height: 48,\n fontSize: 14,\n lineHeight: 20,\n paddingTop: 20,\n paddingBottom: 50,\n fontStyle: 'italic',\n color: LogBoxStyle.getTextColor(0.6),\n },\n});\n"]}
|
|
@@ -136,7 +136,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
136
136
|
lineHeight: 20,
|
|
137
137
|
},
|
|
138
138
|
safeArea: {
|
|
139
|
-
paddingTop:
|
|
139
|
+
paddingTop: process.env.EXPO_OS !== 'ios' ? react_native_1.StatusBar.currentHeight : 40,
|
|
140
140
|
},
|
|
141
141
|
});
|
|
142
142
|
//# sourceMappingURL=LogBoxInspectorHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorHeader.js","source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iB,EAAE,CAAC;QACpB,MAAM,EAAE,uBAAQ,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IACD,KAAK,EAAE;QACL,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorHeader.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAkF;AAGlF,mDAA6C;AAC7C,qDAAkD;AAClD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAE1B,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC5B,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjD,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK;oBACvB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,wBAA0B,CAClD,CACF,CACF,CACR,CAAC;KACH;IAED,MAAM,SAAS,GAA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,CAAC;AAEH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,MAAM,EAAE;QACN,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,KAAK,EAAE;QACL,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,WAAW,CAAC,eAAe,EAAE;KAC/C;IACD,KAAK,EAAE;QACL,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,MAAM,EAAE;QACN,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QAEpB,iBAAiB,EAAE,CAAC;QACpB,MAAM,EAAE,uBAAQ,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IACD,KAAK,EAAE;QACL,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,wBAAS,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE;KACzE;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from 'react';\nimport { Image, Platform, StatusBar, StyleSheet, Text, View } from 'react-native';\n\nimport type { LogLevel } from '../Data/LogBoxLog';\nimport { useLogs } from '../Data/LogContext';\nimport { LogBoxButton } from '../UI/LogBoxButton';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\ntype Props = {\n onSelectIndex: (selectedIndex: number) => void;\n level: LogLevel;\n};\n\nexport function LogBoxInspectorHeader(props: Props) {\n const { selectedLogIndex: selectedIndex, logs } = useLogs();\n const total = logs.length;\n\n if (props.level === 'syntax') {\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <View style={styles.title}>\n <Text style={styles.titleText}>Failed to compile</Text>\n </View>\n </View>\n </View>\n );\n }\n\n const prevIndex = selectedIndex - 1 < 0 ? total - 1 : selectedIndex - 1;\n const nextIndex = selectedIndex + 1 > total - 1 ? 0 : selectedIndex + 1;\n\n const titleText = `Log ${selectedIndex + 1} of ${total}`;\n\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require('@expo/metro-runtime/assets/chevron-left.png')}\n onPress={() => props.onSelectIndex(prevIndex)}\n />\n <View style={styles.title}>\n <Text style={styles.titleText}>{titleText}</Text>\n </View>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require('@expo/metro-runtime/assets/chevron-right.png')}\n onPress={() => props.onSelectIndex(nextIndex)}\n />\n </View>\n </View>\n );\n}\n\nconst backgroundForLevel = (level: LogLevel) =>\n ({\n warn: {\n default: 'transparent',\n pressed: LogBoxStyle.getWarningDarkColor(),\n },\n error: {\n default: 'transparent',\n pressed: LogBoxStyle.getErrorDarkColor(),\n },\n fatal: {\n default: 'transparent',\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n syntax: {\n default: 'transparent',\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n static: {\n default: 'transparent',\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n })[level];\n\nfunction LogBoxInspectorHeaderButton(props: {\n disabled: boolean;\n image: number;\n level: LogLevel;\n onPress?: () => void;\n}) {\n return (\n <LogBoxButton\n backgroundColor={backgroundForLevel(props.level)}\n onPress={props.disabled ? undefined : props.onPress}\n style={headerStyles.button}>\n {props.disabled ? null : (\n <Image\n source={props.image}\n tintColor={LogBoxStyle.getTextColor()}\n style={headerStyles.buttonImage}\n />\n )}\n </LogBoxButton>\n );\n}\n\nconst headerStyles = StyleSheet.create({\n button: {\n alignItems: 'center',\n justifyContent: 'center',\n aspectRatio: 1,\n marginRight: 6,\n marginLeft: 6,\n borderRadius: 3,\n },\n buttonImage: {\n height: 14,\n width: 8,\n },\n});\n\nconst styles = StyleSheet.create({\n syntax: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n static: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n fatal: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n warn: {\n backgroundColor: LogBoxStyle.getWarningColor(),\n },\n error: {\n backgroundColor: LogBoxStyle.getErrorColor(),\n },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n\n paddingHorizontal: 8,\n height: Platform.select({\n default: 48,\n ios: 44,\n }),\n },\n title: {\n alignItems: 'center',\n flex: 1,\n justifyContent: 'center',\n },\n titleText: {\n color: LogBoxStyle.getTextColor(),\n fontSize: 16,\n fontWeight: '600',\n includeFontPadding: false,\n lineHeight: 20,\n },\n safeArea: {\n paddingTop: process.env.EXPO_OS !== 'ios' ? StatusBar.currentHeight : 40,\n },\n});\n"]}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 650 Industries.
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
1
8
|
import { GestureResponderEvent } from 'react-native';
|
|
2
9
|
type Props = {
|
|
3
10
|
onPress?: ((event: GestureResponderEvent) => void) | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorSourceMapStatus.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorSourceMapStatus.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAoB,qBAAqB,EAAoB,MAAM,cAAc,CAAC;AAKzF,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1D,MAAM,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,KAAK,sBAsF1D"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 650 Industries.
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
'use client';
|
|
1
9
|
"use strict";
|
|
2
10
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
11
|
if (k2 === undefined) k2 = k;
|
|
@@ -24,13 +32,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
32
|
};
|
|
25
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
34
|
exports.LogBoxInspectorSourceMapStatus = void 0;
|
|
27
|
-
/**
|
|
28
|
-
* Copyright (c) 650 Industries.
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/
|
|
34
35
|
const react_1 = __importStar(require("react"));
|
|
35
36
|
const react_native_1 = require("react-native");
|
|
36
37
|
const LogBoxButton_1 = require("../UI/LogBoxButton");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorSourceMapStatus.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorSourceMapStatus.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorSourceMapStatus.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAAmD;AACnD,+CAAyF;AAEzF,qDAAkD;AAClD,+DAAiD;AAOjD,SAAgB,8BAA8B,CAAC,KAAY;IACzD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAG/B;QACD,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;IAEH,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE;YAC9B,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE;gBAC3B,MAAM,QAAQ,GAAG,IAAI,uBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvC,MAAM,SAAS,GAAG,uBAAQ,CAAC,IAAI,CAC7B,uBAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE;oBACxB,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,qBAAM,CAAC,MAAM;oBACrB,OAAO,EAAE,CAAC;oBACV,eAAe,EAAE,IAAI;iBACtB,CAAC,CACH,CAAC;gBACF,QAAQ,CAAC;oBACP,SAAS;oBACT,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC;wBAC3B,UAAU,EAAE,C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AE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EACjD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,KAAK,EAAE,MAAM,CAAC,IAAI;QAClB,8BAAC,uBAAQ,CAAC,KAAK,IACb,MAAM,EAAE,KAAK,EACb,SAAS,EAAE,KAAK,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,EACjD,KAAK,EAAE;gBACL,MAAM,CAAC,KAAK;gBACZ,KAAK,CAAC,MAAM,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;oBAChD,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE;aAC9C,GACD;QACF,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,iBAAmB,CAC3C,CAChB,CAAC;AACJ,CAAC;AAtFD,wEAsFC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,KAAK;QACpB,MAAM,EAAE,EAAE;QACV,iBAAiB,EAAE,CAAC;KACrB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,CAAC;KACb;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { Animated, Easing, GestureResponderEvent, StyleSheet, Text } from 'react-native';\n\nimport { LogBoxButton } from '../UI/LogBoxButton';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\ntype Props = {\n onPress?: ((event: GestureResponderEvent) => void) | null;\n status: 'COMPLETE' | 'FAILED' | 'NONE' | 'PENDING';\n};\n\nexport function LogBoxInspectorSourceMapStatus(props: Props) {\n const [state, setState] = useState<{\n animation: null | Animated.CompositeAnimation;\n rotate: null | Animated.AnimatedInterpolation<string>;\n }>({\n animation: null,\n rotate: null,\n });\n\n useEffect(() => {\n if (props.status === 'PENDING') {\n if (state.animation == null) {\n const animated = new Animated.Value(0);\n const animation = Animated.loop(\n Animated.timing(animated, {\n duration: 2000,\n easing: Easing.linear,\n toValue: 1,\n useNativeDriver: true,\n })\n );\n setState({\n animation,\n rotate: animated.interpolate({\n inputRange: [0, 1],\n outputRange: ['0deg', '360deg'],\n }),\n });\n animation.start();\n }\n } else {\n if (state.animation != null) {\n state.animation.stop();\n setState({\n animation: null,\n rotate: null,\n });\n }\n }\n\n return () => {\n if (state.animation != null) {\n state.animation.stop();\n }\n };\n }, [props.status, state.animation]);\n\n let image;\n let color;\n switch (props.status) {\n case 'FAILED':\n image = require('@expo/metro-runtime/assets/alert-triangle.png');\n color = LogBoxStyle.getErrorColor(1);\n break;\n case 'PENDING':\n image = require('@expo/metro-runtime/assets/loader.png');\n color = LogBoxStyle.getWarningColor(1);\n break;\n }\n\n if (props.status === 'COMPLETE' || image == null) {\n return null;\n }\n\n return (\n <LogBoxButton\n backgroundColor={{\n default: 'transparent',\n pressed: LogBoxStyle.getBackgroundColor(1),\n }}\n hitSlop={{ bottom: 8, left: 8, right: 8, top: 8 }}\n onPress={props.onPress}\n style={styles.root}>\n <Animated.Image\n source={image}\n tintColor={color ?? LogBoxStyle.getTextColor(0.4)}\n style={[\n styles.image,\n state.rotate == null || props.status !== 'PENDING'\n ? null\n : { transform: [{ rotate: state.rotate }] },\n ]}\n />\n <Text style={[styles.text, { color }]}>Source Map</Text>\n </LogBoxButton>\n );\n}\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n borderRadius: 12,\n flexDirection: 'row',\n height: 24,\n paddingHorizontal: 8,\n },\n image: {\n height: 14,\n width: 16,\n marginEnd: 4,\n },\n text: {\n fontSize: 12,\n includeFontPadding: false,\n lineHeight: 16,\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorToast.js","sourceRoot":"","sources":["../../../src/error-overlay/toast/ErrorToast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,+CAAyC;AACzC,+CAAkF;AAElF,2DAAwD;AACxD,+DAAiD;AAEjD,+DAAiD;AAUjD,SAAS,kBAAkB,CAAC,GAAc;IACxC,0EAA0E;IAC1E,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,UAAU,CAAC,kBAAkB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC5C,UAAU,CAAC,kBAAkB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,SAAgB,UAAU,CAAC,KAAY;IACrC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAE5C,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAExB,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,WAAW,CAAC,SAAS;QAChC,8BAAC,wBAAS,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,IACtD,CAAC;QACA,uDAAuD;QACvD,OAAO,EACP,OAAO,GACR,EAAE,EAAE,CAAC,CACJ,8BAAC,mBAAI,IACH,KAAK,EAAE;gBACL,WAAW,CAAC,KAAK;gBACjB;oBACE,kCAAkC;oBAClC,kBAAkB,EAAE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;IACD,KAAK,EAAE;QACL,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,WAAW,CAAC,kBAAkB,EAAE;QACjD,IAAI,EAAE,CAAC;QACP,iBAAiB,EAAE,EAAE;KACtB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) 650 Industries.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { useEffect } from 'react';\nimport { Image, Platform, Pressable, StyleSheet, Text, View } from 'react-native';\n\nimport { ErrorToastMessage } from './ErrorToastMessage';\nimport * as LogBoxData from '../Data/LogBoxData';\nimport { LogBoxLog } from '../Data/LogBoxLog';\nimport * as LogBoxStyle from '../UI/LogBoxStyle';\n\ntype Props = {\n log: LogBoxLog;\n totalLogCount: number;\n level: 'warn' | 'error';\n onPressOpen: () => void;\n onPressDismiss: () => void;\n};\n\nfunction useSymbolicatedLog(log: LogBoxLog) {\n // Eagerly symbolicate so the stack is available when pressing to inspect.\n useEffect(() => {\n LogBoxData.symbolicateLogLazy('stack', log);\n LogBoxData.symbolicateLogLazy('component', log);\n }, [log]);\n}\n\nexport function ErrorToast(props: Props) {\n const { totalLogCount, level, log } = props;\n\n useSymbolicatedLog(log);\n\n return (\n <View style={toastStyles.container}>\n <Pressable style={{ flex: 1 }} onPress={props.onPressOpen}>\n {({\n /** @ts-expect-error: react-native types are broken. */\n hovered,\n pressed,\n }) => (\n <View\n style={[\n toastStyles.press,\n {\n // @ts-expect-error: web-only type\n transitionDuration: '150ms',\n backgroundColor: pressed\n ? '#323232'\n : hovered\n ? '#111111'\n : LogBoxStyle.getBackgroundColor(),\n },\n ]}>\n <Count count={totalLogCount} level={level} />\n <ErrorToastMessage message={log.message} />\n <Dismiss onPress={props.onPressDismiss} />\n </View>\n )}\n </Pressable>\n </View>\n );\n}\n\nfunction Count({ count, level }: { count: number; level: Props['level'] }) {\n return (\n <View style={[countStyles.inside, countStyles[level]]}>\n <Text style={countStyles.text}>{count <= 1 ? '!' : count}</Text>\n </View>\n );\n}\n\nfunction Dismiss({ onPress }: { onPress: () => void }) {\n return (\n <Pressable\n style={{\n marginLeft: 5,\n }}\n hitSlop={{\n top: 12,\n right: 10,\n bottom: 12,\n left: 10,\n }}\n onPress={onPress}>\n {({\n /** @ts-expect-error: react-native types are broken. */\n hovered,\n pressed,\n }) => (\n <View\n style={[dismissStyles.press, hovered && { opacity: 0.8 }, pressed && { opacity: 0.5 }]}>\n <Image\n source={require('@expo/metro-runtime/assets/close.png')}\n style={dismissStyles.image}\n />\n </View>\n )}\n </Pressable>\n );\n}\n\nconst countStyles = StyleSheet.create({\n warn: {\n backgroundColor: LogBoxStyle.getWarningColor(1),\n },\n error: {\n backgroundColor: LogBoxStyle.getErrorColor(1),\n },\n log: {\n backgroundColor: LogBoxStyle.getLogColor(1),\n },\n inside: {\n marginRight: 8,\n minWidth: 22,\n aspectRatio: 1,\n paddingHorizontal: 4,\n borderRadius: 11,\n justifyContent: 'center',\n alignItems: 'center',\n },\n text: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n lineHeight: 18,\n textAlign: 'center',\n fontWeight: '600',\n ...Platform.select({\n web: {\n textShadow: `0px 0px 3px ${LogBoxStyle.getBackgroundColor(0.8)}`,\n },\n }),\n },\n});\n\nconst dismissStyles = StyleSheet.create({\n press: {\n backgroundColor: '#323232',\n height: 20,\n width: 20,\n borderRadius: 25,\n alignItems: 'center',\n justifyContent: 'center',\n },\n image: {\n height: 8,\n width: 8,\n },\n});\n\nconst toastStyles = StyleSheet.create({\n container: {\n height: 48,\n justifyContent: 'center',\n marginBottom: 4,\n },\n press: {\n borderWidth: 1,\n borderRadius: 8,\n overflow: 'hidden',\n flexDirection: 'row',\n alignItems: 'center',\n borderColor: '#323232',\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n flex: 1,\n paddingHorizontal: 12,\n },\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-runtime",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Tools for making advanced Metro bundler features work",
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"types": "build",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react-native": "*"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "ee4f30ef3b5fa567ad1bf94794197f7683fdd481"
|
|
40
40
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Platform } from 'react-native';
|
|
10
9
|
// @ts-expect-error
|
|
11
10
|
import Networking from 'react-native/Libraries/Network/RCTNetworking';
|
|
12
11
|
|
|
@@ -56,7 +55,7 @@ export function fetchAsync(
|
|
|
56
55
|
'asyncRequest',
|
|
57
56
|
url,
|
|
58
57
|
{
|
|
59
|
-
'expo-platform':
|
|
58
|
+
'expo-platform': process.env.EXPO_OS,
|
|
60
59
|
},
|
|
61
60
|
'',
|
|
62
61
|
'text',
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
|
|
8
|
+
const currentSrc =
|
|
9
|
+
typeof document !== 'undefined' && document.currentScript
|
|
10
|
+
? ('src' in document.currentScript && document.currentScript.src) || null
|
|
11
|
+
: null;
|
|
12
|
+
|
|
7
13
|
// Basically `__webpack_require__.l`.
|
|
8
14
|
export function fetchThenEvalAsync(
|
|
9
15
|
url: string,
|
|
@@ -13,7 +19,7 @@ export function fetchThenEvalAsync(
|
|
|
13
19
|
crossOrigin,
|
|
14
20
|
}: { scriptType?: string; nonce?: string; crossOrigin?: string } = {}
|
|
15
21
|
): Promise<void> {
|
|
16
|
-
if (typeof
|
|
22
|
+
if (typeof window === 'undefined') {
|
|
17
23
|
return require('./fetchThenEvalJs').fetchThenEvalAsync(url);
|
|
18
24
|
}
|
|
19
25
|
return new Promise<void>((resolve, reject) => {
|
|
@@ -59,7 +65,15 @@ export function fetchThenEvalAsync(
|
|
|
59
65
|
script.parentNode && script.parentNode.removeChild(script);
|
|
60
66
|
reject(error);
|
|
61
67
|
};
|
|
62
|
-
|
|
68
|
+
|
|
69
|
+
if (script.src === currentSrc) {
|
|
70
|
+
// NOTE(kitten): We always prevent `fetchThenEval` from loading the "current script".
|
|
71
|
+
// This points at our entrypoint bundle, and we should never reload and reevaluate the
|
|
72
|
+
// entrypoint bundle
|
|
73
|
+
resolve();
|
|
74
|
+
} else {
|
|
75
|
+
document.head.appendChild(script);
|
|
76
|
+
}
|
|
63
77
|
});
|
|
64
78
|
}
|
|
65
79
|
|
|
@@ -20,10 +20,9 @@ export async function loadBundleAsync(bundlePath: string): Promise<void> {
|
|
|
20
20
|
if (process.env.NODE_ENV === 'production') {
|
|
21
21
|
return fetchThenEvalAsync(requestUrl);
|
|
22
22
|
} else {
|
|
23
|
-
const Platform = require('react-native').Platform;
|
|
24
23
|
const LoadingView = require('../LoadingView')
|
|
25
24
|
.default as typeof import('../LoadingView').default;
|
|
26
|
-
if (
|
|
25
|
+
if (process.env.EXPO_OS !== 'web') {
|
|
27
26
|
// Send a signal to the `expo` package to show the loading indicator.
|
|
28
27
|
LoadingView.showMessage('Downloading...', 'load');
|
|
29
28
|
}
|
|
@@ -35,7 +34,7 @@ export async function loadBundleAsync(bundlePath: string): Promise<void> {
|
|
|
35
34
|
HMRClient.registerBundle(requestUrl);
|
|
36
35
|
})
|
|
37
36
|
.finally(() => {
|
|
38
|
-
if (!--pendingRequests &&
|
|
37
|
+
if (!--pendingRequests && process.env.EXPO_OS !== 'web') {
|
|
39
38
|
LoadingView.hide();
|
|
40
39
|
}
|
|
41
40
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
2
|
|
|
4
3
|
import { LogBoxLog } from './LogBoxLog';
|
|
5
4
|
|
|
@@ -18,7 +17,7 @@ export function useLogs(): {
|
|
|
18
17
|
} {
|
|
19
18
|
const logs = React.useContext(LogContext);
|
|
20
19
|
if (!logs) {
|
|
21
|
-
if (
|
|
20
|
+
if (process.env.EXPO_OS === 'web' && typeof window !== 'undefined') {
|
|
22
21
|
// Logbox data that is pre-fetched on the dev server and rendered here.
|
|
23
22
|
const expoCliStaticErrorElement = document.getElementById('_expo-static-error');
|
|
24
23
|
if (expoCliStaticErrorElement?.textContent) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export const CODE_FONT =
|
|
2
|
+
process.env.EXPO_OS === 'ios'
|
|
3
|
+
? // iOS
|
|
4
|
+
'Courier New'
|
|
5
|
+
: process.env.EXPO_OS === 'android'
|
|
6
|
+
? // Android
|
|
7
|
+
'monospace'
|
|
8
|
+
: // Default
|
|
9
|
+
'Courier';
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
// TODO: This will break tree shaking due to how we transpile this package.
|
|
3
|
-
import { Platform } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import ErrorToastContainer from './toast/ErrorToastContainer';
|
|
6
|
-
|
|
7
|
-
declare const process: any;
|
|
8
2
|
|
|
9
3
|
if (!global.setImmediate) {
|
|
10
4
|
global.setImmediate = function (fn) {
|
|
@@ -12,18 +6,19 @@ if (!global.setImmediate) {
|
|
|
12
6
|
};
|
|
13
7
|
}
|
|
14
8
|
|
|
15
|
-
if (process.env.NODE_ENV === 'development') {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
require('./LogBox').default.install();
|
|
20
|
-
}
|
|
9
|
+
if (process.env.NODE_ENV === 'development' && process.env.EXPO_OS === 'web') {
|
|
10
|
+
// Stack traces are big with React Navigation
|
|
11
|
+
require('./LogBox').default.install();
|
|
21
12
|
}
|
|
22
13
|
|
|
23
14
|
export function withErrorOverlay(Comp: React.ComponentType<any>) {
|
|
24
15
|
if (process.env.NODE_ENV === 'production') {
|
|
25
16
|
return Comp;
|
|
26
17
|
}
|
|
18
|
+
|
|
19
|
+
const { default: ErrorToastContainer } =
|
|
20
|
+
require('./toast/ErrorToastContainer') as typeof import('./toast/ErrorToastContainer');
|
|
21
|
+
|
|
27
22
|
return function ErrorOverlay(props: any) {
|
|
28
23
|
return (
|
|
29
24
|
<ErrorToastContainer>
|
|
@@ -54,8 +54,8 @@ function FooterButton({ text, onPress }: { onPress: () => void; text: string })
|
|
|
54
54
|
backgroundColor: pressed
|
|
55
55
|
? '#323232'
|
|
56
56
|
: hovered
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
? '#111111'
|
|
58
|
+
: LogBoxStyle.getBackgroundColor(),
|
|
59
59
|
},
|
|
60
60
|
]}>
|
|
61
61
|
<View style={buttonStyles.content}>
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
+
|
|
9
|
+
'use client';
|
|
10
|
+
|
|
8
11
|
import React, { useEffect, useState } from 'react';
|
|
9
12
|
import { Animated, Easing, GestureResponderEvent, StyleSheet, Text } from 'react-native';
|
|
10
13
|
|
|
@@ -51,8 +51,8 @@ export function ErrorToast(props: Props) {
|
|
|
51
51
|
backgroundColor: pressed
|
|
52
52
|
? '#323232'
|
|
53
53
|
: hovered
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
? '#111111'
|
|
55
|
+
: LogBoxStyle.getBackgroundColor(),
|
|
56
56
|
},
|
|
57
57
|
]}>
|
|
58
58
|
<Count count={totalLogCount} level={level} />
|