expo 52.0.0-preview.8 → 52.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.
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # expo
2
2
 
3
- The `expo` package is a single package you can install in any React Native app to begin using Expo modules.
3
+ The `expo` package is a single package you can install in any React Native app to begin using Expo modules. [API Reference](https://docs.expo.dev/versions/latest/sdk/expo/).
4
4
 
5
5
  - includes core infrastructure for Expo modules: `expo-modules-core` and `expo-modules-autolinking`.
6
6
  - bundles a minimal set of Expo modules that are required by nearly every app, such as `expo-asset`.
7
7
  - provides [`@expo/cli`](https://github.com/expo/expo/blob/main/packages/%40expo/cli/README.md), a small CLI that provides a clean interface around both bundlers (such as Metro and Webpack) and native build tools (Xcode, Simulator.app, Android Studio, ADB, etc.), can generate native projects with `npx expo prebuild`, and aligns compatible package versions with `npx expo install`.
8
8
  - exposes a JavaScript module that configures an app at runtime as needed to use `expo-font` and to function in Expo Go (optional, only if applicable).
9
9
 
10
+
10
11
  See [CONTRIBUTING](./CONTRIBUTING.md) for instructions on working on this package.
@@ -33,7 +33,7 @@ def getRNVersion() {
33
33
  ensureDependeciesWereEvaluated(project)
34
34
 
35
35
  group = 'host.exp.exponent'
36
- version = '52.0.0-preview.8'
36
+ version = '52.0.0'
37
37
 
38
38
  buildscript {
39
39
  // Simple helper that allows the root project to override versions declared by this library.
@@ -46,7 +46,7 @@ android {
46
46
  namespace "expo.core"
47
47
  defaultConfig {
48
48
  versionCode 1
49
- versionName "52.0.0-preview.8"
49
+ versionName "52.0.0"
50
50
  consumerProguardFiles("proguard-rules.pro")
51
51
  }
52
52
  testOptions {
package/build/Expo.d.ts CHANGED
@@ -2,6 +2,6 @@ import './Expo.fx';
2
2
  export { disableErrorHandling } from './errors/ExpoErrorManager';
3
3
  export { default as registerRootComponent } from './launch/registerRootComponent';
4
4
  export { isRunningInExpoGo, getExpoGoProjectConfig } from './environment/ExpoGo';
5
- export { EventEmitter, SharedObject, SharedRef, NativeModule, requireNativeModule, requireOptionalNativeModule, reloadAppAsync, } from 'expo-modules-core';
5
+ export { EventEmitter, SharedObject, SharedRef, NativeModule, requireNativeModule, requireOptionalNativeModule, requireNativeViewManager as requireNativeView, registerWebModule, reloadAppAsync, } from 'expo-modules-core';
6
6
  export { useEvent, useEventListener } from './hooks/useEvent';
7
7
  //# sourceMappingURL=Expo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Expo.d.ts","sourceRoot":"","sources":["../src/Expo.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EAGZ,mBAAmB,EACnB,2BAA2B,EAC3B,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"Expo.d.ts","sourceRoot":"","sources":["../src/Expo.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EAGZ,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,IAAI,iBAAiB,EAC7C,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get the base URL for the DOM Components HTML
3
+ */
4
+ export declare function getBaseURL(): string;
5
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/dom/base.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAkCnC"}
@@ -5,6 +5,5 @@ export declare const DOM_EVENT = "$$dom_event";
5
5
  export declare const MATCH_CONTENTS_EVENT = "$$match_contents_event";
6
6
  export declare const REGISTER_DOM_IMPERATIVE_HANDLE_PROPS = "$$register_dom_imperative_handle_props";
7
7
  export declare const getInjectEventScript: <T extends BridgeMessage<any>>(detail: T) => string;
8
- export declare function getInjectEnvsScript(): string;
9
8
  export declare function getInjectBodySizeObserverScript(): string;
10
9
  //# sourceMappingURL=injection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"injection.d.ts","sourceRoot":"","sources":["../../src/dom/injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,SAAS,gBAAgB,CAAC;AACvC,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,oCAAoC,2CAA2C,CAAC;AAE7F,eAAO,MAAM,oBAAoB,qDAOhC,CAAC;AAEF,wBAAgB,mBAAmB,WAalC;AAED,wBAAgB,+BAA+B,WAwB9C"}
1
+ {"version":3,"file":"injection.d.ts","sourceRoot":"","sources":["../../src/dom/injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,SAAS,gBAAgB,CAAC;AACvC,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,oCAAoC,2CAA2C,CAAC;AAE7F,eAAO,MAAM,oBAAoB,qDAOhC,CAAC;AAEF,wBAAgB,+BAA+B,WAwB9C"}
@@ -2,9 +2,7 @@ import React from 'react';
2
2
  import type { DOMProps } from './dom.types';
3
3
  interface Props {
4
4
  dom: DOMProps;
5
- source: {
6
- uri: string;
7
- };
5
+ filePath: string;
8
6
  }
9
7
  declare const RawWebView: React.ForwardRefExoticComponent<Props & React.RefAttributes<object>>;
10
8
  export declare function resolveWebView(useExpoDOMWebView: boolean): any;
@@ -1 +1 @@
1
- {"version":3,"file":"webview-wrapper.d.ts","sourceRoot":"","sources":["../../src/dom/webview-wrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAiB,QAAQ,EAA4B,MAAM,aAAa,CAAC;AAcrF,UAAU,KAAK;IACb,GAAG,EAAE,QAAQ,CAAC;IACd,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,QAAA,MAAM,UAAU,sEA6Kd,CAAC;AAaH,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,OAAO,OASxD;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"webview-wrapper.d.ts","sourceRoot":"","sources":["../../src/dom/webview-wrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAiB,QAAQ,EAA4B,MAAM,aAAa,CAAC;AAarF,UAAU,KAAK;IACb,GAAG,EAAE,QAAQ,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,UAAU,sEAiLd,CAAC;AAaH,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,OAAO,OASxD;AAED,eAAe,UAAU,CAAC"}
@@ -17,7 +17,6 @@ type InitialProps = {
17
17
  * - Invokes React Native's `AppRegistry.registerComponent`.
18
18
  * - Invokes React Native web's `AppRegistry.runApplication` on web to render to the root `index.html` file.
19
19
  * - Polyfills the `process.nextTick` function globally.
20
- * - Adds support for using the `fontFamily` React Native style with the `expo-font` package.
21
20
  *
22
21
  * This method also adds the following dev-only features that are removed in production bundles.
23
22
  * - Adds the Fast Refresh and bundle splitting indicator to the app.
@@ -1 +1 @@
1
- {"version":3,"file":"registerRootComponent.d.ts","sourceRoot":"","sources":["../../src/launch/registerRootComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,KAAK,YAAY,GAAG;IAClB,GAAG,CAAC,EAAE;QACJ,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAGF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,CAAC,SAAS,YAAY,EAClE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAC1B,IAAI,CAwBN"}
1
+ {"version":3,"file":"registerRootComponent.d.ts","sourceRoot":"","sources":["../../src/launch/registerRootComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,KAAK,YAAY,GAAG;IAClB,GAAG,CAAC,EAAE;QACJ,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAGF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,CAAC,SAAS,YAAY,EAClE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAC1B,IAAI,CAwBN"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "@expo/metro-runtime": "~4.0.0-preview.0",
2
+ "@expo/metro-runtime": "~4.0.0-preview.2",
3
3
  "@expo/vector-icons": "^14.0.2",
4
4
  "@react-native-async-storage/async-storage": "1.23.1",
5
5
  "@react-native-community/datetimepicker": "8.2.0",
@@ -16,12 +16,11 @@
16
16
  "expo-app-loader-provider": "~8.0.0",
17
17
  "expo-apple-authentication": "~7.0.1",
18
18
  "expo-application": "~6.0.1",
19
- "expo-asset": "~11.0.0",
19
+ "expo-asset": "~11.0.1",
20
20
  "expo-audio": "~0.2.3",
21
21
  "expo-auth-session": "~6.0.0",
22
22
  "expo-av": "~15.0.1",
23
- "expo-background-fetch": "~13.0.1",
24
- "expo-barcode-scanner": "~14.0.1",
23
+ "expo-background-fetch": "~13.0.2",
25
24
  "expo-battery": "~9.0.1",
26
25
  "expo-blur": "~14.0.1",
27
26
  "expo-brightness": "~13.0.2",
@@ -32,21 +31,21 @@
32
31
  "expo-checkbox": "~4.0.0",
33
32
  "expo-clipboard": "~7.0.0",
34
33
  "expo-constants": "~17.0.2",
35
- "expo-contacts": "~14.0.1",
34
+ "expo-contacts": "~14.0.2",
36
35
  "expo-crypto": "~14.0.1",
37
- "expo-dev-client": "~5.0.0-preview.2",
36
+ "expo-dev-client": "~5.0.0-preview.9",
38
37
  "expo-device": "~7.0.1",
39
38
  "expo-document-picker": "~13.0.1",
40
39
  "expo-face-detector": "~13.0.1",
41
- "expo-file-system": "~18.0.0",
42
- "expo-font": "~13.0.0",
43
- "expo-gl": "~15.0.0",
40
+ "expo-file-system": "~18.0.1",
41
+ "expo-font": "~13.0.1",
42
+ "expo-gl": "~15.0.1",
44
43
  "expo-google-app-auth": "~8.3.0",
45
44
  "expo-haptics": "~14.0.0",
46
- "expo-image": "~2.0.0-preview.0",
45
+ "expo-image": "~2.0.0-preview.1",
47
46
  "expo-image-loader": "~5.0.0",
48
47
  "expo-image-manipulator": "~13.0.5",
49
- "expo-image-picker": "~16.0.0",
48
+ "expo-image-picker": "~16.0.1",
50
49
  "expo-intent-launcher": "~12.0.1",
51
50
  "expo-insights": "~0.8.1",
52
51
  "expo-keep-awake": "~14.0.1",
@@ -56,14 +55,14 @@
56
55
  "expo-localization": "~16.0.0",
57
56
  "expo-location": "~18.0.1",
58
57
  "expo-mail-composer": "~14.0.1",
59
- "expo-media-library": "~17.0.0",
60
- "expo-module-template": "~10.15.3",
61
- "expo-modules-core": "~2.0.0-preview.6",
62
- "expo-navigation-bar": "~4.0.1",
58
+ "expo-media-library": "~17.0.2",
59
+ "expo-module-template": "~10.15.6",
60
+ "expo-modules-core": "~2.0.0",
61
+ "expo-navigation-bar": "~4.0.2",
63
62
  "expo-network": "~7.0.0",
64
- "expo-notifications": "~0.29.4",
63
+ "expo-notifications": "~0.29.6",
65
64
  "expo-print": "~14.0.2",
66
- "expo-router": "~4.0.0-preview.5",
65
+ "expo-router": "~4.0.0",
67
66
  "expo-screen-capture": "~7.0.0",
68
67
  "expo-screen-orientation": "~8.0.0",
69
68
  "expo-secure-store": "~14.0.0",
@@ -71,38 +70,38 @@
71
70
  "expo-sharing": "~13.0.0",
72
71
  "expo-sms": "~13.0.0",
73
72
  "expo-speech": "~13.0.0",
74
- "expo-splash-screen": "~0.28.4",
75
- "expo-sqlite": "~15.0.1",
73
+ "expo-splash-screen": "~0.29.5",
74
+ "expo-sqlite": "~15.0.2",
76
75
  "expo-status-bar": "~2.0.0",
77
76
  "expo-store-review": "~8.0.0",
78
77
  "expo-symbols": "~0.2.0",
79
- "expo-system-ui": "~4.0.1",
80
- "expo-task-manager": "~12.0.0",
78
+ "expo-system-ui": "~4.0.2",
79
+ "expo-task-manager": "~12.0.2",
81
80
  "expo-tracking-transparency": "~5.0.0",
82
- "expo-updates": "~0.26.2",
81
+ "expo-updates": "~0.26.5",
83
82
  "expo-video-thumbnails": "~9.0.0",
84
- "expo-video": "~2.0.0-preview.0",
83
+ "expo-video": "~2.0.0-preview.2",
85
84
  "expo-web-browser": "~14.0.0",
86
- "jest-expo": "~52.0.0-preview.2",
85
+ "jest-expo": "~52.0.0-preview.4",
87
86
  "lottie-react-native": "7.0.0",
88
87
  "react": "18.3.1",
89
88
  "react-dom": "18.3.1",
90
- "react-native": "0.76.0",
89
+ "react-native": "0.76.1",
91
90
  "react-native-web": "~0.19.13",
92
91
  "react-native-gesture-handler": "~2.20.2",
93
92
  "react-native-get-random-values": "~1.11.0",
94
93
  "react-native-maps": "1.18.0",
95
94
  "react-native-pager-view": "6.4.1",
96
95
  "react-native-reanimated": "~3.16.1",
97
- "react-native-screens": "4.0.0-beta.14",
96
+ "react-native-screens": "4.0.0",
98
97
  "react-native-safe-area-context": "4.12.0",
99
98
  "react-native-svg": "15.8.0",
100
- "react-native-view-shot": "3.8.0",
99
+ "react-native-view-shot": "~4.0.0",
101
100
  "react-native-webview": "13.12.2",
102
101
  "sentry-expo": "~7.0.0",
103
102
  "unimodules-app-loader": "~5.0.0",
104
103
  "unimodules-image-loader-interface": "~6.1.0",
105
104
  "@shopify/react-native-skia": "1.5.0",
106
105
  "@shopify/flash-list": "1.7.1",
107
- "@sentry/react-native": "~5.33.1"
106
+ "@sentry/react-native": "~6.1.0"
108
107
  }
@@ -0,0 +1 @@
1
+ export * from '@expo/fingerprint';
package/fingerprint.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('@expo/fingerprint');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo",
3
- "version": "52.0.0-preview.8",
3
+ "version": "52.0.0",
4
4
  "description": "The Expo SDK",
5
5
  "main": "src/Expo.ts",
6
6
  "module": "src/Expo.ts",
@@ -33,6 +33,8 @@
33
33
  "devtools.d.ts",
34
34
  "fetch.js",
35
35
  "fetch.d.ts",
36
+ "fingerprint.js",
37
+ "fingerprint.d.ts",
36
38
  "react-native.config.js",
37
39
  "requiresExtraSetup.json",
38
40
  "tsconfig.base.json",
@@ -66,18 +68,20 @@
66
68
  "homepage": "https://github.com/expo/expo/tree/main/packages/expo",
67
69
  "dependencies": {
68
70
  "@babel/runtime": "^7.20.0",
69
- "@expo/cli": "0.19.5",
71
+ "@expo/cli": "0.20.4",
70
72
  "@expo/config": "10.0.2",
71
- "@expo/config-plugins": "9.0.4",
72
- "@expo/metro-config": "0.19.0-preview.2",
73
+ "@expo/config-plugins": "9.0.7",
74
+ "@expo/fingerprint": "0.11.2",
75
+ "@expo/metro-config": "0.19.0",
73
76
  "@expo/vector-icons": "^14.0.0",
74
- "babel-preset-expo": "~12.0.0-preview.1",
75
- "expo-asset": "~11.0.0",
76
- "expo-file-system": "~18.0.0",
77
- "expo-font": "~13.0.0",
77
+ "babel-preset-expo": "~12.0.0-preview.6",
78
+ "expo-asset": "~11.0.1",
79
+ "expo-constants": "~17.0.2",
80
+ "expo-file-system": "~18.0.1",
81
+ "expo-font": "~13.0.1",
78
82
  "expo-keep-awake": "~14.0.1",
79
- "expo-modules-autolinking": "2.0.0-preview.2",
80
- "expo-modules-core": "2.0.0-preview.6",
83
+ "expo-modules-autolinking": "2.0.0-preview.3",
84
+ "expo-modules-core": "2.0.0",
81
85
  "fbemitter": "^3.0.0",
82
86
  "web-streams-polyfill": "^3.3.2",
83
87
  "whatwg-url-without-unicode": "8.0.0-3"
@@ -88,7 +92,7 @@
88
92
  "expo-module-scripts": "^4.0.0",
89
93
  "react": "18.3.1",
90
94
  "react-dom": "18.3.1",
91
- "react-native": "0.76.0"
95
+ "react-native": "0.76.1"
92
96
  },
93
97
  "peerDependencies": {
94
98
  "@expo/dom-webview": "*",
@@ -108,5 +112,5 @@
108
112
  "optional": true
109
113
  }
110
114
  },
111
- "gitHead": "8b9f5addf49cb5ef7598ca27ff60c0accff6a1c3"
115
+ "gitHead": "1f84b4c952ed9785c41ee65c9877e44f1df27af9"
112
116
  }
package/src/Expo.fx.tsx CHANGED
@@ -2,24 +2,47 @@
2
2
  import './winter';
3
3
  import 'expo-asset';
4
4
 
5
- import * as Font from 'expo-font';
6
- import { AppRegistry, StyleSheet } from 'react-native';
5
+ import Constants from 'expo-constants';
6
+ import { AppRegistry, NativeModules, LogBox, Platform } from 'react-native';
7
7
 
8
8
  import { isRunningInExpoGo } from './environment/ExpoGo';
9
9
  import { AppEntryNotFound } from './errors/AppEntryNotFound';
10
10
  import { createErrorHandler } from './errors/ExpoErrorManager';
11
11
 
12
- // If expo-font is installed and the style preprocessor is available, use it to parse fonts.
13
- if (StyleSheet.setStyleAttributePreprocessor) {
14
- StyleSheet.setStyleAttributePreprocessor('fontFamily', Font.processFontFamily);
15
- }
16
-
17
12
  if (isRunningInExpoGo()) {
18
13
  // set up some improvements to commonly logged error messages stemming from react-native
19
14
  const globalHandler = ErrorUtils.getGlobalHandler();
20
15
  ErrorUtils.setGlobalHandler(createErrorHandler(globalHandler));
21
16
  }
22
17
 
18
+ // Warn if the New Architecture is not explicitly enabled in the app config and we are running in Expo Go.
19
+ // This could be problematic because you will be developing your app with the New Architecture enabled and
20
+ // but your builds will have the New Architecture disabled.
21
+ if (__DEV__ && isRunningInExpoGo() && process.env.NODE_ENV === 'development') {
22
+ ['android', 'ios'].forEach((platform) => {
23
+ if (
24
+ Platform.OS === platform &&
25
+ Constants.expoConfig?.[platform]?.newArchEnabled !== true &&
26
+ Constants.expoConfig?.newArchEnabled !== true
27
+ ) {
28
+ // Wrap it in rAF to show the warning after the React Native DevTools message
29
+ requestAnimationFrame(() => {
30
+ console.warn(
31
+ `🚨 React Native's New Architecture is always enabled in Expo Go, but it is not explicitly enabled your project app config. This may lead to unexpected behavior when you create a production or development build. Set "newArchEnabled": true in your app.json.\nLearn more: https://docs.expo.dev/guides/new-architecture/`
32
+ );
33
+ });
34
+ }
35
+ });
36
+ }
37
+
38
+ // Disable the "Open debugger to view warnings" React Native DevTools warning in
39
+ // Expo Go and expo-dev-client, because launching the debugger from there will not
40
+ // get the correct JS target.
41
+ const IS_RUNNING_IN_DEV_CLIENT = !!NativeModules.EXDevLauncher;
42
+ if (__DEV__ && LogBox?.ignoreLogs && (isRunningInExpoGo() || IS_RUNNING_IN_DEV_CLIENT)) {
43
+ LogBox.ignoreLogs([/Open debugger to view warnings/]);
44
+ }
45
+
23
46
  if (process.env.NODE_ENV !== 'production') {
24
47
  // Register a default component and expect `registerRootComponent` to be called later and update it.
25
48
  AppRegistry.registerComponent('main', () => AppEntryNotFound);
package/src/Expo.ts CHANGED
@@ -15,6 +15,8 @@ export {
15
15
  // Methods
16
16
  requireNativeModule,
17
17
  requireOptionalNativeModule,
18
+ requireNativeViewManager as requireNativeView,
19
+ registerWebModule,
18
20
  reloadAppAsync,
19
21
  } from 'expo-modules-core';
20
22
 
@@ -0,0 +1,102 @@
1
+ jest.mock('react-native/Libraries/Core/Devtools/getDevServer', () =>
2
+ jest.fn().mockReturnValue({ url: 'http://localhost:8081' })
3
+ );
4
+
5
+ describe('getBaseURL', () => {
6
+ let getBaseURL;
7
+
8
+ const originalProcessEnv = process.env;
9
+ const originalExpo = globalThis.expo;
10
+ beforeEach(() => {
11
+ // Reset the module to clear the `getBaseURL` underlying cache
12
+ jest.resetModules();
13
+ getBaseURL = require('../base').getBaseURL;
14
+ });
15
+
16
+ afterEach(() => {
17
+ globalThis.expo = originalExpo;
18
+ process.env = originalProcessEnv;
19
+ });
20
+
21
+ it('should serve from updates directory when using updates', () => {
22
+ // @ts-expect-error: mock partial properties
23
+ globalThis.expo = {
24
+ modules: {
25
+ ExpoUpdates: {
26
+ isEnabled: true,
27
+ isEmbeddedLaunch: false,
28
+ localAssets: {
29
+ '5d41402abc4b2a76b9719d911017c592':
30
+ 'file:///path/to/.expo-internal/5d41402abc4b2a76b9719d911017c592.png',
31
+ },
32
+ },
33
+ },
34
+ };
35
+
36
+ expect(getBaseURL()).toBe('file:///path/to/.expo-internal');
37
+ });
38
+
39
+ it('should serve from app builtin directory when using updates with embedded bundle', () => {
40
+ // @ts-expect-error: mock partial properties
41
+ globalThis.expo = {
42
+ modules: {
43
+ ExpoUpdates: {
44
+ isEnabled: true,
45
+ isEmbeddedLaunch: true,
46
+ localAssets: {
47
+ '5d41402abc4b2a76b9719d911017c592':
48
+ 'file:///path/to/.expo-internal/5d41402abc4b2a76b9719d911017c592.png',
49
+ },
50
+ },
51
+ },
52
+ };
53
+ process.env.NODE_ENV = 'production';
54
+ switch (process.env.EXPO_OS) {
55
+ case 'android': {
56
+ expect(getBaseURL()).toBe('file:///android_asset/www.bundle');
57
+ break;
58
+ }
59
+ case 'ios': {
60
+ expect(getBaseURL()).toBe('www.bundle');
61
+ break;
62
+ }
63
+ default: {
64
+ expect(getBaseURL()).toBe('');
65
+ break;
66
+ }
67
+ }
68
+ });
69
+
70
+ it('should serve from app builtin directory for production builds', () => {
71
+ process.env.NODE_ENV = 'production';
72
+ switch (process.env.EXPO_OS) {
73
+ case 'android': {
74
+ expect(getBaseURL()).toBe('file:///android_asset/www.bundle');
75
+ break;
76
+ }
77
+ case 'ios': {
78
+ expect(getBaseURL()).toBe('www.bundle');
79
+ break;
80
+ }
81
+ default: {
82
+ expect(getBaseURL()).toBe('');
83
+ break;
84
+ }
85
+ }
86
+ });
87
+
88
+ it('should serve from dev server for development builds', () => {
89
+ process.env.NODE_ENV = 'development';
90
+ switch (process.env.EXPO_OS) {
91
+ case 'android':
92
+ case 'ios': {
93
+ expect(getBaseURL()).toBe('http://localhost:8081/_expo/@dom');
94
+ break;
95
+ }
96
+ default: {
97
+ expect(getBaseURL()).toBe('');
98
+ break;
99
+ }
100
+ }
101
+ });
102
+ });
@@ -0,0 +1,62 @@
1
+ let cachedBaseUrl: string | null = null;
2
+
3
+ /**
4
+ * Get the base URL for the DOM Components HTML
5
+ */
6
+ export function getBaseURL(): string {
7
+ if (cachedBaseUrl != null) {
8
+ return cachedBaseUrl;
9
+ }
10
+
11
+ // Serving from updates
12
+ const updatesBaseUrl = getUpdatesBaseURL();
13
+ if (updatesBaseUrl != null) {
14
+ cachedBaseUrl = updatesBaseUrl;
15
+ return cachedBaseUrl;
16
+ }
17
+
18
+ if (process.env.EXPO_OS === 'web') {
19
+ cachedBaseUrl = process.env.EXPO_BASE_URL ?? '';
20
+ return cachedBaseUrl;
21
+ }
22
+
23
+ // Serving from local production
24
+ if (process.env.NODE_ENV === 'production') {
25
+ if (process.env.EXPO_OS === 'android') {
26
+ cachedBaseUrl = 'file:///android_asset/www.bundle';
27
+ } else if (process.env.EXPO_OS === 'ios') {
28
+ cachedBaseUrl = 'www.bundle';
29
+ } else {
30
+ cachedBaseUrl = process.env.EXPO_BASE_URL ?? '';
31
+ }
32
+ return cachedBaseUrl;
33
+ }
34
+
35
+ // Serving from local dev server
36
+ const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');
37
+ const devServer = getDevServer();
38
+ cachedBaseUrl = new URL('/_expo/@dom', devServer.url).toString();
39
+ return cachedBaseUrl;
40
+ }
41
+
42
+ /**
43
+ * Get the base URL for the DOM Components when serving from updates
44
+ */
45
+ function getUpdatesBaseURL(): string | null {
46
+ const ExpoUpdates = globalThis.expo?.modules?.['ExpoUpdates'] as
47
+ | import('expo-updates').ExpoUpdatesModule
48
+ | undefined;
49
+ const updatesIsInstalledAndEnabled = ExpoUpdates?.isEnabled ?? false;
50
+ const updatesIsEmbeddedLaunch = ExpoUpdates?.isEmbeddedLaunch ?? false;
51
+ const shouldServeDomFromUpdates = updatesIsInstalledAndEnabled && !updatesIsEmbeddedLaunch;
52
+ // If updates is installed and enabled, and we're not running from an embedded launch, we should serve the DOM Components from the `.expo-internal` directory
53
+ if (shouldServeDomFromUpdates) {
54
+ const localAssets = ExpoUpdates?.localAssets ?? {};
55
+ const anyLocalAsset = Object.values(localAssets)[0];
56
+ if (anyLocalAsset) {
57
+ // Try to get the `.expo-internal` directory from the first local asset
58
+ return anyLocalAsset.slice(0, anyLocalAsset.lastIndexOf('/'));
59
+ }
60
+ }
61
+ return null;
62
+ }
@@ -15,21 +15,6 @@ export const getInjectEventScript = <T extends BridgeMessage<any>>(detail: T) =>
15
15
  true;`;
16
16
  };
17
17
 
18
- export function getInjectEnvsScript() {
19
- return `;(function injectEnvs() {
20
- let domBaseUrl = '';
21
- if (window.location.protocol === 'file:') {
22
- domBaseUrl = window.location.href.substring(0, window.location.href.lastIndexOf('/'));
23
- }
24
- window.process = window.process || {};
25
- window.process.env = {
26
- ...(window.process.env || {}),
27
- EXPO_DOM_BASE_URL: domBaseUrl,
28
- };
29
- })();
30
- true;`;
31
- }
32
-
33
18
  export function getInjectBodySizeObserverScript() {
34
19
  return `;(function observeDocumentBodySize() {
35
20
  window.addEventListener('DOMContentLoaded', () => {
@@ -2,12 +2,12 @@
2
2
  import React from 'react';
3
3
  import { AppState } from 'react-native';
4
4
 
5
+ import { getBaseURL } from './base';
5
6
  import type { BridgeMessage, DOMProps, WebViewProps, WebViewRef } from './dom.types';
6
7
  import { _emitGlobalEvent } from './global-events';
7
8
  import {
8
9
  getInjectBodySizeObserverScript,
9
10
  getInjectEventScript,
10
- getInjectEnvsScript,
11
11
  MATCH_CONTENTS_EVENT,
12
12
  NATIVE_ACTION,
13
13
  NATIVE_ACTION_RESULT,
@@ -18,12 +18,10 @@ import RNWebView from './webview/RNWebView';
18
18
 
19
19
  interface Props {
20
20
  dom: DOMProps;
21
- source: {
22
- uri: string;
23
- };
21
+ filePath: string;
24
22
  }
25
23
 
26
- const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalProps }, ref) => {
24
+ const RawWebView = React.forwardRef<object, Props>(({ dom, filePath, ...marshalProps }, ref) => {
27
25
  if (ref != null && typeof ref === 'object' && ref.current == null) {
28
26
  ref.current = new Proxy(
29
27
  {},
@@ -52,6 +50,7 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalPro
52
50
  const webView = resolveWebView(dom?.useExpoDOMWebView ?? false);
53
51
  const webviewRef = React.useRef<WebViewRef>(null);
54
52
  const domImperativeHandlePropsRef = React.useRef<string[]>([]);
53
+ const source = { uri: `${getBaseURL()}/${filePath}` };
55
54
  const [containerStyle, setContainerStyle] = React.useState<WebViewProps['containerStyle']>(null);
56
55
 
57
56
  const emit = React.useCallback(
@@ -88,6 +87,10 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalPro
88
87
  webviewDebuggingEnabled: __DEV__,
89
88
  // Make iOS scrolling feel native.
90
89
  decelerationRate: process.env.EXPO_OS === 'ios' ? 'normal' : undefined,
90
+ // This is a better default for integrating with native navigation.
91
+ contentInsetAdjustmentBehavior: 'automatic',
92
+ // This is the default in ScrollView and upstream native.
93
+ automaticallyAdjustsScrollIndicatorInsets: true,
91
94
  originWhitelist: ['*'],
92
95
  allowFileAccess: true,
93
96
  allowFileAccessFromFileURLs: true,
@@ -110,7 +113,6 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalPro
110
113
  containerStyle,
111
114
  ...dom,
112
115
  injectedJavaScriptBeforeContentLoaded: [
113
- getInjectEnvsScript(),
114
116
  // On first mount, inject `$$EXPO_INITIAL_PROPS` with the initial props.
115
117
  `window.$$EXPO_INITIAL_PROPS = ${JSON.stringify(smartActions)};true;`,
116
118
  dom?.matchContents ? getInjectBodySizeObserverScript() : null,
@@ -22,7 +22,6 @@ type InitialProps = {
22
22
  * - Invokes React Native's `AppRegistry.registerComponent`.
23
23
  * - Invokes React Native web's `AppRegistry.runApplication` on web to render to the root `index.html` file.
24
24
  * - Polyfills the `process.nextTick` function globally.
25
- * - Adds support for using the `fontFamily` React Native style with the `expo-font` package.
26
25
  *
27
26
  * This method also adds the following dev-only features that are removed in production bundles.
28
27
  * - Adds the Fast Refresh and bundle splitting indicator to the app.