@expo/metro-runtime 2.2.3 → 3.0.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.
Files changed (222) hide show
  1. package/README.md +17 -1
  2. package/async-require.d.ts +1 -1
  3. package/async-require.js +1 -1
  4. package/build/HMRClient.d.ts +1 -1
  5. package/build/HMRClient.d.ts.map +1 -1
  6. package/build/HMRClient.js +40 -68
  7. package/build/HMRClient.js.map +1 -1
  8. package/build/HMRClient.native.js +2 -4
  9. package/build/HMRClient.native.js.map +1 -1
  10. package/build/LoadingView.d.ts +1 -1
  11. package/build/LoadingView.d.ts.map +1 -1
  12. package/build/LoadingView.js +4 -10
  13. package/build/LoadingView.js.map +1 -1
  14. package/build/LoadingView.native.d.ts +2 -0
  15. package/build/LoadingView.native.d.ts.map +1 -1
  16. package/build/LoadingView.native.js +2 -2
  17. package/build/LoadingView.native.js.map +1 -1
  18. package/build/async-require/buildAsyncRequire.js +3 -7
  19. package/build/async-require/buildAsyncRequire.js.map +1 -1
  20. package/build/async-require/buildUrlForBundle.js +2 -6
  21. package/build/async-require/buildUrlForBundle.js.map +1 -1
  22. package/build/async-require/buildUrlForBundle.native.js +6 -9
  23. package/build/async-require/buildUrlForBundle.native.js.map +1 -1
  24. package/build/async-require/fetchAsync.d.ts.map +1 -1
  25. package/build/async-require/fetchAsync.js +4 -8
  26. package/build/async-require/fetchAsync.js.map +1 -1
  27. package/build/async-require/fetchAsync.native.d.ts +1 -1
  28. package/build/async-require/fetchAsync.native.d.ts.map +1 -1
  29. package/build/async-require/fetchAsync.native.js +14 -21
  30. package/build/async-require/fetchAsync.native.js.map +1 -1
  31. package/build/async-require/fetchThenEval.d.ts.map +1 -1
  32. package/build/async-require/fetchThenEval.js +5 -10
  33. package/build/async-require/fetchThenEval.js.map +1 -1
  34. package/build/async-require/fetchThenEval.web.d.ts.map +1 -1
  35. package/build/async-require/fetchThenEval.web.js +14 -27
  36. package/build/async-require/fetchThenEval.web.js.map +1 -1
  37. package/build/async-require/index.js +2 -6
  38. package/build/async-require/index.js.map +1 -1
  39. package/build/async-require/loadBundle.d.ts.map +1 -1
  40. package/build/async-require/loadBundle.js +14 -18
  41. package/build/async-require/loadBundle.js.map +1 -1
  42. package/build/effects.js +5 -7
  43. package/build/effects.js.map +1 -1
  44. package/build/effects.native.js +0 -1
  45. package/build/error-overlay/Data/LogBoxData.d.ts +5 -5
  46. package/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
  47. package/build/error-overlay/Data/LogBoxData.js +76 -127
  48. package/build/error-overlay/Data/LogBoxData.js.map +1 -1
  49. package/build/error-overlay/Data/LogBoxLog.d.ts +10 -10
  50. package/build/error-overlay/Data/LogBoxLog.d.ts.map +1 -1
  51. package/build/error-overlay/Data/LogBoxLog.js +46 -69
  52. package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
  53. package/build/error-overlay/Data/LogBoxSymbolication.d.ts +2 -2
  54. package/build/error-overlay/Data/LogBoxSymbolication.js +9 -17
  55. package/build/error-overlay/Data/LogBoxSymbolication.js.map +1 -1
  56. package/build/error-overlay/Data/LogContext.d.ts +2 -2
  57. package/build/error-overlay/Data/LogContext.d.ts.map +1 -1
  58. package/build/error-overlay/Data/LogContext.js +12 -20
  59. package/build/error-overlay/Data/LogContext.js.map +1 -1
  60. package/build/error-overlay/Data/parseLogBoxLog.d.ts +2 -2
  61. package/build/error-overlay/Data/parseLogBoxLog.d.ts.map +1 -1
  62. package/build/error-overlay/Data/parseLogBoxLog.js +35 -50
  63. package/build/error-overlay/Data/parseLogBoxLog.js.map +1 -1
  64. package/build/error-overlay/ErrorOverlay.d.ts +10 -3
  65. package/build/error-overlay/ErrorOverlay.d.ts.map +1 -1
  66. package/build/error-overlay/ErrorOverlay.js +55 -86
  67. package/build/error-overlay/ErrorOverlay.js.map +1 -1
  68. package/build/error-overlay/LogBox.d.ts +2 -2
  69. package/build/error-overlay/LogBox.d.ts.map +1 -1
  70. package/build/error-overlay/LogBox.js +1 -4
  71. package/build/error-overlay/LogBox.js.map +1 -1
  72. package/build/error-overlay/LogBox.web.d.ts +3 -3
  73. package/build/error-overlay/LogBox.web.d.ts.map +1 -1
  74. package/build/error-overlay/LogBox.web.js +12 -17
  75. package/build/error-overlay/LogBox.web.js.map +1 -1
  76. package/build/error-overlay/UI/AnsiHighlight.d.ts +2 -2
  77. package/build/error-overlay/UI/AnsiHighlight.d.ts.map +1 -1
  78. package/build/error-overlay/UI/AnsiHighlight.js +28 -36
  79. package/build/error-overlay/UI/AnsiHighlight.js.map +1 -1
  80. package/build/error-overlay/UI/LogBoxButton.d.ts +1 -1
  81. package/build/error-overlay/UI/LogBoxButton.d.ts.map +1 -1
  82. package/build/error-overlay/UI/LogBoxButton.js +18 -44
  83. package/build/error-overlay/UI/LogBoxButton.js.map +1 -1
  84. package/build/error-overlay/UI/LogBoxMessage.d.ts +2 -2
  85. package/build/error-overlay/UI/LogBoxMessage.d.ts.map +1 -1
  86. package/build/error-overlay/UI/LogBoxMessage.js +10 -17
  87. package/build/error-overlay/UI/LogBoxMessage.js.map +1 -1
  88. package/build/error-overlay/UI/LogBoxStyle.d.ts +1 -1
  89. package/build/error-overlay/UI/LogBoxStyle.js +15 -32
  90. package/build/error-overlay/UI/LogBoxStyle.js.map +1 -1
  91. package/build/error-overlay/UI/constants.js +5 -8
  92. package/build/error-overlay/UI/constants.js.map +1 -1
  93. package/build/error-overlay/formatProjectFilePath.d.ts +1 -1
  94. package/build/error-overlay/formatProjectFilePath.d.ts.map +1 -1
  95. package/build/error-overlay/formatProjectFilePath.js +7 -14
  96. package/build/error-overlay/formatProjectFilePath.js.map +1 -1
  97. package/build/error-overlay/index.d.ts +1 -1
  98. package/build/error-overlay/index.d.ts.map +1 -1
  99. package/build/error-overlay/index.js +9 -17
  100. package/build/error-overlay/index.js.map +1 -1
  101. package/build/error-overlay/modules/ExceptionsManager/index.d.ts +1 -1
  102. package/build/error-overlay/modules/ExceptionsManager/index.d.ts.map +1 -1
  103. package/build/error-overlay/modules/ExceptionsManager/index.js +11 -21
  104. package/build/error-overlay/modules/ExceptionsManager/index.js.map +1 -1
  105. package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts +2 -1
  106. package/build/error-overlay/modules/ExceptionsManager/index.native.d.ts.map +1 -1
  107. package/build/error-overlay/modules/ExceptionsManager/index.native.js +3 -3
  108. package/build/error-overlay/modules/ExceptionsManager/index.native.js.map +1 -1
  109. package/build/error-overlay/modules/NativeLogBox/index.d.ts.map +1 -1
  110. package/build/error-overlay/modules/NativeLogBox/index.js +10 -15
  111. package/build/error-overlay/modules/NativeLogBox/index.js.map +1 -1
  112. package/build/error-overlay/modules/NativeLogBox/index.native.d.ts +1 -1
  113. package/build/error-overlay/modules/NativeLogBox/index.native.d.ts.map +1 -1
  114. package/build/error-overlay/modules/NativeLogBox/index.native.js +2 -8
  115. package/build/error-overlay/modules/NativeLogBox/index.native.js.map +1 -1
  116. package/build/error-overlay/modules/openFileInEditor/index.js +5 -7
  117. package/build/error-overlay/modules/openFileInEditor/index.js.map +1 -1
  118. package/build/error-overlay/modules/openFileInEditor/index.native.d.ts +1 -1
  119. package/build/error-overlay/modules/openFileInEditor/index.native.d.ts.map +1 -1
  120. package/build/error-overlay/modules/openFileInEditor/index.native.js +2 -8
  121. package/build/error-overlay/modules/openFileInEditor/index.native.js.map +1 -1
  122. package/build/error-overlay/modules/parseErrorStack/index.d.ts +1 -1
  123. package/build/error-overlay/modules/parseErrorStack/index.d.ts.map +1 -1
  124. package/build/error-overlay/modules/parseErrorStack/index.js +4 -7
  125. package/build/error-overlay/modules/parseErrorStack/index.js.map +1 -1
  126. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.d.ts +1 -1
  127. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js +2 -8
  128. package/build/error-overlay/modules/parseErrorStack/parseHermesStack.js.map +1 -1
  129. package/build/error-overlay/modules/stringifySafe/index.d.ts +1 -1
  130. package/build/error-overlay/modules/stringifySafe/index.d.ts.map +1 -1
  131. package/build/error-overlay/modules/stringifySafe/index.js +16 -22
  132. package/build/error-overlay/modules/stringifySafe/index.js.map +1 -1
  133. package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts +2 -2
  134. package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts.map +1 -1
  135. package/build/error-overlay/modules/symbolicateStackTrace/index.js +6 -8
  136. package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -1
  137. package/build/error-overlay/modules/symbolicateStackTrace/index.native.d.ts +1 -1
  138. package/build/error-overlay/modules/symbolicateStackTrace/index.native.js +2 -7
  139. package/build/error-overlay/modules/symbolicateStackTrace/index.native.js.map +1 -1
  140. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts +2 -2
  141. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -1
  142. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +28 -58
  143. package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
  144. package/build/error-overlay/overlay/LogBoxInspectorFooter.d.ts.map +1 -1
  145. package/build/error-overlay/overlay/LogBoxInspectorFooter.js +35 -64
  146. package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
  147. package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts +1 -1
  148. package/build/error-overlay/overlay/LogBoxInspectorHeader.d.ts.map +1 -1
  149. package/build/error-overlay/overlay/LogBoxInspectorHeader.js +37 -71
  150. package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
  151. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts +2 -2
  152. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.d.ts.map +1 -1
  153. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +20 -54
  154. package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
  155. package/build/error-overlay/overlay/LogBoxInspectorSection.d.ts +2 -2
  156. package/build/error-overlay/overlay/LogBoxInspectorSection.js +13 -43
  157. package/build/error-overlay/overlay/LogBoxInspectorSection.js.map +1 -1
  158. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts +2 -2
  159. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.d.ts.map +1 -1
  160. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js +26 -55
  161. package/build/error-overlay/overlay/LogBoxInspectorSourceMapStatus.js.map +1 -1
  162. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts +2 -2
  163. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts.map +1 -1
  164. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +23 -53
  165. package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
  166. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts +2 -2
  167. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.d.ts.map +1 -1
  168. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js +42 -76
  169. package/build/error-overlay/overlay/LogBoxInspectorStackFrames.js.map +1 -1
  170. package/build/error-overlay/toast/ErrorToast.d.ts +2 -2
  171. package/build/error-overlay/toast/ErrorToast.d.ts.map +1 -1
  172. package/build/error-overlay/toast/ErrorToast.js +44 -72
  173. package/build/error-overlay/toast/ErrorToast.js.map +1 -1
  174. package/build/error-overlay/toast/ErrorToastContainer.d.ts +1 -1
  175. package/build/error-overlay/toast/ErrorToastContainer.js +3 -9
  176. package/build/error-overlay/toast/ErrorToastContainer.js.map +1 -1
  177. package/build/error-overlay/toast/ErrorToastContainer.web.d.ts +2 -2
  178. package/build/error-overlay/toast/ErrorToastContainer.web.d.ts.map +1 -1
  179. package/build/error-overlay/toast/ErrorToastContainer.web.js +22 -49
  180. package/build/error-overlay/toast/ErrorToastContainer.web.js.map +1 -1
  181. package/build/error-overlay/toast/ErrorToastMessage.d.ts +1 -1
  182. package/build/error-overlay/toast/ErrorToastMessage.d.ts.map +1 -1
  183. package/build/error-overlay/toast/ErrorToastMessage.js +8 -37
  184. package/build/error-overlay/toast/ErrorToastMessage.js.map +1 -1
  185. package/build/error-overlay/useRejectionHandler.d.ts +1 -1
  186. package/build/error-overlay/useRejectionHandler.d.ts.map +1 -1
  187. package/build/error-overlay/useRejectionHandler.js +20 -28
  188. package/build/error-overlay/useRejectionHandler.js.map +1 -1
  189. package/build/getDevServer.d.ts.map +1 -1
  190. package/build/getDevServer.js +10 -16
  191. package/build/getDevServer.js.map +1 -1
  192. package/build/getDevServer.native.d.ts +2 -0
  193. package/build/getDevServer.native.d.ts.map +1 -1
  194. package/build/getDevServer.native.js +2 -2
  195. package/build/getDevServer.native.js.map +1 -1
  196. package/build/index.d.ts +2 -2
  197. package/build/index.js +4 -6
  198. package/build/index.js.map +1 -1
  199. package/build/location/Location.js +2 -7
  200. package/build/location/Location.js.map +1 -1
  201. package/build/location/Location.native.d.ts.map +1 -1
  202. package/build/location/Location.native.js +25 -32
  203. package/build/location/Location.native.js.map +1 -1
  204. package/build/location/install.js +0 -1
  205. package/build/location/install.native.d.ts +1 -1
  206. package/build/location/install.native.js +23 -34
  207. package/build/location/install.native.js.map +1 -1
  208. package/build/messageSocket.d.ts.map +1 -1
  209. package/build/messageSocket.js +5 -6
  210. package/build/messageSocket.js.map +1 -1
  211. package/build/setupFastRefresh.d.ts.map +1 -1
  212. package/build/setupFastRefresh.js +2 -4
  213. package/build/setupFastRefresh.js.map +1 -1
  214. package/build/setupHMR.js +5 -12
  215. package/build/setupHMR.js.map +1 -1
  216. package/build/symbolicate.d.ts +3 -3
  217. package/build/symbolicate.js +4 -25
  218. package/build/symbolicate.js.map +1 -1
  219. package/error-overlay.d.ts +1 -1
  220. package/error-overlay.js +1 -1
  221. package/package.json +25 -14
  222. package/LICENSE +0 -13
