@expo/metro-runtime 3.1.3 → 3.2.0
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/HMRClient.js.map +1 -1
- package/build/async-require/buildAsyncRequire.js +1 -2
- package/build/async-require/buildAsyncRequire.js.map +1 -1
- package/build/async-require/buildUrlForBundle.js +1 -2
- package/build/async-require/buildUrlForBundle.js.map +1 -1
- package/build/async-require/buildUrlForBundle.native.js +1 -2
- package/build/async-require/buildUrlForBundle.native.js.map +1 -1
- package/build/async-require/fetchAsync.js +1 -2
- package/build/async-require/fetchAsync.js.map +1 -1
- package/build/async-require/fetchAsync.native.d.ts.map +1 -1
- package/build/async-require/fetchAsync.native.js +2 -4
- 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 -5
- package/build/async-require/fetchThenEval.web.js.map +1 -1
- package/build/async-require/fetchThenEvalJs.js +1 -2
- package/build/async-require/fetchThenEvalJs.js.map +1 -1
- package/build/async-require/index.native.js.map +1 -1
- package/build/async-require/loadBundle.d.ts.map +1 -1
- package/build/async-require/loadBundle.js +3 -5
- package/build/async-require/loadBundle.js.map +1 -1
- package/build/effects.js.map +1 -1
- package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
- package/build/error-overlay/Data/LogBoxData.js +22 -22
- package/build/error-overlay/Data/LogBoxData.js.map +1 -1
- package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
- package/build/error-overlay/Data/LogBoxSymbolication.js +2 -3
- package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
- package/build/error-overlay/Data/LogContext.d.ts.map +1 -1
- package/build/error-overlay/Data/LogContext.js +4 -5
- package/build/error-overlay/Data/LogContext.js.map +1 -1
- package/build/error-overlay/Data/parseLogBoxLog.js +5 -6
- package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
- package/build/error-overlay/ErrorOverlay.js +4 -5
- package/build/error-overlay/ErrorOverlay.js.map +1 -1
- package/build/error-overlay/LogBox.web.js.map +1 -1
- package/build/error-overlay/UI/AnsiHighlight.js +1 -2
- package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
- package/build/error-overlay/UI/LogBoxButton.js +1 -2
- package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
- package/build/error-overlay/UI/LogBoxMessage.js +1 -2
- package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
- package/build/error-overlay/UI/LogBoxStyle.js +14 -15
- package/build/error-overlay/UI/LogBoxStyle.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/formatProjectFilePath.js +2 -3
- package/build/error-overlay/formatProjectFilePath.js.map +1 -1
- package/build/error-overlay/index.d.ts.map +1 -1
- package/build/error-overlay/index.js +6 -11
- package/build/error-overlay/index.js.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
- package/build/error-overlay/modules/stringifySafe/index.js +1 -2
- package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +1 -2
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js +1 -2
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js +2 -3
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +1 -2
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSection.js +1 -2
- package/build/error-overlay/overlay/LogBoxInspectorSection.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 +9 -9
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +1 -2
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +2 -3
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
- package/build/error-overlay/toast/ErrorToast.js +1 -2
- package/build/error-overlay/toast/ErrorToast.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.js +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.web.js +1 -2
- package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastMessage.js +1 -2
- package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
- package/build/error-overlay/useRejectionHandler.js +1 -2
- package/build/error-overlay/useRejectionHandler.js.map +1 -1
- package/build/getDevServer.js.map +1 -1
- package/build/location/Location.js +2 -3
- package/build/location/Location.js.map +1 -1
- package/build/location/Location.native.js +2 -3
- package/build/location/Location.native.js.map +1 -1
- package/build/location/install.native.js.map +1 -1
- package/build/messageSocket.js.map +1 -1
- package/build/setupFastRefresh.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.native.js","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":";;;;;AAAA,wFAAwF;AACxF,sDAAoD;AAEpD,oEAAuC;AAEvC,yCAAsD;AACtD,mEAA2C;AAE3C,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,MAAM,QAAQ,GAAG,wBAAS,CAAC,UAAwC,CAAC;AAEpE,mEAAmE;AACnE,uEAAuE;AACvE,2EAA2E;AAC3E,SAAS,iCAAiC,CAAC,UAAkB;IAC3D,IAAI,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"install.native.js","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":"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","sourcesContent":["// This MUST be first to ensure that `fetch` is defined in the React Native environment.\nimport 'react-native/Libraries/Core/InitializeCore';\n\nimport Constants from 'expo-constants';\n\nimport { install, setLocationHref } from './Location';\nimport getDevServer from '../getDevServer';\n\nlet hasWarned = false;\n\nconst manifest = Constants.expoConfig as Record<string, any> | null;\n\n// Add a development warning for fetch requests with relative paths\n// to ensure developers are aware of the need to configure a production\n// base URL in the Expo config (app.json) under `expo.extra.router.origin`.\nfunction warnProductionOriginNotConfigured(requestUrl: string) {\n if (hasWarned) {\n return;\n }\n hasWarned = true;\n if (!manifest?.extra?.router?.origin) {\n console.warn(\n `The relative fetch request \"${requestUrl}\" will not work in production until the Expo Router Config Plugin (app.json) is configured with the \\`origin\\` prop set to the base URL of your web server, e.g. \\`{ plugins: [[\"expo-router\", { origin: \"...\" }]] }\\`. [Learn more](https://expo.github.io/router/docs/lab/runtime-location)`\n );\n }\n}\n\n// TODO: This would be better if native and tied as close to the JS engine as possible, i.e. it should\n// reflect the exact location of the JS file that was executed.\nfunction getBaseUrl() {\n if (process.env.NODE_ENV !== 'production') {\n // e.g. http://localhost:19006\n return getDevServer().url?.replace(/\\/$/, '');\n }\n\n // TODO: Make it official by moving out of `extra`\n const productionBaseUrl = manifest?.extra?.router?.origin;\n\n if (!productionBaseUrl) {\n return null;\n }\n\n // Ensure no trailing slash\n return productionBaseUrl?.replace(/\\/$/, '');\n}\n\nfunction wrapFetchWithWindowLocation(fetch: Function & { __EXPO_BASE_URL_POLYFILLED?: boolean }) {\n if (fetch.__EXPO_BASE_URL_POLYFILLED) {\n return fetch;\n }\n\n const _fetch = (...props: any[]) => {\n if (props[0] && typeof props[0] === 'string' && props[0].startsWith('/')) {\n if (process.env.NODE_ENV !== 'production') {\n warnProductionOriginNotConfigured(props[0]);\n }\n\n props[0] = new URL(props[0], window.location?.origin).toString();\n } else if (props[0] && typeof props[0] === 'object') {\n if (props[0].url && typeof props[0].url === 'string' && props[0].url.startsWith('/')) {\n if (process.env.NODE_ENV !== 'production') {\n warnProductionOriginNotConfigured(props[0]);\n }\n\n props[0].url = new URL(props[0].url, window.location?.origin).toString();\n }\n }\n return fetch(...props);\n };\n\n _fetch.__EXPO_BASE_URL_POLYFILLED = true;\n\n return _fetch;\n}\n\nif (manifest?.extra?.router?.origin !== false) {\n // Polyfill window.location in native runtimes.\n if (typeof window !== 'undefined' && !window.location) {\n const url = getBaseUrl();\n if (url) {\n setLocationHref(url);\n install();\n }\n }\n // Polyfill native fetch to support relative URLs\n Object.defineProperty(global, 'fetch', {\n value: wrapFetchWithWindowLocation(fetch),\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageSocket.js","sourceRoot":"","sources":["../src/messageSocket.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,yEAAyE;AACzE,+CAA+C;AAE/C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACtE,MAAM,aAAa,GAAG,IAAI,SAAS,CAAC,GAAG,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,CAAC;AACrF,aAAa,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,QAAQ,IAAI,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"messageSocket.js","sourceRoot":"","sources":["../src/messageSocket.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,yEAAyE;AACzE,+CAA+C;AAE/C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACtE,MAAM,aAAa,GAAG,IAAI,SAAS,CAAC,GAAG,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,CAAC;AACrF,aAAa,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACpB,KAAK,gBAAgB;YACnB,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACzB,KAAK,QAAQ;oBACX,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACzB,MAAM;YACV,CAAC;YACD,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM;QACR,KAAK,SAAS;YACZ,QAAQ;YACR,MAAM;IACV,CAAC;AACH,CAAC,CAAC","sourcesContent":["/* eslint-env browser */\n\n// Setup websocket messages for reloading the page from the command line.\n// This is normally setup on the native client.\n\nconst protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';\nconst messageSocket = new WebSocket(`${protocol}://${window.location.host}/message`);\nmessageSocket.onmessage = (message) => {\n const data = JSON.parse(String(message.data));\n switch (data.method) {\n case 'sendDevCommand':\n switch (data.params.name) {\n case 'reload':\n window.location.reload();\n break;\n }\n break;\n case 'reload':\n window.location.reload();\n break;\n case 'devMenu':\n // no-op\n break;\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupFastRefresh.js","sourceRoot":"","sources":["../src/setupFastRefresh.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,MAAM,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC7D,mBAAmB,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,OAAO,GAAG;IACd,kBAAkB;QAChB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACpB,CAAC;IAED,mCAAmC,EAAE,mBAAmB,CAAC,mCAAmC;IAE5F,qBAAqB,EAAE,mBAAmB,CAAC,qBAAqB;IAEhE,eAAe,EAAE,mBAAmB,CAAC,eAAe;IAEpD,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IAEtC,mBAAmB;QACjB,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"setupFastRefresh.js","sourceRoot":"","sources":["../src/setupFastRefresh.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,MAAM,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC7D,mBAAmB,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,OAAO,GAAG;IACd,kBAAkB;QAChB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACpB,CAAC;IAED,mCAAmC,EAAE,mBAAmB,CAAC,mCAAmC;IAE5F,qBAAqB,EAAE,mBAAmB,CAAC,qBAAqB;IAEhE,eAAe,EAAE,mBAAmB,CAAC,eAAe;IAEpD,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;IAEtC,mBAAmB;QACjB,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,EAAE,CAAC;YACjD,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QACD,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;IAC5C,CAAC;CACF,CAAC;AAEF,oFAAoF;AACpF,mFAAmF;AACnF,MAAM,CAAC,CAAC,MAAM,CAAC,uBAAuB,IAAI,EAAE,CAAC,GAAG,gBAAgB,CAAC,GAAG,OAAO,CAAC","sourcesContent":["// This needs to run before the renderer initializes.\n\nconst ReactRefreshRuntime = require('react-refresh/runtime');\nReactRefreshRuntime.injectIntoGlobalHook(global);\n\nconst Refresh = {\n performFullRefresh() {\n location.reload();\n },\n\n createSignatureFunctionForTransform: ReactRefreshRuntime.createSignatureFunctionForTransform,\n\n isLikelyComponentType: ReactRefreshRuntime.isLikelyComponentType,\n\n getFamilyByType: ReactRefreshRuntime.getFamilyByType,\n\n register: ReactRefreshRuntime.register,\n\n performReactRefresh() {\n if (ReactRefreshRuntime.hasUnrecoverableErrors()) {\n location.reload();\n return;\n }\n ReactRefreshRuntime.performReactRefresh();\n },\n};\n\n// The metro require polyfill can not have dependencies (applies for all polyfills).\n// Expose `Refresh` by assigning it to global to make it available in the polyfill.\nglobal[(global.__METRO_GLOBAL_PREFIX__ || '') + '__ReactRefresh'] = Refresh;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-runtime",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
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": "4165b8d72e1b9a1889c2767534cc619e21468110"
|
|
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} />
|