@expo/metro-runtime 4.0.0-preview.1 → 4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"install.native.d.ts","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":"AACA,OAAO,4CAA4C,CAAC;AAGpD,OAAO,cAAc,CAAC;AAEtB,OAAO,MAAM,CAAC;AAsCd,QAAA,MAAM,cAAc,eAAqD,CAAC;AAE1E,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,QAAQ,GAAG;IAAE,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO,CAAA;CAAE;;iBAKhE,GAAG,EAAE,UAchC"}
1
+ {"version":3,"file":"install.native.d.ts","sourceRoot":"","sources":["../../src/location/install.native.ts"],"names":[],"mappings":"AACA,OAAO,4CAA4C,CAAC;AAGpD,OAAO,cAAc,CAAC;AAEtB,OAAO,MAAM,CAAC;AAqCd,QAAA,MAAM,cAAc,eAAqD,CAAC;AAE1E,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,QAAQ,GAAG;IAAE,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO,CAAA;CAAE;;iBAKhE,GAAG,EAAE,UAchC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/metro-runtime",
3
- "version": "4.0.0-preview.1",
3
+ "version": "4.0.0",
4
4
  "description": "Tools for making advanced Metro bundler features work",
5
5
  "sideEffects": true,
6
6
  "main": "src",
@@ -37,5 +37,5 @@
37
37
  "peerDependencies": {
38
38
  "react-native": "*"
39
39
  },
40
- "gitHead": "d97ae0839fa465cee14e13ca38f3c6c84c124d82"
40
+ "gitHead": "8f2567ad26ca782cd2d7ab7fa77a34979e2b4e01"
41
41
  }
@@ -10,10 +10,10 @@ export function buildUrlForBundle(bundlePath: string): string {
10
10
  return bundlePath;
11
11
  }
12
12
 
13
+ if (typeof location !== 'undefined') {
14
+ return joinComponents(location.origin, bundlePath);
15
+ }
13
16
  if (process.env.NODE_ENV === 'production') {
14
- if (typeof location !== 'undefined') {
15
- return joinComponents(location.origin, bundlePath);
16
- }
17
17
  throw new Error(
18
18
  'Unable to determine the production URL where additional JavaScript chunks are hosted because the global "location" variable is not defined.'
19
19
  );
@@ -16,6 +16,10 @@ import getDevServer from '../getDevServer';
16
16
  const manifest = Constants.expoConfig as Record<string, any> | null;
17
17
 
18
18
  function getOrigin() {
19
+ if (process.env.NODE_ENV !== 'production') {
20
+ // e.g. http://localhost:8081
21
+ return getDevServer().url;
22
+ }
19
23
  return (
20
24
  manifest?.extra?.router?.origin ??
21
25
  // Written automatically during release builds.
@@ -26,11 +30,6 @@ function getOrigin() {
26
30
  // TODO: This would be better if native and tied as close to the JS engine as possible, i.e. it should
27
31
  // reflect the exact location of the JS file that was executed.
28
32
  function getBaseUrl() {
29
- if (process.env.NODE_ENV !== 'production') {
30
- // e.g. http://localhost:19006
31
- return getDevServer().url?.replace(/\/$/, '');
32
- }
33
-
34
33
  // TODO: Make it official by moving out of `extra`
35
34
  const productionBaseUrl = getOrigin();
36
35