@expo/metro-runtime 2.2.7 → 3.0.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 +17 -1
- package/async-require.d.ts +1 -1
- package/async-require.js +1 -1
- package/build/HMRClient.d.ts +1 -1
- package/build/HMRClient.d.ts.map +1 -1
- package/build/HMRClient.js +27 -27
- package/build/HMRClient.js.map +1 -1
- package/build/HMRClient.native.js +1 -1
- package/build/HMRClient.native.js.map +1 -1
- package/build/LoadingView.d.ts +1 -1
- package/build/LoadingView.d.ts.map +1 -1
- package/build/LoadingView.js +2 -6
- package/build/LoadingView.js.map +1 -1
- package/build/LoadingView.native.d.ts +2 -0
- package/build/LoadingView.native.d.ts.map +1 -1
- package/build/LoadingView.native.js +6 -1
- package/build/LoadingView.native.js.map +1 -1
- package/build/async-require/buildAsyncRequire.js.map +1 -1
- package/build/async-require/buildUrlForBundle.js +1 -1
- package/build/async-require/buildUrlForBundle.js.map +1 -1
- package/build/async-require/buildUrlForBundle.native.js +5 -4
- package/build/async-require/buildUrlForBundle.native.js.map +1 -1
- package/build/async-require/fetchAsync.d.ts.map +1 -1
- package/build/async-require/fetchAsync.js +2 -2
- package/build/async-require/fetchAsync.js.map +1 -1
- package/build/async-require/fetchAsync.native.d.ts +1 -1
- package/build/async-require/fetchAsync.native.d.ts.map +1 -1
- package/build/async-require/fetchAsync.native.js +10 -10
- package/build/async-require/fetchAsync.native.js.map +1 -1
- package/build/async-require/fetchThenEval.d.ts.map +1 -1
- package/build/async-require/fetchThenEval.js +2 -3
- package/build/async-require/fetchThenEval.js.map +1 -1
- package/build/async-require/fetchThenEval.web.d.ts.map +1 -1
- package/build/async-require/fetchThenEval.web.js +13 -22
- package/build/async-require/fetchThenEval.web.js.map +1 -1
- package/build/async-require/index.js +1 -3
- package/build/async-require/index.js.map +1 -1
- package/build/async-require/loadBundle.d.ts.map +1 -1
- package/build/async-require/loadBundle.js +8 -8
- package/build/async-require/loadBundle.js.map +1 -1
- package/build/effects.js +10 -10
- package/build/effects.js.map +1 -1
- package/build/effects.native.js +0 -1
- package/build/error-overlay/Data/LogBoxData.d.ts +5 -5
- package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
- package/build/error-overlay/Data/LogBoxData.js +46 -48
- package/build/error-overlay/Data/LogBoxData.js.map +1 -1
- package/build/error-overlay/Data/LogBoxLog.d.ts +10 -10
- package/build/error-overlay/Data/LogBoxLog.d.ts.map +1 -1
- package/build/error-overlay/Data/LogBoxLog.js +44 -40
- package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
- package/build/error-overlay/Data/LogBoxSymbolication.d.ts +2 -2
- package/build/error-overlay/Data/LogBoxSymbolication.js +5 -5
- package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
- package/build/error-overlay/Data/LogContext.d.ts +2 -2
- package/build/error-overlay/Data/LogContext.d.ts.map +1 -1
- package/build/error-overlay/Data/LogContext.js +4 -4
- package/build/error-overlay/Data/LogContext.js.map +1 -1
- package/build/error-overlay/Data/parseLogBoxLog.d.ts +2 -2
- package/build/error-overlay/Data/parseLogBoxLog.d.ts.map +1 -1
- package/build/error-overlay/Data/parseLogBoxLog.js +26 -31
- package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
- package/build/error-overlay/ErrorOverlay.d.ts +10 -3
- package/build/error-overlay/ErrorOverlay.d.ts.map +1 -1
- package/build/error-overlay/ErrorOverlay.js +22 -21
- package/build/error-overlay/ErrorOverlay.js.map +1 -1
- package/build/error-overlay/LogBox.d.ts +2 -2
- package/build/error-overlay/LogBox.d.ts.map +1 -1
- package/build/error-overlay/LogBox.js +0 -1
- package/build/error-overlay/LogBox.js.map +1 -1
- package/build/error-overlay/LogBox.web.d.ts +3 -3
- package/build/error-overlay/LogBox.web.d.ts.map +1 -1
- package/build/error-overlay/LogBox.web.js +9 -12
- package/build/error-overlay/LogBox.web.js.map +1 -1
- package/build/error-overlay/UI/AnsiHighlight.d.ts +2 -2
- package/build/error-overlay/UI/AnsiHighlight.d.ts.map +1 -1
- package/build/error-overlay/UI/AnsiHighlight.js +21 -22
- package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
- package/build/error-overlay/UI/LogBoxButton.d.ts +1 -1
- package/build/error-overlay/UI/LogBoxButton.d.ts.map +1 -1
- package/build/error-overlay/UI/LogBoxButton.js +3 -5
- package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
- package/build/error-overlay/UI/LogBoxMessage.d.ts +2 -2
- package/build/error-overlay/UI/LogBoxMessage.d.ts.map +1 -1
- package/build/error-overlay/UI/LogBoxMessage.js +4 -4
- package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
- package/build/error-overlay/UI/LogBoxStyle.d.ts +1 -1
- package/build/error-overlay/UI/LogBoxStyle.js +1 -1
- package/build/error-overlay/UI/LogBoxStyle.js.map +1 -1
- package/build/error-overlay/UI/constants.js +3 -3
- package/build/error-overlay/UI/constants.js.map +1 -1
- package/build/error-overlay/formatProjectFilePath.d.ts +1 -1
- package/build/error-overlay/formatProjectFilePath.d.ts.map +1 -1
- package/build/error-overlay/formatProjectFilePath.js +5 -7
- package/build/error-overlay/formatProjectFilePath.js.map +1 -1
- package/build/error-overlay/index.d.ts +1 -1
- package/build/error-overlay/index.d.ts.map +1 -1
- package/build/error-overlay/index.js +6 -5
- package/build/error-overlay/index.js.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.d.ts +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.d.ts.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.js +9 -14
- package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts +2 -1
- package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts.map +1 -1
- package/build/error-overlay/modules/ExceptionsManager/index.native.js +7 -2
- package/build/error-overlay/modules/ExceptionsManager/index.native.js.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.d.ts.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.js +5 -5
- package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.native.d.ts +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.native.d.ts.map +1 -1
- package/build/error-overlay/modules/NativeLogBox/index.native.js +0 -1
- package/build/error-overlay/modules/NativeLogBox/index.native.js.map +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.js +4 -4
- package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.native.d.ts +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.native.d.ts.map +1 -1
- package/build/error-overlay/modules/openFileInEditor/index.native.js +0 -1
- package/build/error-overlay/modules/openFileInEditor/index.native.js.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/index.d.ts +1 -1
- package/build/error-overlay/modules/parseErrorStack/index.d.ts.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/index.js +5 -5
- package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.d.ts +1 -1
- package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js.map +1 -1
- package/build/error-overlay/modules/stringifySafe/index.d.ts +1 -1
- package/build/error-overlay/modules/stringifySafe/index.d.ts.map +1 -1
- package/build/error-overlay/modules/stringifySafe/index.js +14 -16
- package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts +2 -2
- package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts.map +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.js +5 -5
- package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.d.ts +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.native.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts +2 -2
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +10 -11
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js +27 -24
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js +18 -18
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts +2 -2
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +6 -6
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSection.d.ts +2 -2
- package/build/error-overlay/overlay/LogBoxInspectorSection.js +4 -4
- package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts +2 -2
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +13 -13
- package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts +2 -2
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +9 -9
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts +2 -2
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +24 -27
- package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
- package/build/error-overlay/toast/ErrorToast.d.ts +2 -2
- package/build/error-overlay/toast/ErrorToast.d.ts.map +1 -1
- package/build/error-overlay/toast/ErrorToast.js +35 -34
- package/build/error-overlay/toast/ErrorToast.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.d.ts +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.web.d.ts +2 -2
- package/build/error-overlay/toast/ErrorToastContainer.web.d.ts.map +1 -1
- package/build/error-overlay/toast/ErrorToastContainer.web.js +6 -5
- package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
- package/build/error-overlay/toast/ErrorToastMessage.d.ts +1 -1
- package/build/error-overlay/toast/ErrorToastMessage.d.ts.map +1 -1
- package/build/error-overlay/toast/ErrorToastMessage.js +4 -4
- package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
- package/build/error-overlay/useRejectionHandler.d.ts +1 -1
- package/build/error-overlay/useRejectionHandler.d.ts.map +1 -1
- package/build/error-overlay/useRejectionHandler.js +11 -12
- package/build/error-overlay/useRejectionHandler.js.map +1 -1
- package/build/getDevServer.d.ts.map +1 -1
- package/build/getDevServer.js +4 -5
- package/build/getDevServer.js.map +1 -1
- package/build/getDevServer.native.d.ts +2 -0
- package/build/getDevServer.native.d.ts.map +1 -1
- package/build/getDevServer.native.js +6 -1
- package/build/getDevServer.native.js.map +1 -1
- package/build/index.d.ts +1 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/location/Location.native.d.ts.map +1 -1
- package/build/location/Location.native.js +21 -20
- package/build/location/Location.native.js.map +1 -1
- package/build/location/install.js +0 -1
- package/build/location/install.native.d.ts +1 -1
- package/build/location/install.native.js +16 -22
- package/build/location/install.native.js.map +1 -1
- package/build/messageSocket.d.ts.map +1 -1
- package/build/messageSocket.js +5 -6
- package/build/messageSocket.js.map +1 -1
- package/build/setupFastRefresh.d.ts.map +1 -1
- package/build/setupFastRefresh.js +2 -4
- package/build/setupFastRefresh.js.map +1 -1
- package/build/setupHMR.js +1 -3
- package/build/setupHMR.js.map +1 -1
- package/build/symbolicate.d.ts +3 -3
- package/build/symbolicate.js.map +1 -1
- package/error-overlay.d.ts +1 -1
- package/error-overlay.js +1 -1
- package/package.json +25 -14
- package/LICENSE +0 -13
|
@@ -10,13 +10,16 @@ function useStackTraceLimit(limit) {
|
|
|
10
10
|
const current = react_1.default.useRef(0);
|
|
11
11
|
react_1.default.useEffect(() => {
|
|
12
12
|
try {
|
|
13
|
+
// @ts-expect-error: StackTraceLimit is not defined in the Error type
|
|
13
14
|
const currentLimit = Error.stackTraceLimit;
|
|
15
|
+
// @ts-expect-error: StackTraceLimit is not defined in the Error type
|
|
14
16
|
Error.stackTraceLimit = limit;
|
|
15
17
|
current.current = currentLimit;
|
|
16
18
|
}
|
|
17
19
|
catch { }
|
|
18
20
|
return () => {
|
|
19
21
|
try {
|
|
22
|
+
// @ts-expect-error: StackTraceLimit is not defined in the Error type
|
|
20
23
|
Error.stackTraceLimit = current.current;
|
|
21
24
|
}
|
|
22
25
|
catch { }
|
|
@@ -29,29 +32,25 @@ function useRejectionHandler() {
|
|
|
29
32
|
react_1.default.useEffect(() => {
|
|
30
33
|
function onUnhandledError(ev) {
|
|
31
34
|
hasError.current = true;
|
|
32
|
-
const error = ev
|
|
33
|
-
if (!error ||
|
|
34
|
-
!(error instanceof Error) ||
|
|
35
|
-
typeof error.stack !== "string") {
|
|
35
|
+
const error = ev?.error;
|
|
36
|
+
if (!error || !(error instanceof Error) || typeof error.stack !== 'string') {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
ExceptionsManager_1.default.handleException(error);
|
|
39
40
|
}
|
|
40
41
|
function onUnhandledRejection(ev) {
|
|
41
42
|
hasError.current = true;
|
|
42
|
-
const reason = ev
|
|
43
|
-
if (!reason ||
|
|
44
|
-
!(reason instanceof Error) ||
|
|
45
|
-
typeof reason.stack !== "string") {
|
|
43
|
+
const reason = ev?.reason;
|
|
44
|
+
if (!reason || !(reason instanceof Error) || typeof reason.stack !== 'string') {
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
47
|
ExceptionsManager_1.default.handleException(reason);
|
|
49
48
|
}
|
|
50
|
-
window.addEventListener(
|
|
51
|
-
window.addEventListener(
|
|
49
|
+
window.addEventListener('unhandledrejection', onUnhandledRejection);
|
|
50
|
+
window.addEventListener('error', onUnhandledError);
|
|
52
51
|
return () => {
|
|
53
|
-
window.removeEventListener(
|
|
54
|
-
window.removeEventListener(
|
|
52
|
+
window.removeEventListener('error', onUnhandledError);
|
|
53
|
+
window.removeEventListener('unhandledrejection', onUnhandledRejection);
|
|
55
54
|
};
|
|
56
55
|
}, []);
|
|
57
56
|
return hasError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRejectionHandler.js","sourceRoot":"","sources":["../../src/error-overlay/useRejectionHandler.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oFAA4D;AAE5D,SAAS,kBAAkB,CAAC,KAAa;IACvC,MAAM,OAAO,GAAG,eAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAChC,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI;YACF,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,CAAC;YAC3C,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC;YAC9B,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC;SAChC;QAAC,MAAM,GAAE;QACV,OAAO,GAAG,EAAE;YACV,IAAI;gBACF,KAAK,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;aACzC;YAAC,MAAM,GAAE;QACZ,CAAC,CAAC;IACJ,CAAC,EAAE,C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AAC;YAExB,MAAM,KAAK,GAAG,EAAE,EAAE,KAAK,CAAC;YACxB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;gBAC1E,OAAO;aACR;YAED,2BAAiB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QAED,SAAS,oBAAoB,CAAC,EAAyB;YACrD,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;YAExB,MAAM,MAAM,GAAG,EAAE,EAAE,MAAM,CAAC;YAC1B,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,YAAY,KAAK,CAAC,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE;gBAC7E,OAAO;aACR;YAED,2BAAiB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;QACpE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;YACtD,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;QACzE,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC;AArCD,kDAqCC","sourcesContent":["import React from 'react';\n\nimport ExceptionsManager from './modules/ExceptionsManager';\n\nfunction useStackTraceLimit(limit: number) {\n const current = React.useRef(0);\n React.useEffect(() => {\n try {\n // @ts-expect-error: StackTraceLimit is not defined in the Error type\n const currentLimit = Error.stackTraceLimit;\n // @ts-expect-error: StackTraceLimit is not defined in the Error type\n Error.stackTraceLimit = limit;\n current.current = currentLimit;\n } catch {}\n return () => {\n try {\n // @ts-expect-error: StackTraceLimit is not defined in the Error type\n Error.stackTraceLimit = current.current;\n } catch {}\n };\n }, [limit]);\n}\n\nexport function useRejectionHandler() {\n const hasError = React.useRef(false);\n\n useStackTraceLimit(35);\n\n React.useEffect(() => {\n function onUnhandledError(ev: ErrorEvent) {\n hasError.current = true;\n\n const error = ev?.error;\n if (!error || !(error instanceof Error) || typeof error.stack !== 'string') {\n return;\n }\n\n ExceptionsManager.handleException(error);\n }\n\n function onUnhandledRejection(ev: PromiseRejectionEvent) {\n hasError.current = true;\n\n const reason = ev?.reason;\n if (!reason || !(reason instanceof Error) || typeof reason.stack !== 'string') {\n return;\n }\n\n ExceptionsManager.handleException(reason);\n }\n\n window.addEventListener('unhandledrejection', onUnhandledRejection);\n window.addEventListener('error', onUnhandledError);\n return () => {\n window.removeEventListener('error', onUnhandledError);\n window.removeEventListener('unhandledrejection', onUnhandledRejection);\n };\n }, []);\n\n return hasError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevServer.d.ts","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY;;IAcd,0DAA0D;;;CAkB7D,CAAC;
|
|
1
|
+
{"version":3,"file":"getDevServer.d.ts","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY;;IAcd,0DAA0D;;;CAkB7D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/build/getDevServer.js
CHANGED
|
@@ -10,8 +10,8 @@ const getDevServer = () => {
|
|
|
10
10
|
if (!expo_modules_core_1.Platform.isDOMAvailable) {
|
|
11
11
|
return {
|
|
12
12
|
bundleLoadedFromServer: true,
|
|
13
|
-
fullBundleUrl:
|
|
14
|
-
url:
|
|
13
|
+
fullBundleUrl: '',
|
|
14
|
+
url: '',
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
return {
|
|
@@ -19,19 +19,18 @@ const getDevServer = () => {
|
|
|
19
19
|
bundleLoadedFromServer: true,
|
|
20
20
|
/** URL but ensures that platform query param is added. */
|
|
21
21
|
get fullBundleUrl() {
|
|
22
|
-
if (
|
|
22
|
+
if (document?.currentScript && 'src' in document.currentScript) {
|
|
23
23
|
return document.currentScript.src;
|
|
24
24
|
}
|
|
25
25
|
const url = window.location.toString();
|
|
26
26
|
const query = qs_1.default.parse(url);
|
|
27
27
|
return (location.origin +
|
|
28
28
|
location.pathname +
|
|
29
|
-
|
|
29
|
+
'?' +
|
|
30
30
|
qs_1.default.stringify({ ...query, platform: expo_modules_core_1.Platform.OS }));
|
|
31
31
|
},
|
|
32
32
|
url: location.origin + location.pathname,
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
module.exports = getDevServer;
|
|
36
35
|
exports.default = getDevServer;
|
|
37
36
|
//# sourceMappingURL=getDevServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevServer.js","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":";;;;;AAAA,yDAA6C;AAC7C,4CAAoB;AAEpB,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,kBAAkB;IAClB,IAAI,CAAC,4BAAQ,CAAC,cAAc,EAAE;QAC5B,OAAO;YACL,sBAAsB,EAAE,IAAI;YAC5B,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IAED,OAAO;QACL,4DAA4D;QAC5D,sBAAsB,EAAE,IAAI;QAE5B,0DAA0D;QAC1D,IAAI,aAAa;YACf,IAAI,
|
|
1
|
+
{"version":3,"file":"getDevServer.js","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":";;;;;AAAA,yDAA6C;AAC7C,4CAAoB;AAEpB,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,kBAAkB;IAClB,IAAI,CAAC,4BAAQ,CAAC,cAAc,EAAE;QAC5B,OAAO;YACL,sBAAsB,EAAE,IAAI;YAC5B,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IAED,OAAO;QACL,4DAA4D;QAC5D,sBAAsB,EAAE,IAAI;QAE5B,0DAA0D;QAC1D,IAAI,aAAa;YACf,IAAI,QAAQ,EAAE,aAAa,IAAI,KAAK,IAAI,QAAQ,CAAC,aAAa,EAAE;gBAC9D,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;aACnC;YAED,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACvC,MAAM,KAAK,GAAG,YAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAE5B,OAAO,CACL,QAAQ,CAAC,MAAM;gBACf,QAAQ,CAAC,QAAQ;gBACjB,GAAG;gBACH,YAAE,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,4BAAQ,CAAC,EAAE,EAAE,CAAC,CAClD,CAAC;QACJ,CAAC;QACD,GAAG,EAAE,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ;KACzC,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\nimport qs from 'qs';\n\nconst getDevServer = () => {\n // Disable for SSR\n if (!Platform.isDOMAvailable) {\n return {\n bundleLoadedFromServer: true,\n fullBundleUrl: '',\n url: '',\n };\n }\n\n return {\n // The bundle is always loaded from a server in the browser.\n bundleLoadedFromServer: true,\n\n /** URL but ensures that platform query param is added. */\n get fullBundleUrl() {\n if (document?.currentScript && 'src' in document.currentScript) {\n return document.currentScript.src;\n }\n\n const url = window.location.toString();\n const query = qs.parse(url);\n\n return (\n location.origin +\n location.pathname +\n '?' +\n qs.stringify({ ...query, platform: Platform.OS })\n );\n },\n url: location.origin + location.pathname,\n };\n};\n\nexport default getDevServer;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevServer.native.d.ts","sourceRoot":"","sources":["../src/getDevServer.native.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"getDevServer.native.d.ts","sourceRoot":"","sources":["../src/getDevServer.native.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mDAAmD,CAAC;AAE7E,eAAe,YAAY,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const getDevServer_1 = __importDefault(require("react-native/Libraries/Core/Devtools/getDevServer"));
|
|
7
|
+
exports.default = getDevServer_1.default;
|
|
3
8
|
//# sourceMappingURL=getDevServer.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevServer.native.js","sourceRoot":"","sources":["../src/getDevServer.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDevServer.native.js","sourceRoot":"","sources":["../src/getDevServer.native.ts"],"names":[],"mappings":";;;;;AAAA,qGAA6E;AAE7E,kBAAe,sBAAY,CAAC","sourcesContent":["import getDevServer from 'react-native/Libraries/Core/Devtools/getDevServer';\n\nexport default getDevServer;\n"]}
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
require("./location/install");
|
|
4
|
-
// IMPORT POSITION MATTERS FOR FAST REFRESH ON WEB
|
|
5
|
-
require("./effects");
|
|
6
4
|
// Ensure this is removed in production.
|
|
7
5
|
// TODO: Enable in production.
|
|
8
|
-
if (process.env.NODE_ENV !==
|
|
6
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7
|
+
// IMPORT POSITION MATTERS FOR FAST REFRESH ON WEB
|
|
8
|
+
require('./effects');
|
|
9
9
|
// vvv EVERYTHING ELSE vvv
|
|
10
|
-
require(
|
|
10
|
+
require('./async-require');
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,8BAA4B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,8BAA4B;AAE5B,wCAAwC;AACxC,8BAA8B;AAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,kDAAkD;IAClD,OAAO,CAAC,WAAW,CAAC,CAAC;IACrB,0BAA0B;IAC1B,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5B","sourcesContent":["import './location/install';\n\n// Ensure this is removed in production.\n// TODO: Enable in production.\nif (process.env.NODE_ENV !== 'production') {\n // IMPORT POSITION MATTERS FOR FAST REFRESH ON WEB\n require('./effects');\n // vvv EVERYTHING ELSE vvv\n require('./async-require');\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Location.native.d.ts","sourceRoot":"","sources":["../../src/location/Location.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Location.native.d.ts","sourceRoot":"","sources":["../../src/location/Location.native.ts"],"names":[],"mappings":"AAoLA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,QAE3C;AAED,wBAAgB,OAAO,SAgBtB"}
|
|
@@ -24,16 +24,16 @@ class Location {
|
|
|
24
24
|
// @ts-expect-error
|
|
25
25
|
href);
|
|
26
26
|
// @ts-expect-error
|
|
27
|
-
url.username =
|
|
27
|
+
url.username = '';
|
|
28
28
|
// @ts-expect-error
|
|
29
|
-
url.password =
|
|
29
|
+
url.password = '';
|
|
30
30
|
Object.defineProperties(this, {
|
|
31
31
|
hash: {
|
|
32
32
|
get() {
|
|
33
33
|
return url.hash;
|
|
34
34
|
},
|
|
35
35
|
set() {
|
|
36
|
-
throw new DOMException(`Cannot set "location.hash".`,
|
|
36
|
+
throw new DOMException(`Cannot set "location.hash".`, 'NotSupportedError');
|
|
37
37
|
},
|
|
38
38
|
enumerable: true,
|
|
39
39
|
},
|
|
@@ -42,7 +42,7 @@ class Location {
|
|
|
42
42
|
return url.host;
|
|
43
43
|
},
|
|
44
44
|
set() {
|
|
45
|
-
throw new DOMException(`Cannot set "location.host".`,
|
|
45
|
+
throw new DOMException(`Cannot set "location.host".`, 'NotSupportedError');
|
|
46
46
|
},
|
|
47
47
|
enumerable: true,
|
|
48
48
|
},
|
|
@@ -51,7 +51,7 @@ class Location {
|
|
|
51
51
|
return url.hostname;
|
|
52
52
|
},
|
|
53
53
|
set() {
|
|
54
|
-
throw new DOMException(`Cannot set "location.hostname".`,
|
|
54
|
+
throw new DOMException(`Cannot set "location.hostname".`, 'NotSupportedError');
|
|
55
55
|
},
|
|
56
56
|
enumerable: true,
|
|
57
57
|
},
|
|
@@ -60,7 +60,7 @@ class Location {
|
|
|
60
60
|
return url.href;
|
|
61
61
|
},
|
|
62
62
|
set() {
|
|
63
|
-
throw new DOMException(`Cannot set "location.href".`,
|
|
63
|
+
throw new DOMException(`Cannot set "location.href".`, 'NotSupportedError');
|
|
64
64
|
},
|
|
65
65
|
enumerable: true,
|
|
66
66
|
},
|
|
@@ -75,7 +75,7 @@ class Location {
|
|
|
75
75
|
return url.pathname;
|
|
76
76
|
},
|
|
77
77
|
set() {
|
|
78
|
-
throw new DOMException(`Cannot set "location.pathname".`,
|
|
78
|
+
throw new DOMException(`Cannot set "location.pathname".`, 'NotSupportedError');
|
|
79
79
|
},
|
|
80
80
|
enumerable: true,
|
|
81
81
|
},
|
|
@@ -84,7 +84,7 @@ class Location {
|
|
|
84
84
|
return url.port;
|
|
85
85
|
},
|
|
86
86
|
set() {
|
|
87
|
-
throw new DOMException(`Cannot set "location.port".`,
|
|
87
|
+
throw new DOMException(`Cannot set "location.port".`, 'NotSupportedError');
|
|
88
88
|
},
|
|
89
89
|
enumerable: true,
|
|
90
90
|
},
|
|
@@ -93,7 +93,7 @@ class Location {
|
|
|
93
93
|
return url.protocol;
|
|
94
94
|
},
|
|
95
95
|
set() {
|
|
96
|
-
throw new DOMException(`Cannot set "location.protocol".`,
|
|
96
|
+
throw new DOMException(`Cannot set "location.protocol".`, 'NotSupportedError');
|
|
97
97
|
},
|
|
98
98
|
enumerable: true,
|
|
99
99
|
},
|
|
@@ -103,7 +103,7 @@ class Location {
|
|
|
103
103
|
return url.search;
|
|
104
104
|
},
|
|
105
105
|
set() {
|
|
106
|
-
throw new DOMException(`Cannot set "location.search".`,
|
|
106
|
+
throw new DOMException(`Cannot set "location.search".`, 'NotSupportedError');
|
|
107
107
|
},
|
|
108
108
|
enumerable: true,
|
|
109
109
|
},
|
|
@@ -119,29 +119,30 @@ class Location {
|
|
|
119
119
|
},
|
|
120
120
|
assign: {
|
|
121
121
|
value: function assign() {
|
|
122
|
-
throw new DOMException(`Cannot call "location.assign()".`,
|
|
122
|
+
throw new DOMException(`Cannot call "location.assign()".`, 'NotSupportedError');
|
|
123
123
|
},
|
|
124
124
|
enumerable: true,
|
|
125
125
|
},
|
|
126
126
|
reload: {
|
|
127
127
|
value: function reload() {
|
|
128
|
-
if (process.env.NODE_ENV !==
|
|
128
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
129
129
|
// NOTE: This does change how native fast refresh works. The upstream metro-runtime will check
|
|
130
130
|
// if `location.reload` exists before falling back on an implementation that is nearly identical to
|
|
131
131
|
// this. The main difference is that on iOS there is a "reason" message sent, but at the time of writing
|
|
132
132
|
// this, that message is unused (ref: `RCTTriggerReloadCommandNotification`).
|
|
133
|
-
const DevSettings = require(
|
|
133
|
+
const DevSettings = require('react-native')
|
|
134
|
+
.DevSettings;
|
|
134
135
|
return DevSettings.reload();
|
|
135
136
|
}
|
|
136
137
|
else {
|
|
137
|
-
throw new DOMException(`Cannot call "location.reload()".`,
|
|
138
|
+
throw new DOMException(`Cannot call "location.reload()".`, 'NotSupportedError');
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
141
|
enumerable: true,
|
|
141
142
|
},
|
|
142
143
|
replace: {
|
|
143
144
|
value: function replace() {
|
|
144
|
-
throw new DOMException(`Cannot call "location.replace()".`,
|
|
145
|
+
throw new DOMException(`Cannot call "location.replace()".`, 'NotSupportedError');
|
|
145
146
|
},
|
|
146
147
|
enumerable: true,
|
|
147
148
|
},
|
|
@@ -151,7 +152,7 @@ class Location {
|
|
|
151
152
|
},
|
|
152
153
|
enumerable: true,
|
|
153
154
|
},
|
|
154
|
-
[Symbol.for(
|
|
155
|
+
[Symbol.for('Expo.privateCustomInspect')]: {
|
|
155
156
|
value(inspect) {
|
|
156
157
|
const object = {
|
|
157
158
|
hash: this.hash,
|
|
@@ -172,7 +173,7 @@ class Location {
|
|
|
172
173
|
}
|
|
173
174
|
Object.defineProperties(Location.prototype, {
|
|
174
175
|
[Symbol.toString()]: {
|
|
175
|
-
value:
|
|
176
|
+
value: 'Location',
|
|
176
177
|
configurable: true,
|
|
177
178
|
},
|
|
178
179
|
});
|
|
@@ -182,17 +183,17 @@ function setLocationHref(href) {
|
|
|
182
183
|
}
|
|
183
184
|
exports.setLocationHref = setLocationHref;
|
|
184
185
|
function install() {
|
|
185
|
-
Object.defineProperty(global,
|
|
186
|
+
Object.defineProperty(global, 'Location', {
|
|
186
187
|
value: Location,
|
|
187
188
|
configurable: true,
|
|
188
189
|
writable: true,
|
|
189
190
|
});
|
|
190
|
-
Object.defineProperty(window,
|
|
191
|
+
Object.defineProperty(window, 'location', {
|
|
191
192
|
get() {
|
|
192
193
|
return location;
|
|
193
194
|
},
|
|
194
195
|
set() {
|
|
195
|
-
throw new DOMException(`Cannot set "location".`,
|
|
196
|
+
throw new DOMException(`Cannot set "location".`, 'NotSupportedError');
|
|
196
197
|
},
|
|
197
198
|
enumerable: true,
|
|
198
199
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Location.native.js","sourceRoot":"","sources":["../../src/location/Location.native.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,0EAA0E;;;;;;AAE1E,0DAA4B;AAE5B,MAAM,YAAa,SAAQ,KAAK;IAC9B,YAAY,OAAe,EAAE,IAAY;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,6EAA6E;AAC7E,uEAAuE;AACvE,gCAAgC;AAChC,+EAA+E;AAC/E,uDAAuD;AACvD,MAAM,QAAQ;IACZ,YAAY,OAAsB,IAAI;QACpC,MAAM,GAAG,GAAG,IAAI,mBAAG;QACjB,mBAAmB;QACnB,IAAI,CACL,CAAC;QACF,mBAAmB;QACnB,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;QAClB,mBAAmB;QACnB,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;QAClB,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;YAC5B,IAAI,EAAE;gBACJ,GAAG;oBACD,OAAO,GAAG,CAAC,IAAI,CAAC;gBAClB,CAAC;gBACD,GAAG;oBACD,MAAM,IAAI,YAAY,CACpB,6BAA6B,EAC7B,mBAAmB,CACpB,CAAC;gBACJ,CAAC;gBACD,UAAU,EAAE,IAAI;aACjB;YACD,IAAI,EAAE;gBACJ,GAAG;oBACD,OAAO,GAAG,CAAC,IAAI,CAAC;gBAClB,CAAC;gBACD,GAAG;oBACD,MAAM,IAAI,Y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MAAM,IAAI,YAAY,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAAC;QACxE,CAAC;QACD,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;AACL,CAAC;AAhBD,0BAgBC","sourcesContent":["// Copyright © 2023 650 Industries.\n// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.\n\nimport URL from \"url-parse\";\n\nclass DOMException extends Error {\n constructor(message: string, name: string) {\n super(message);\n this.name = name;\n }\n}\n\n// The differences between the definitions of `Location` and `WorkerLocation`\n// are because of the `LegacyUnforgeable` attribute only specified upon\n// `Location`'s properties. See:\n// - https://html.spec.whatwg.org/multipage/history.html#the-location-interface\n// - https://heycam.github.io/webidl/#LegacyUnforgeable\nclass Location {\n constructor(href: string | null = null) {\n const url = new URL(\n // @ts-expect-error\n href\n );\n // @ts-expect-error\n url.username = \"\";\n // @ts-expect-error\n url.password = \"\";\n Object.defineProperties(this, {\n hash: {\n get() {\n return url.hash;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.hash\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n host: {\n get() {\n return url.host;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.host\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n hostname: {\n get() {\n return url.hostname;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.hostname\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n href: {\n get() {\n return url.href;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.href\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n origin: {\n get() {\n return url.origin;\n },\n enumerable: true,\n },\n pathname: {\n get() {\n return url.pathname;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.pathname\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n port: {\n get() {\n return url.port;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.port\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n protocol: {\n get() {\n return url.protocol;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.protocol\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n search: {\n get() {\n // @ts-expect-error\n return url.search;\n },\n set() {\n throw new DOMException(\n `Cannot set \"location.search\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n ancestorOrigins: {\n get() {\n return {\n length: 0,\n item: () => null,\n contains: () => false,\n };\n },\n enumerable: true,\n },\n assign: {\n value: function assign() {\n throw new DOMException(\n `Cannot call \"location.assign()\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n reload: {\n value: function reload() {\n if (process.env.NODE_ENV !== \"production\") {\n // NOTE: This does change how native fast refresh works. The upstream metro-runtime will check\n // if `location.reload` exists before falling back on an implementation that is nearly identical to\n // this. The main difference is that on iOS there is a \"reason\" message sent, but at the time of writing\n // this, that message is unused (ref: `RCTTriggerReloadCommandNotification`).\n const DevSettings = (\n require(\"react-native\") as typeof import(\"react-native\")\n ).DevSettings;\n return DevSettings.reload();\n } else {\n throw new DOMException(\n `Cannot call \"location.reload()\".`,\n \"NotSupportedError\"\n );\n }\n },\n enumerable: true,\n },\n replace: {\n value: function replace() {\n throw new DOMException(\n `Cannot call \"location.replace()\".`,\n \"NotSupportedError\"\n );\n },\n enumerable: true,\n },\n toString: {\n value: function toString() {\n return url.href;\n },\n enumerable: true,\n },\n [Symbol.for(\"Expo.privateCustomInspect\")]: {\n value(inspect: any) {\n const object = {\n hash: this.hash,\n host: this.host,\n hostname: this.hostname,\n href: this.href,\n origin: this.origin,\n pathname: this.pathname,\n port: this.port,\n protocol: this.protocol,\n search: this.search,\n };\n return `${this.constructor.name} ${inspect(object)}`;\n },\n },\n });\n }\n}\n\nObject.defineProperties(Location.prototype, {\n [Symbol.toString()]: {\n value: \"Location\",\n configurable: true,\n },\n});\n\nlet location: Location | undefined = undefined;\n\nexport function setLocationHref(href: string) {\n location = new Location(href);\n}\n\nexport function install() {\n Object.defineProperty(global, \"Location\", {\n value: Location,\n configurable: true,\n writable: true,\n });\n\n Object.defineProperty(window, \"location\", {\n get() {\n return location;\n },\n set() {\n throw new DOMException(`Cannot set \"location\".`, \"NotSupportedError\");\n },\n enumerable: true,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Location.native.js","sourceRoot":"","sources":["../../src/location/Location.native.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,0EAA0E;;;;;;AAE1E,0DAA4B;AAE5B,MAAM,YAAa,SAAQ,KAAK;IAC9B,YAAY,OAAe,EAAE,IAAY;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,6EAA6E;AAC7E,uEAAuE;AACvE,gCAAgC;AAChC,+EAA+E;AAC/E,uDAAuD;AACvD,MAAM,QAAQ;IACZ,YAAY,OAAsB,IAAI;QACpC,MAAM,GAAG,GAAG,IAAI,mBAAG;QACjB,mBAAmB;QACnB,IAAI,CACL,CAAC;QACF,mBAAmB;QACnB,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;QAClB,mBAAmB;QACnB,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;QAClB,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;YAC5B,IAAI,EAAE;gBACJ,GAAG;oBACD,OAAO,GAAG,CAAC,IAAI,CAAC;gBAClB,CAAC;gBACD,GAAG;oBACD,MAAM,IAAI,YAAY,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;gBAC7E,CAAC;gBACD,UAAU,EAAE,IAAI;aACjB;YACD,IAAI,EAAE;gBACJ,GAAG;oBACD,OAAO,GAAG,CAAC,IAAI,CAAC;gBAClB,CAAC;gBACD,GAAG;oBACD,MAAM,IAAI,YAAY,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;gBAC7E,CAAC;gBACD,UAAU,EAAE,IAAI;aACjB;YACD,QAAQ,EAAE;gBACR,GAA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AACL,CAAC;AAhBD,0BAgBC","sourcesContent":["// Copyright © 2023 650 Industries.\n// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.\n\nimport URL from 'url-parse';\n\nclass DOMException extends Error {\n constructor(message: string, name: string) {\n super(message);\n this.name = name;\n }\n}\n\n// The differences between the definitions of `Location` and `WorkerLocation`\n// are because of the `LegacyUnforgeable` attribute only specified upon\n// `Location`'s properties. See:\n// - https://html.spec.whatwg.org/multipage/history.html#the-location-interface\n// - https://heycam.github.io/webidl/#LegacyUnforgeable\nclass Location {\n constructor(href: string | null = null) {\n const url = new URL(\n // @ts-expect-error\n href\n );\n // @ts-expect-error\n url.username = '';\n // @ts-expect-error\n url.password = '';\n Object.defineProperties(this, {\n hash: {\n get() {\n return url.hash;\n },\n set() {\n throw new DOMException(`Cannot set \"location.hash\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n host: {\n get() {\n return url.host;\n },\n set() {\n throw new DOMException(`Cannot set \"location.host\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n hostname: {\n get() {\n return url.hostname;\n },\n set() {\n throw new DOMException(`Cannot set \"location.hostname\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n href: {\n get() {\n return url.href;\n },\n set() {\n throw new DOMException(`Cannot set \"location.href\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n origin: {\n get() {\n return url.origin;\n },\n enumerable: true,\n },\n pathname: {\n get() {\n return url.pathname;\n },\n set() {\n throw new DOMException(`Cannot set \"location.pathname\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n port: {\n get() {\n return url.port;\n },\n set() {\n throw new DOMException(`Cannot set \"location.port\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n protocol: {\n get() {\n return url.protocol;\n },\n set() {\n throw new DOMException(`Cannot set \"location.protocol\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n search: {\n get() {\n // @ts-expect-error\n return url.search;\n },\n set() {\n throw new DOMException(`Cannot set \"location.search\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n ancestorOrigins: {\n get() {\n return {\n length: 0,\n item: () => null,\n contains: () => false,\n };\n },\n enumerable: true,\n },\n assign: {\n value: function assign() {\n throw new DOMException(`Cannot call \"location.assign()\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n reload: {\n value: function reload() {\n if (process.env.NODE_ENV !== 'production') {\n // NOTE: This does change how native fast refresh works. The upstream metro-runtime will check\n // if `location.reload` exists before falling back on an implementation that is nearly identical to\n // this. The main difference is that on iOS there is a \"reason\" message sent, but at the time of writing\n // this, that message is unused (ref: `RCTTriggerReloadCommandNotification`).\n const DevSettings = (require('react-native') as typeof import('react-native'))\n .DevSettings;\n return DevSettings.reload();\n } else {\n throw new DOMException(`Cannot call \"location.reload()\".`, 'NotSupportedError');\n }\n },\n enumerable: true,\n },\n replace: {\n value: function replace() {\n throw new DOMException(`Cannot call \"location.replace()\".`, 'NotSupportedError');\n },\n enumerable: true,\n },\n toString: {\n value: function toString() {\n return url.href;\n },\n enumerable: true,\n },\n [Symbol.for('Expo.privateCustomInspect')]: {\n value(inspect: any) {\n const object = {\n hash: this.hash,\n host: this.host,\n hostname: this.hostname,\n href: this.href,\n origin: this.origin,\n pathname: this.pathname,\n port: this.port,\n protocol: this.protocol,\n search: this.search,\n };\n return `${this.constructor.name} ${inspect(object)}`;\n },\n },\n });\n }\n}\n\nObject.defineProperties(Location.prototype, {\n [Symbol.toString()]: {\n value: 'Location',\n configurable: true,\n },\n});\n\nlet location: Location | undefined = undefined;\n\nexport function setLocationHref(href: string) {\n location = new Location(href);\n}\n\nexport function install() {\n Object.defineProperty(global, 'Location', {\n value: Location,\n configurable: true,\n writable: true,\n });\n\n Object.defineProperty(window, 'location', {\n get() {\n return location;\n },\n set() {\n throw new DOMException(`Cannot set \"location\".`, 'NotSupportedError');\n },\n enumerable: true,\n });\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'react-native/Libraries/Core/InitializeCore';
|
|
2
2
|
//# sourceMappingURL=install.native.d.ts.map
|
|
@@ -2,65 +2,59 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
var _a, _b;
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
// This MUST be first to ensure that `fetch` is defined in the React Native environment.
|
|
8
7
|
require("react-native/Libraries/Core/InitializeCore");
|
|
9
8
|
const expo_constants_1 = __importDefault(require("expo-constants"));
|
|
10
9
|
const url_parse_1 = __importDefault(require("url-parse"));
|
|
11
|
-
const getDevServer_1 = __importDefault(require("../getDevServer"));
|
|
12
10
|
const Location_1 = require("./Location");
|
|
11
|
+
const getDevServer_1 = __importDefault(require("../getDevServer"));
|
|
13
12
|
let hasWarned = false;
|
|
14
13
|
const manifest = expo_constants_1.default.expoConfig;
|
|
15
14
|
// Add a development warning for fetch requests with relative paths
|
|
16
15
|
// to ensure developers are aware of the need to configure a production
|
|
17
16
|
// base URL in the Expo config (app.json) under `expo.extra.router.origin`.
|
|
18
17
|
function warnProductionOriginNotConfigured(requestUrl) {
|
|
19
|
-
var _a, _b;
|
|
20
18
|
if (hasWarned) {
|
|
21
19
|
return;
|
|
22
20
|
}
|
|
23
21
|
hasWarned = true;
|
|
24
|
-
if (!
|
|
22
|
+
if (!manifest?.extra?.router?.origin) {
|
|
25
23
|
console.warn(`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)`);
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
// TODO: This would be better if native and tied as close to the JS engine as possible, i.e. it should
|
|
29
27
|
// reflect the exact location of the JS file that was executed.
|
|
30
28
|
function getBaseUrl() {
|
|
31
|
-
|
|
32
|
-
if (process.env.NODE_ENV !== "production") {
|
|
29
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
33
30
|
// e.g. http://localhost:19006
|
|
34
|
-
return (
|
|
31
|
+
return (0, getDevServer_1.default)().url?.replace(/\/$/, '');
|
|
35
32
|
}
|
|
36
33
|
// TODO: Make it official by moving out of `extra`
|
|
37
|
-
const productionBaseUrl =
|
|
34
|
+
const productionBaseUrl = manifest?.extra?.router?.origin;
|
|
38
35
|
if (!productionBaseUrl) {
|
|
39
36
|
return null;
|
|
40
37
|
}
|
|
41
38
|
// Ensure no trailing slash
|
|
42
|
-
return productionBaseUrl
|
|
39
|
+
return productionBaseUrl?.replace(/\/$/, '');
|
|
43
40
|
}
|
|
44
41
|
function wrapFetchWithWindowLocation(fetch) {
|
|
45
42
|
if (fetch.__EXPO_BASE_URL_POLYFILLED) {
|
|
46
43
|
return fetch;
|
|
47
44
|
}
|
|
48
45
|
const _fetch = (...props) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (process.env.NODE_ENV !== "production") {
|
|
46
|
+
if (props[0] && typeof props[0] === 'string' && props[0].startsWith('/')) {
|
|
47
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
52
48
|
warnProductionOriginNotConfigured(props[0]);
|
|
53
49
|
}
|
|
54
|
-
props[0] = new url_parse_1.default(props[0],
|
|
50
|
+
props[0] = new url_parse_1.default(props[0], window.location?.origin).toString();
|
|
55
51
|
}
|
|
56
|
-
else if (props[0] && typeof props[0] ===
|
|
57
|
-
if (props[0].url &&
|
|
58
|
-
|
|
59
|
-
props[0].url.startsWith("/")) {
|
|
60
|
-
if (process.env.NODE_ENV !== "production") {
|
|
52
|
+
else if (props[0] && typeof props[0] === 'object') {
|
|
53
|
+
if (props[0].url && typeof props[0].url === 'string' && props[0].url.startsWith('/')) {
|
|
54
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
61
55
|
warnProductionOriginNotConfigured(props[0]);
|
|
62
56
|
}
|
|
63
|
-
props[0].url = new url_parse_1.default(props[0].url,
|
|
57
|
+
props[0].url = new url_parse_1.default(props[0].url, window.location?.origin).toString();
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
return fetch(...props);
|
|
@@ -68,9 +62,9 @@ function wrapFetchWithWindowLocation(fetch) {
|
|
|
68
62
|
_fetch.__EXPO_BASE_URL_POLYFILLED = true;
|
|
69
63
|
return _fetch;
|
|
70
64
|
}
|
|
71
|
-
if (
|
|
65
|
+
if (manifest?.extra?.router?.origin !== false) {
|
|
72
66
|
// Polyfill window.location in native runtimes.
|
|
73
|
-
if (typeof window !==
|
|
67
|
+
if (typeof window !== 'undefined' && !window.location) {
|
|
74
68
|
const url = getBaseUrl();
|
|
75
69
|
if (url) {
|
|
76
70
|
(0, Location_1.setLocationHref)(url);
|
|
@@ -78,7 +72,7 @@ if (((_b = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.ex
|
|
|
78
72
|
}
|
|
79
73
|
}
|
|
80
74
|
// Polyfill native fetch to support relative URLs
|
|
81
|
-
Object.defineProperty(global,
|
|
75
|
+
Object.defineProperty(global, 'fetch', {
|
|
82
76
|
value: wrapFetchWithWindowLocation(fetch),
|
|
83
77
|
});
|
|
84
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.native.js","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.native.js","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":";;;;;AAAA,wFAAwF;AACxF,sDAAoD;AAEpD,oEAAuC;AACvC,0DAA4B;AAE5B,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;QACb,OAAO;KACR;IACD,SAAS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Libraries/Core/InitializeCore';\n\nimport Constants from 'expo-constants';\nimport URL from 'url-parse';\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.d.ts","sourceRoot":"","sources":["../src/messageSocket.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,QAAQ,QAAuD,CAAC;AACtE,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"messageSocket.d.ts","sourceRoot":"","sources":["../src/messageSocket.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,QAAQ,QAAuD,CAAC;AACtE,QAAA,MAAM,aAAa,WAAiE,CAAC"}
|
package/build/messageSocket.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-env browser */
|
|
3
2
|
// Setup websocket messages for reloading the page from the command line.
|
|
4
3
|
// This is normally setup on the native client.
|
|
5
|
-
const protocol = window.location.protocol ===
|
|
4
|
+
const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
|
6
5
|
const messageSocket = new WebSocket(`${protocol}://${window.location.host}/message`);
|
|
7
6
|
messageSocket.onmessage = (message) => {
|
|
8
7
|
const data = JSON.parse(String(message.data));
|
|
9
8
|
switch (data.method) {
|
|
10
|
-
case
|
|
9
|
+
case 'sendDevCommand':
|
|
11
10
|
switch (data.params.name) {
|
|
12
|
-
case
|
|
11
|
+
case 'reload':
|
|
13
12
|
window.location.reload();
|
|
14
13
|
break;
|
|
15
14
|
}
|
|
16
15
|
break;
|
|
17
|
-
case
|
|
16
|
+
case 'reload':
|
|
18
17
|
window.location.reload();
|
|
19
18
|
break;
|
|
20
|
-
case
|
|
19
|
+
case 'devMenu':
|
|
21
20
|
// no-op
|
|
22
21
|
break;
|
|
23
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageSocket.js","sourceRoot":"","sources":["../src/messageSocket.ts"],"names":[],"mappings":"
|
|
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;QACnB,KAAK,gBAAgB;YACnB,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBACxB,KAAK,QAAQ;oBACX,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACzB,MAAM;aACT;YACD,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM;QACR,KAAK,SAAS;YACZ,QAAQ;YACR,MAAM;KACT;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.d.ts","sourceRoot":"","sources":["../src/setupFastRefresh.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,KAAmC,CAAC;AAG7D,QAAA,MAAM,OAAO;;;;;;;
|
|
1
|
+
{"version":3,"file":"setupFastRefresh.d.ts","sourceRoot":"","sources":["../src/setupFastRefresh.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,KAAmC,CAAC;AAG7D,QAAA,MAAM,OAAO;;;;;;;CAoBZ,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// This needs to run before the renderer initializes.
|
|
3
|
-
const ReactRefreshRuntime = require(
|
|
2
|
+
const ReactRefreshRuntime = require('react-refresh/runtime');
|
|
4
3
|
ReactRefreshRuntime.injectIntoGlobalHook(global);
|
|
5
4
|
const Refresh = {
|
|
6
5
|
performFullRefresh() {
|
|
@@ -20,6 +19,5 @@ const Refresh = {
|
|
|
20
19
|
};
|
|
21
20
|
// The metro require polyfill can not have dependencies (applies for all polyfills).
|
|
22
21
|
// Expose `Refresh` by assigning it to global to make it available in the polyfill.
|
|
23
|
-
|
|
24
|
-
global[(global.__METRO_GLOBAL_PREFIX__ || "") + "__ReactRefresh"] = Refresh;
|
|
22
|
+
global[(global.__METRO_GLOBAL_PREFIX__ || '') + '__ReactRefresh'] = Refresh;
|
|
25
23
|
//# sourceMappingURL=setupFastRefresh.js.map
|