@@ -1,17 +1,12 @@
1
- "use strict";
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 expo_modules_core_1 = require("expo-modules-core");
7
- const qs_1 = __importDefault(require("qs"));
1
+ import { Platform } from 'expo-modules-core';
2
+ import qs from 'qs';
8
3
  const getDevServer = () => {
9
4
  // Disable for SSR
10
- if (!expo_modules_core_1.Platform.isDOMAvailable) {
5
+ if (!Platform.isDOMAvailable) {
11
6
  return {
12
7
  bundleLoadedFromServer: true,
13
- fullBundleUrl: "",
14
- url: "",
8
+ fullBundleUrl: '',
9
+ url: '',
15
10
  };
16
11
  }
17
12
  return {
@@ -19,19 +14,18 @@ const getDevServer = () => {
19
14
  bundleLoadedFromServer: true,
20
15
  /** URL but ensures that platform query param is added. */
21
16
  get fullBundleUrl() {
22
- if ((document === null || document === void 0 ? void 0 : document.currentScript) && "src" in document.currentScript) {
17
+ if (document?.currentScript && 'src' in document.currentScript) {
23
18
  return document.currentScript.src;
24
19
  }
25
20
  const url = window.location.toString();
26
- const query = qs_1.default.parse(url);
21
+ const query = qs.parse(url);
27
22
  return (location.origin +
28
23
  location.pathname +
29
- "?" +
30
- qs_1.default.stringify({ ...query, platform: expo_modules_core_1.Platform.OS }));
24
+ '?' +
25
+ qs.stringify({ ...query, platform: Platform.OS }));
31
26
  },
32
27
  url: location.origin + location.pathname,
33
28
  };
34
29
  };
35
- module.exports = getDevServer;
36
- exports.default = getDevServer;
30
+ export default getDevServer;
37
31
  //# 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,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,KAAI,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,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC;AAC9B,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\nmodule.exports = getDevServer;\nexport default getDevServer;\n"]}
1
+ {"version":3,"file":"getDevServer.js","sourceRoot":"","sources":["../src/getDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,kBAAkB;IAClB,IAAI,CAAC,QAAQ,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,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAE5B,OAAO,CACL,QAAQ,CAAC,MAAM;gBACf,QAAQ,CAAC,QAAQ;gBACjB,GAAG;gBACH,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAClD,CAAC;QACJ,CAAC;QACD,GAAG,EAAE,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ;KACzC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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,3 @@
1
+ import getDevServer from 'react-native/Libraries/Core/Devtools/getDevServer';
2
+ export default getDevServer;
1
3
  //# sourceMappingURL=getDevServer.native.d.ts.map
@@ -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,3 @@
1
- "use strict";
2
- module.exports = require("react-native/Libraries/Core/Devtools/getDevServer");
1
+ import getDevServer from 'react-native/Libraries/Core/Devtools/getDevServer';
2
+ export default getDevServer;
3
3
  //# sourceMappingURL=getDevServer.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDevServer.native.js","sourceRoot":"","sources":["../src/getDevServer.native.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC","sourcesContent":["module.exports = require(\"react-native/Libraries/Core/Devtools/getDevServer\");\n"]}
1
+ {"version":3,"file":"getDevServer.native.js","sourceRoot":"","sources":["../src/getDevServer.native.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mDAAmD,CAAC;AAE7E,eAAe,YAAY,CAAC","sourcesContent":["import getDevServer from 'react-native/Libraries/Core/Devtools/getDevServer';\n\nexport default getDevServer;\n"]}
package/build/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import "./location/install";
2
- import "./effects";
1
+ import './location/install';
2
+ import './effects';
3
3
  //# sourceMappingURL=index.d.ts.map
package/build/index.js CHANGED
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("./location/install");
1
+ import './location/install';
4
2
  // IMPORT POSITION MATTERS FOR FAST REFRESH ON WEB
5
- require("./effects");
3
+ import './effects';
6
4
  // Ensure this is removed in production.
7
5
  // TODO: Enable in production.
8
- if (process.env.NODE_ENV !== "production") {
6
+ if (process.env.NODE_ENV !== 'production') {
9
7
  // vvv EVERYTHING ELSE vvv
10
- require("./async-require");
8
+ require('./async-require');
11
9
  }
12
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,8BAA4B;AAC5B,kDAAkD;AAClD,qBAAmB;AAEnB,wCAAwC;AACxC,8BAA8B;AAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,0BAA0B;IAC1B,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5B","sourcesContent":["import \"./location/install\";\n// IMPORT POSITION MATTERS FOR FAST REFRESH ON WEB\nimport \"./effects\";\n\n// Ensure this is removed in production.\n// TODO: Enable in production.\nif (process.env.NODE_ENV !== \"production\") {\n // vvv EVERYTHING ELSE vvv\n require(\"./async-require\");\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,kDAAkD;AAClD,OAAO,WAAW,CAAC;AAEnB,wCAAwC;AACxC,8BAA8B;AAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,0BAA0B;IAC1B,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5B","sourcesContent":["import './location/install';\n// IMPORT POSITION MATTERS FOR FAST REFRESH ON WEB\nimport './effects';\n\n// Ensure this is removed in production.\n// TODO: Enable in production.\nif (process.env.NODE_ENV !== 'production') {\n // vvv EVERYTHING ELSE vvv\n require('./async-require');\n}\n"]}
@@ -1,8 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setLocationHref = exports.install = void 0;
4
- function install() { }
5
- exports.install = install;
6
- function setLocationHref(href) { }
7
- exports.setLocationHref = setLocationHref;
1
+ export function install() { }
2
+ export function setLocationHref(href) { }
8
3
  //# sourceMappingURL=Location.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Location.js","sourceRoot":"","sources":["../../src/location/Location.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,KAAI,CAAC;AAA5B,0BAA4B;AAE5B,SAAgB,eAAe,CAAC,IAAY,IAAG,CAAC;AAAhD,0CAAgD","sourcesContent":["export function install() {}\n\nexport function setLocationHref(href: string) {}\n"]}
1
+ {"version":3,"file":"Location.js","sourceRoot":"","sources":["../../src/location/Location.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,KAAI,CAAC;AAE5B,MAAM,UAAU,eAAe,CAAC,IAAY,IAAG,CAAC","sourcesContent":["export function install() {}\n\nexport function setLocationHref(href: string) {}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Location.native.d.ts","sourceRoot":"","sources":["../../src/location/Location.native.ts"],"names":[],"mappings":"AAsNA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,QAE3C;AAED,wBAAgB,OAAO,SAgBtB"}
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"}
@@ -1,12 +1,6 @@
1
- "use strict";
2
1
  // Copyright © 2023 650 Industries.
3
2
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.install = exports.setLocationHref = void 0;
9
- const url_parse_1 = __importDefault(require("url-parse"));
3
+ import URL from 'url-parse';
10
4
  class DOMException extends Error {
11
5
  constructor(message, name) {
12
6
  super(message);
@@ -20,20 +14,20 @@ class DOMException extends Error {
20
14
  // - https://heycam.github.io/webidl/#LegacyUnforgeable
21
15
  class Location {
22
16
  constructor(href = null) {
23
- const url = new url_parse_1.default(
17
+ const url = new URL(
24
18
  // @ts-expect-error
25
19
  href);
26
20
  // @ts-expect-error
27
- url.username = "";
21
+ url.username = '';
28
22
  // @ts-expect-error
29
- url.password = "";
23
+ url.password = '';
30
24
  Object.defineProperties(this, {
31
25
  hash: {
32
26
  get() {
33
27
  return url.hash;
34
28
  },
35
29
  set() {
36
- throw new DOMException(`Cannot set "location.hash".`, "NotSupportedError");
30
+ throw new DOMException(`Cannot set "location.hash".`, 'NotSupportedError');
37
31
  },
38
32
  enumerable: true,
39
33
  },
@@ -42,7 +36,7 @@ class Location {
42
36
  return url.host;
43
37
  },
44
38
  set() {
45
- throw new DOMException(`Cannot set "location.host".`, "NotSupportedError");
39
+ throw new DOMException(`Cannot set "location.host".`, 'NotSupportedError');
46
40
  },
47
41
  enumerable: true,
48
42
  },
@@ -51,7 +45,7 @@ class Location {
51
45
  return url.hostname;
52
46
  },
53
47
  set() {
54
- throw new DOMException(`Cannot set "location.hostname".`, "NotSupportedError");
48
+ throw new DOMException(`Cannot set "location.hostname".`, 'NotSupportedError');
55
49
  },
56
50
  enumerable: true,
57
51
  },
@@ -60,7 +54,7 @@ class Location {
60
54
  return url.href;
61
55
  },
62
56
  set() {
63
- throw new DOMException(`Cannot set "location.href".`, "NotSupportedError");
57
+ throw new DOMException(`Cannot set "location.href".`, 'NotSupportedError');
64
58
  },
65
59
  enumerable: true,
66
60
  },
@@ -75,7 +69,7 @@ class Location {
75
69
  return url.pathname;
76
70
  },
77
71
  set() {
78
- throw new DOMException(`Cannot set "location.pathname".`, "NotSupportedError");
72
+ throw new DOMException(`Cannot set "location.pathname".`, 'NotSupportedError');
79
73
  },
80
74
  enumerable: true,
81
75
  },
@@ -84,7 +78,7 @@ class Location {
84
78
  return url.port;
85
79
  },
86
80
  set() {
87
- throw new DOMException(`Cannot set "location.port".`, "NotSupportedError");
81
+ throw new DOMException(`Cannot set "location.port".`, 'NotSupportedError');
88
82
  },
89
83
  enumerable: true,
90
84
  },
@@ -93,7 +87,7 @@ class Location {
93
87
  return url.protocol;
94
88
  },
95
89
  set() {
96
- throw new DOMException(`Cannot set "location.protocol".`, "NotSupportedError");
90
+ throw new DOMException(`Cannot set "location.protocol".`, 'NotSupportedError');
97
91
  },
98
92
  enumerable: true,
99
93
  },
@@ -103,7 +97,7 @@ class Location {
103
97
  return url.search;
104
98
  },
105
99
  set() {
106
- throw new DOMException(`Cannot set "location.search".`, "NotSupportedError");
100
+ throw new DOMException(`Cannot set "location.search".`, 'NotSupportedError');
107
101
  },
108
102
  enumerable: true,
109
103
  },
@@ -119,29 +113,30 @@ class Location {
119
113
  },
120
114
  assign: {
121
115
  value: function assign() {
122
- throw new DOMException(`Cannot call "location.assign()".`, "NotSupportedError");
116
+ throw new DOMException(`Cannot call "location.assign()".`, 'NotSupportedError');
123
117
  },
124
118
  enumerable: true,
125
119
  },
126
120
  reload: {
127
121
  value: function reload() {
128
- if (process.env.NODE_ENV !== "production") {
122
+ if (process.env.NODE_ENV !== 'production') {
129
123
  // NOTE: This does change how native fast refresh works. The upstream metro-runtime will check
130
124
  // if `location.reload` exists before falling back on an implementation that is nearly identical to
131
125
  // this. The main difference is that on iOS there is a "reason" message sent, but at the time of writing
132
126
  // this, that message is unused (ref: `RCTTriggerReloadCommandNotification`).
133
- const DevSettings = require("react-native").DevSettings;
127
+ const DevSettings = require('react-native')
128
+ .DevSettings;
134
129
  return DevSettings.reload();
135
130
  }
136
131
  else {
137
- throw new DOMException(`Cannot call "location.reload()".`, "NotSupportedError");
132
+ throw new DOMException(`Cannot call "location.reload()".`, 'NotSupportedError');
138
133
  }
139
134
  },
140
135
  enumerable: true,
141
136
  },
142
137
  replace: {
143
138
  value: function replace() {
144
- throw new DOMException(`Cannot call "location.replace()".`, "NotSupportedError");
139
+ throw new DOMException(`Cannot call "location.replace()".`, 'NotSupportedError');
145
140
  },
146
141
  enumerable: true,
147
142
  },
@@ -151,7 +146,7 @@ class Location {
151
146
  },
152
147
  enumerable: true,
153
148
  },
154
- [Symbol.for("Expo.privateCustomInspect")]: {
149
+ [Symbol.for('Expo.privateCustomInspect')]: {
155
150
  value(inspect) {
156
151
  const object = {
157
152
  hash: this.hash,
@@ -172,30 +167,28 @@ class Location {
172
167
  }
173
168
  Object.defineProperties(Location.prototype, {
174
169
  [Symbol.toString()]: {
175
- value: "Location",
170
+ value: 'Location',
176
171
  configurable: true,
177
172
  },
178
173
  });
179
174
  let location = undefined;
180
- function setLocationHref(href) {
175
+ export function setLocationHref(href) {
181
176
  location = new Location(href);
182
177
  }
183
- exports.setLocationHref = setLocationHref;
184
- function install() {
185
- Object.defineProperty(global, "Location", {
178
+ export function install() {
179
+ Object.defineProperty(global, 'Location', {
186
180
  value: Location,
187
181
  configurable: true,
188
182
  writable: true,
189
183
  });
190
- Object.defineProperty(window, "location", {
184
+ Object.defineProperty(window, 'location', {
191
185
  get() {
192
186
  return location;
193
187
  },
194
188
  set() {
195
- throw new DOMException(`Cannot set "location".`, "NotSupportedError");
189
+ throw new DOMException(`Cannot set "location".`, 'NotSupportedError');
196
190
  },
197
191
  enumerable: true,
198
192
  });
199
193
  }
200
- exports.install = install;
201
194
  //# sourceMappingURL=Location.native.js.map
@@ -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,IAA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AC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACvD,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,SAAS,EAAE;IAC1C,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE;QACnB,KAAK,EAAE,UAAU;QACjB,YAAY,EAAE,IAAI;KACnB;CACF,CAAC,CAAC;AAEH,IAAI,QAAQ,GAAyB,SAAS,CAAC;AAE/C,SAAgB,eAAe,CAAC,IAAY;IAC1C,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAFD,0CAEC;AAED,SAAgB,OAAO;IACrB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;QACxC,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;QACxC,GAAG;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,GAAG;YACD,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,OAAO,GAAG,MAAM,WAAW,CAAC;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;AA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ED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,SAAS,EAAE;IAC1C,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE;QACnB,KAAK,EAAE,UAAU;QACjB,YAAY,EAAE,IAAI;KACnB;CACF,CAAC,CAAC;AAEH,IAAI,QAAQ,GAAyB,SAAS,CAAC;AAE/C,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;QACxC,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;QACxC,GAAG;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,GAAG;YACD,MAAM,IAAI,YAAY,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAAC;QACxE,CAAC;QACD,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;AACL,CAAC","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 @@
1
- "use strict";
2
1
  //# sourceMappingURL=install.js.map
@@ -1,2 +1,2 @@
1
- import "react-native/Libraries/Core/InitializeCore";
1
+ import 'react-native/Libraries/Core/InitializeCore';
2
2
  //# sourceMappingURL=install.native.d.ts.map
@@ -1,66 +1,55 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a, _b;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
1
  // This MUST be first to ensure that `fetch` is defined in the React Native environment.
8
- require("react-native/Libraries/Core/InitializeCore");
9
- const expo_constants_1 = __importDefault(require("expo-constants"));
10
- const url_parse_1 = __importDefault(require("url-parse"));
11
- const getDevServer_1 = __importDefault(require("../getDevServer"));
12
- const Location_1 = require("./Location");
2
+ import 'react-native/Libraries/Core/InitializeCore';
3
+ import Constants from 'expo-constants';
4
+ import URL from 'url-parse';
5
+ import getDevServer from '../getDevServer';
6
+ import { install, setLocationHref } from './Location';
13
7
  let hasWarned = false;
14
- const manifest = expo_constants_1.default.expoConfig;
8
+ const manifest = Constants.expoConfig;
15
9
  // Add a development warning for fetch requests with relative paths
16
10
  // to ensure developers are aware of the need to configure a production
17
11
  // base URL in the Expo config (app.json) under `expo.extra.router.origin`.
18
12
  function warnProductionOriginNotConfigured(requestUrl) {
19
- var _a, _b;
20
13
  if (hasWarned) {
21
14
  return;
22
15
  }
23
16
  hasWarned = true;
24
- if (!((_b = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.extra) === null || _a === void 0 ? void 0 : _a.router) === null || _b === void 0 ? void 0 : _b.origin)) {
17
+ if (!manifest?.extra?.router?.origin) {
25
18
  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
19
  }
27
20
  }
28
21
  // TODO: This would be better if native and tied as close to the JS engine as possible, i.e. it should
29
22
  // reflect the exact location of the JS file that was executed.
30
23
  function getBaseUrl() {
31
- var _a, _b, _c;
32
- if (process.env.NODE_ENV !== "production") {
24
+ if (process.env.NODE_ENV !== 'production') {
33
25
  // e.g. http://localhost:19006
34
- return (_a = (0, getDevServer_1.default)().url) === null || _a === void 0 ? void 0 : _a.replace(/\/$/, "");
26
+ return getDevServer().url?.replace(/\/$/, '');
35
27
  }
36
28
  // TODO: Make it official by moving out of `extra`
37
- const productionBaseUrl = (_c = (_b = manifest === null || manifest === void 0 ? void 0 : manifest.extra) === null || _b === void 0 ? void 0 : _b.router) === null || _c === void 0 ? void 0 : _c.origin;
29
+ const productionBaseUrl = manifest?.extra?.router?.origin;
38
30
  if (!productionBaseUrl) {
39
31
  return null;
40
32
  }
41
33
  // Ensure no trailing slash
42
- return productionBaseUrl === null || productionBaseUrl === void 0 ? void 0 : productionBaseUrl.replace(/\/$/, "");
34
+ return productionBaseUrl?.replace(/\/$/, '');
43
35
  }
44
36
  function wrapFetchWithWindowLocation(fetch) {
45
37
  if (fetch.__EXPO_BASE_URL_POLYFILLED) {
46
38
  return fetch;
47
39
  }
48
40
  const _fetch = (...props) => {
49
- var _a, _b;
50
- if (props[0] && typeof props[0] === "string" && props[0].startsWith("/")) {
51
- if (process.env.NODE_ENV !== "production") {
41
+ if (props[0] && typeof props[0] === 'string' && props[0].startsWith('/')) {
42
+ if (process.env.NODE_ENV !== 'production') {
52
43
  warnProductionOriginNotConfigured(props[0]);
53
44
  }
54
- props[0] = new url_parse_1.default(props[0], (_a = window.location) === null || _a === void 0 ? void 0 : _a.origin).toString();
45
+ props[0] = new URL(props[0], window.location?.origin).toString();
55
46
  }
56
- else if (props[0] && typeof props[0] === "object") {
57
- if (props[0].url &&
58
- typeof props[0].url === "string" &&
59
- props[0].url.startsWith("/")) {
60
- if (process.env.NODE_ENV !== "production") {
47
+ else if (props[0] && typeof props[0] === 'object') {
48
+ if (props[0].url && typeof props[0].url === 'string' && props[0].url.startsWith('/')) {
49
+ if (process.env.NODE_ENV !== 'production') {
61
50
  warnProductionOriginNotConfigured(props[0]);
62
51
  }
63
- props[0].url = new url_parse_1.default(props[0].url, (_b = window.location) === null || _b === void 0 ? void 0 : _b.origin).toString();
52
+ props[0].url = new URL(props[0].url, window.location?.origin).toString();
64
53
  }
65
54
  }
66
55
  return fetch(...props);
@@ -68,17 +57,17 @@ function wrapFetchWithWindowLocation(fetch) {
68
57
  _fetch.__EXPO_BASE_URL_POLYFILLED = true;
69
58
  return _fetch;
70
59
  }
71
- if (((_b = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.extra) === null || _a === void 0 ? void 0 : _a.router) === null || _b === void 0 ? void 0 : _b.origin) !== false) {
60
+ if (manifest?.extra?.router?.origin !== false) {
72
61
  // Polyfill window.location in native runtimes.
73
- if (typeof window !== "undefined" && !window.location) {
62
+ if (typeof window !== 'undefined' && !window.location) {
74
63
  const url = getBaseUrl();
75
64
  if (url) {
76
- (0, Location_1.setLocationHref)(url);
77
- (0, Location_1.install)();
65
+ setLocationHref(url);
66
+ install();
78
67
  }
79
68
  }
80
69
  // Polyfill native fetch to support relative URLs
81
- Object.defineProperty(global, "fetch", {
70
+ Object.defineProperty(global, 'fetch', {
82
71
  value: wrapFetchWithWindowLocation(fetch),
83
72
  });
84
73
  }
@@ -1 +1 @@
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,mEAA2C;AAC3C,yCAAsD;AAEtD,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,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,CAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,0CAAE,MAAM,0CAAE,MAAM,CAAA,EAAE;QACpC,OAAO,CAAC,IAAI,CACV,+BAA+B,UAAU,+RAA+R,CACzU,CAAC;KACH;AACH,CAAC;AAED,sGAAsG;AACtG,+DAA+D;AAC/D,SAAS,UAAU;;IACjB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,8BAA8B;QAC9B,OAAO,MAAA,IAAA,sBAAY,GAAE,CAAC,GAAG,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;KAC/C;IAED,kDAAkD;IAClD,MAAM,iBAAiB,GAAG,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,0CAAE,MAAM,0CAAE,MAAM,CAAC;IAE1D,IAAI,C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,mBAAG,CACpB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,EACZ,MAAA,MAAM,CAAC,QAAQ,0CAAE,MAAM,CACxB,CAAC,QAAQ,EAAE,CAAC;aACd;SACF;QACD,OAAO,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,MAAM,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAEzC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,IAAI,CAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,0CAAE,MAAM,0CAAE,MAAM,MAAK,KAAK,EAAE;IAC7C,+CAA+C;IAC/C,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QACrD,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;QACzB,IAAI,GAAG,EAAE;YACP,IAAA,0BAAe,EAAC,GAAG,CAAC,CAAC;YACrB,IAAA,kBAAO,GAAE,CAAC;SACX;KACF;IACD,iDAAiD;IACjD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;QACrC,KAAK,EAAE,2BAA2B,CAAC,KAAK,CAAC;KAC1C,CAAC,CAAC;CACJ","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\";\nimport URL from \"url-parse\";\n\nimport getDevServer from \"../getDevServer\";\nimport { install, setLocationHref } from \"./Location\";\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(\n fetch: Function & { __EXPO_BASE_URL_POLYFILLED?: boolean }\n) {\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 (\n props[0].url &&\n typeof props[0].url === \"string\" &&\n props[0].url.startsWith(\"/\")\n ) {\n if (process.env.NODE_ENV !== \"production\") {\n warnProductionOriginNotConfigured(props[0]);\n }\n\n props[0].url = new URL(\n props[0].url,\n window.location?.origin\n ).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
+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AAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,KAAK,EAAE;IAC7C,+CAA+C;IAC/C,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QACrD,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;QACzB,IAAI,GAAG,EAAE;YACP,eAAe,CAAC,GAAG,CAAC,CAAC;YACrB,OAAO,EAAE,CAAC;SACX;KACF;IACD,iDAAiD;IACjD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;QACrC,KAAK,EAAE,2BAA2B,CAAC,KAAK,CAAC;KAC1C,CAAC,CAAC;CACJ","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';\nimport URL from 'url-parse';\n\nimport getDevServer from '../getDevServer';\nimport { install, setLocationHref } from './Location';\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,WAElB,CAAC"}
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"}
@@ -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 === "https:" ? "wss" : "ws";
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 "sendDevCommand":
9
+ case 'sendDevCommand':
11
10
  switch (data.params.name) {
12
- case "reload":
11
+ case 'reload':
13
12
  window.location.reload();
14
13
  break;
15
14
  }
16
15
  break;
17
- case "reload":
16
+ case 'reload':
18
17
  window.location.reload();
19
18
  break;
20
- case "devMenu":
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":";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,CACjC,GAAG,QAAQ,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,CAChD,CAAC;AACF,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(\n `${protocol}://${window.location.host}/message`\n);\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
+ {"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;;;;;;;CAqBZ,CAAC"}
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("react-refresh/runtime");
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
- // @ts-expect-error
24
- global[(global.__METRO_GLOBAL_PREFIX__ || "") + "__ReactRefresh"] = Refresh;
22
+ global[(global.__METRO_GLOBAL_PREFIX__ || '') + '__ReactRefresh'] = Refresh;
25
23
  //# sourceMappingURL=setupFastRefresh.js.map
@@ -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,EACjC,mBAAmB,CAAC,mCAAmC;IAEzD,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;YAChD,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO;SACR;QACD,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;IAC5C,CAAC;CACF,CAAC;AAEF,oFAAoF;AACpF,mFAAmF;AACnF,mBAAmB;AACnB,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:\n 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.\n// @ts-expect-error\nglobal[(global.__METRO_GLOBAL_PREFIX__ || \"\") + \"__ReactRefresh\"] = Refresh;\n"]}
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;YAChD,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,OAAO;SACR;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"]}