expo 54.0.31 → 54.0.33

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.
@@ -32,7 +32,7 @@ buildscript {
32
32
  def reactNativeVersion = project.extensions.getByType(ExpoModuleExtension).reactNativeVersion
33
33
 
34
34
  group = 'host.exp.exponent'
35
- version = '54.0.31'
35
+ version = '54.0.33'
36
36
 
37
37
  expoModule {
38
38
  // We can't prebuild the module because it depends on the generated files.
@@ -43,7 +43,7 @@ android {
43
43
  namespace "expo.core"
44
44
  defaultConfig {
45
45
  versionCode 1
46
- versionName "54.0.31"
46
+ versionName "54.0.33"
47
47
  consumerProguardFiles("proguard-rules.pro")
48
48
  }
49
49
  testOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../../src/async-require/hmr.ts"],"names":[],"mappings":"AA4CA,KAAK,QAAQ,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,GACP,gBAAgB,GAChB,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CAC5C,CAAC;AAMF;;;GAGG;AACH,QAAA,MAAM,SAAS,EAAE,wBAwMhB,CAAC;AAuEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../../src/async-require/hmr.ts"],"names":[],"mappings":"AA4CA,KAAK,QAAQ,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,GACP,gBAAgB,GAChB,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CAC5C,CAAC;AAMF;;;GAGG;AACH,QAAA,MAAM,SAAS,EAAE,wBAiMhB,CAAC;AA4EF,eAAe,SAAS,CAAC"}
@@ -41,8 +41,8 @@
41
41
  "expo-device": "~8.0.10",
42
42
  "expo-document-picker": "~14.0.8",
43
43
  "expo-file-system": "~19.0.21",
44
- "expo-font": "~14.0.10",
45
- "expo-gl": "~16.0.9",
44
+ "expo-font": "~14.0.11",
45
+ "expo-gl": "~16.0.10",
46
46
  "expo-glass-effect": "~0.1.8",
47
47
  "expo-google-app-auth": "~8.3.0",
48
48
  "expo-haptics": "~15.0.8",
@@ -71,7 +71,7 @@
71
71
  "expo-notifications": "~0.32.16",
72
72
  "expo-print": "~15.0.8",
73
73
  "expo-live-photo": "~1.0.8",
74
- "expo-router": "~6.0.21",
74
+ "expo-router": "~6.0.23",
75
75
  "expo-screen-capture": "~8.0.9",
76
76
  "expo-screen-orientation": "~9.0.8",
77
77
  "expo-secure-store": "~15.0.8",
@@ -92,7 +92,7 @@
92
92
  "expo-video-thumbnails": "~10.0.8",
93
93
  "expo-video": "~3.0.15",
94
94
  "expo-web-browser": "~15.0.10",
95
- "jest-expo": "~54.0.16",
95
+ "jest-expo": "~54.0.17",
96
96
  "lottie-react-native": "~7.3.1",
97
97
  "react": "19.1.0",
98
98
  "react-dom": "19.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo",
3
- "version": "54.0.31",
3
+ "version": "54.0.33",
4
4
  "description": "The Expo SDK",
5
5
  "main": "src/Expo.ts",
6
6
  "module": "src/Expo.ts",
@@ -75,20 +75,20 @@
75
75
  "homepage": "https://github.com/expo/expo/tree/main/packages/expo",
76
76
  "dependencies": {
77
77
  "@babel/runtime": "^7.20.0",
78
- "@expo/cli": "54.0.21",
78
+ "@expo/cli": "54.0.23",
79
79
  "@expo/config": "~12.0.13",
80
80
  "@expo/config-plugins": "~54.0.4",
81
81
  "@expo/devtools": "0.1.8",
82
82
  "@expo/fingerprint": "0.15.4",
83
83
  "@expo/metro": "~54.2.0",
84
- "@expo/metro-config": "54.0.13",
84
+ "@expo/metro-config": "54.0.14",
85
85
  "@expo/vector-icons": "^15.0.3",
86
86
  "@ungap/structured-clone": "^1.3.0",
87
- "babel-preset-expo": "~54.0.9",
87
+ "babel-preset-expo": "~54.0.10",
88
88
  "expo-asset": "~12.0.12",
89
89
  "expo-constants": "~18.0.13",
90
90
  "expo-file-system": "~19.0.21",
91
- "expo-font": "~14.0.10",
91
+ "expo-font": "~14.0.11",
92
92
  "expo-keep-awake": "~15.0.8",
93
93
  "expo-modules-autolinking": "3.0.24",
94
94
  "expo-modules-core": "3.0.29",
@@ -124,5 +124,5 @@
124
124
  "optional": true
125
125
  }
126
126
  },
127
- "gitHead": "e615daa250a27c60da3cea1f0572dcde93df5b68"
127
+ "gitHead": "cfd65241fb73317b63e6736e7890a784a69940fc"
128
128
  }
@@ -17,8 +17,32 @@ type MetroRequire = {
17
17
 
18
18
  type DependencyMapPaths = { [moduleID: number | string]: unknown } | null;
19
19
 
20
+ declare const crossOriginIsolated: boolean | undefined;
20
21
  declare let __METRO_GLOBAL_PREFIX__: string;
21
22
 
23
+ // Shim script that wraps around a given worker entrypoint and:
24
+ // - Remaps `fetch` to the base URL given
25
+ // - Remaps `importScripts` to the base URL given
26
+ // This doesn't cover all cases and won't fix that:
27
+ // - self.location will be set to a blob URL
28
+ // - new URL won't relatively resolve
29
+ // - XMLHttpRequest, WebSocket, etc won't relatively resolve
30
+ function makeWorkerContent(url: string): string {
31
+ return `
32
+ const ASYNC_WORKER_BASE = ${JSON.stringify(url)};
33
+ const IMPORT_SCRIPTS = importScripts;
34
+ const FETCH = fetch;
35
+ const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;
36
+ self.fetch = function(input, init) {
37
+ return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);
38
+ };
39
+ self.importScripts = function(...urls) {
40
+ return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));
41
+ };
42
+ importScripts(ASYNC_WORKER_BASE);
43
+ `;
44
+ }
45
+
22
46
  function maybeLoadBundle(moduleID: number, paths: DependencyMapPaths): void | Promise<void> {
23
47
  const loadBundle: (bundlePath: unknown) => Promise<void> = (global as any)[
24
48
  `${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`
@@ -91,6 +115,26 @@ asyncRequire.unstable_resolve = function unstable_resolve(
91
115
  return id;
92
116
  };
93
117
 
118
+ // Wraps around `new Worker` and if `crossOriginIsolated` is truthy, indicating CORP/COEP is active,
119
+ // instantiates the worker with an inline script instead, which works around the CORS error. This is
120
+ // necessary if the worker script won't have the same CORP/COEP headers as the document
121
+ asyncRequire.unstable_createWorker = function unstable_createWorker(
122
+ workerUrl: string,
123
+ workerOpts?: WorkerOptions
124
+ ) {
125
+ if (typeof crossOriginIsolated !== 'undefined' && crossOriginIsolated) {
126
+ try {
127
+ const content = makeWorkerContent(workerUrl);
128
+ workerUrl = URL.createObjectURL(new Blob([content], { type: 'text/javascript' }));
129
+ return new Worker(workerUrl, workerOpts);
130
+ } finally {
131
+ URL.revokeObjectURL(workerUrl);
132
+ }
133
+ } else {
134
+ return new Worker(workerUrl, workerOpts);
135
+ }
136
+ };
137
+
94
138
  // TODO(@kitten): Missing metro type definitions
95
139
  declare const module: any;
96
140
 
@@ -235,29 +235,22 @@ const HMRClient: HMRClientNativeInterface = {
235
235
  }
236
236
  });
237
237
 
238
- client.on('close', (closeEvent: { code: number; reason: string }) => {
238
+ client.on('close', (closeEvent?: { code: number; reason: string }) => {
239
239
  hideLoading();
240
-
240
+ const reason = closeEvent?.reason;
241
+ const code = closeEvent?.code || 1000;
241
242
  // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1
242
243
  // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.5
243
- const isNormalOrUnsetCloseReason =
244
- closeEvent == null ||
245
- closeEvent.code === 1000 ||
246
- closeEvent.code === 1005 ||
247
- closeEvent.code == null;
248
-
249
- setHMRUnavailableReason(
250
- `${
251
- isNormalOrUnsetCloseReason
252
- ? 'Disconnected from Metro.'
253
- : `Disconnected from Metro (${closeEvent.code}: "${closeEvent.reason}").`
254
- }
255
-
256
- To reconnect:
257
- - Ensure that Metro is running and available on the same network
258
- - Reload this app (will trigger further help if Metro cannot be connected to)
259
- `
260
- );
244
+ const title =
245
+ reason && code !== 1000 && code !== 1001 && code !== 1005
246
+ ? `Disconnected from Metro (${code}: "${reason}")`
247
+ : `Disconnected from Metro (${code})`;
248
+ const message =
249
+ title +
250
+ '\nTo reconnect:' +
251
+ '\n- Ensure that Metro is running and available on the same network' +
252
+ '\n- Reload this app (will trigger further help if Metro cannot be connected to)';
253
+ setHMRUnavailableReason(message);
261
254
  });
262
255
 
263
256
  if (isEnabled) {
@@ -283,8 +276,13 @@ function setHMRUnavailableReason(reason: string) {
283
276
  // previously managed to connect successfully. We don't want to show
284
277
  // the warning to native engineers who use cached bundles without Metro.
285
278
  if (hmrClient.isEnabled() && didConnect) {
286
- console.warn(reason);
287
- // (Not using the `warning` module to prevent a Buck cycle.)
279
+ // NOTE(@kitten): The timeout works around a Firefox quirk
280
+ // In Firefox, unlike in Chrome, WebSockets fire a `close` event when a tab refreshes/navigates/closes, since this closes the WebSocket
281
+ // However, there's no good way to detect that this is happening or that the client initiated the `close` event
282
+ // To work around this, we schedule a timeout for our warning for 500ms which is long enough for this timer to never trigger
283
+ setTimeout(() => {
284
+ console.warn(reason);
285
+ }, 500);
288
286
  }
289
287
  }
290
288
 
package/template.tgz CHANGED
Binary file