expo 52.0.29 → 52.0.31

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.
@@ -33,7 +33,7 @@ def getRNVersion() {
33
33
  ensureDependeciesWereEvaluated(project)
34
34
 
35
35
  group = 'host.exp.exponent'
36
- version = '52.0.29'
36
+ version = '52.0.31'
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.29"
49
+ versionName "52.0.31"
50
50
  consumerProguardFiles("proguard-rules.pro")
51
51
  }
52
52
  testOptions {
@@ -0,0 +1,12 @@
1
+ import { type ViewProps } from 'react-native';
2
+ import { type DOMProps, type WebViewProps } from '../dom.types';
3
+ type UseDebugZeroHeightType = (dom: DOMProps) => {
4
+ debugZeroHeightStyle: WebViewProps['containerStyle'] | undefined;
5
+ debugOnLayout: ViewProps['onLayout'];
6
+ };
7
+ /**
8
+ * Debug only hook to help identify zero height issues in the DOM component.
9
+ */
10
+ export declare const useDebugZeroHeight: UseDebugZeroHeightType;
11
+ export {};
12
+ //# sourceMappingURL=useDebugZeroHeight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebugZeroHeight.d.ts","sourceRoot":"","sources":["../../../src/dom/webview/useDebugZeroHeight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEhE,KAAK,sBAAsB,GAAG,CAAC,GAAG,EAAE,QAAQ,KAAK;IAC/C,oBAAoB,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IACjE,aAAa,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CACtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,sBAgD3B,CAAC"}
@@ -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;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"}
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;AAcrF,UAAU,KAAK;IACb,GAAG,EAAE,QAAQ,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,UAAU,sEAoLd,CAAC;AAaH,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,OAAO,OASxD;AAED,eAAe,UAAU,CAAC"}
@@ -27,7 +27,7 @@
27
27
  "expo-brightness": "~13.0.3",
28
28
  "expo-build-properties": "~0.13.2",
29
29
  "expo-calendar": "~14.0.6",
30
- "expo-camera": "~16.0.14",
30
+ "expo-camera": "~16.0.15",
31
31
  "expo-cellular": "~7.0.2",
32
32
  "expo-checkbox": "~4.0.1",
33
33
  "expo-clipboard": "~7.0.1",
@@ -38,7 +38,7 @@
38
38
  "expo-device": "~7.0.2",
39
39
  "expo-document-picker": "~13.0.2",
40
40
  "expo-face-detector": "~13.0.2",
41
- "expo-file-system": "~18.0.9",
41
+ "expo-file-system": "~18.0.10",
42
42
  "expo-font": "~13.0.3",
43
43
  "expo-gl": "~15.0.4",
44
44
  "expo-google-app-auth": "~8.3.0",
@@ -58,8 +58,8 @@
58
58
  "expo-mail-composer": "~14.0.2",
59
59
  "expo-media-library": "~17.0.5",
60
60
  "expo-module-template": "~10.15.13",
61
- "expo-modules-core": "~2.2.0",
62
- "expo-navigation-bar": "~4.0.7",
61
+ "expo-modules-core": "~2.2.1",
62
+ "expo-navigation-bar": "~4.0.8",
63
63
  "expo-network": "~7.0.5",
64
64
  "expo-notifications": "~0.29.13",
65
65
  "expo-print": "~14.0.3",
@@ -72,14 +72,14 @@
72
72
  "expo-sms": "~13.0.1",
73
73
  "expo-speech": "~13.0.1",
74
74
  "expo-splash-screen": "~0.29.21",
75
- "expo-sqlite": "~15.1.1",
75
+ "expo-sqlite": "~15.1.2",
76
76
  "expo-status-bar": "~2.0.1",
77
77
  "expo-store-review": "~8.0.1",
78
78
  "expo-symbols": "~0.2.2",
79
- "expo-system-ui": "~4.0.7",
79
+ "expo-system-ui": "~4.0.8",
80
80
  "expo-task-manager": "~12.0.5",
81
81
  "expo-tracking-transparency": "~5.1.1",
82
- "expo-updates": "~0.26.15",
82
+ "expo-updates": "~0.26.17",
83
83
  "expo-video-thumbnails": "~9.0.3",
84
84
  "expo-video": "~2.0.5",
85
85
  "expo-web-browser": "~14.0.2",
@@ -87,7 +87,7 @@
87
87
  "lottie-react-native": "7.1.0",
88
88
  "react": "18.3.1",
89
89
  "react-dom": "18.3.1",
90
- "react-native": "0.76.6",
90
+ "react-native": "0.76.7",
91
91
  "react-native-web": "~0.19.13",
92
92
  "react-native-gesture-handler": "~2.20.2",
93
93
  "react-native-get-random-values": "~1.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo",
3
- "version": "52.0.29",
3
+ "version": "52.0.31",
4
4
  "description": "The Expo SDK",
5
5
  "main": "src/Expo.ts",
6
6
  "module": "src/Expo.ts",
@@ -68,20 +68,20 @@
68
68
  "homepage": "https://github.com/expo/expo/tree/main/packages/expo",
69
69
  "dependencies": {
70
70
  "@babel/runtime": "^7.20.0",
71
- "@expo/cli": "0.22.11",
71
+ "@expo/cli": "0.22.13",
72
72
  "@expo/config": "~10.0.8",
73
- "@expo/config-plugins": "~9.0.14",
73
+ "@expo/config-plugins": "~9.0.15",
74
74
  "@expo/fingerprint": "0.11.8",
75
75
  "@expo/metro-config": "0.19.9",
76
76
  "@expo/vector-icons": "^14.0.0",
77
- "babel-preset-expo": "~12.0.6",
77
+ "babel-preset-expo": "~12.0.7",
78
78
  "expo-asset": "~11.0.3",
79
79
  "expo-constants": "~17.0.5",
80
- "expo-file-system": "~18.0.9",
80
+ "expo-file-system": "~18.0.10",
81
81
  "expo-font": "~13.0.3",
82
82
  "expo-keep-awake": "~14.0.2",
83
83
  "expo-modules-autolinking": "2.0.7",
84
- "expo-modules-core": "2.2.0",
84
+ "expo-modules-core": "2.2.1",
85
85
  "fbemitter": "^3.0.0",
86
86
  "web-streams-polyfill": "^3.3.2",
87
87
  "whatwg-url-without-unicode": "8.0.0-3"
@@ -92,7 +92,7 @@
92
92
  "expo-module-scripts": "^4.0.3",
93
93
  "react": "18.3.1",
94
94
  "react-dom": "18.3.1",
95
- "react-native": "0.76.6"
95
+ "react-native": "0.76.7"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@expo/dom-webview": "*",
@@ -112,5 +112,5 @@
112
112
  "optional": true
113
113
  }
114
114
  },
115
- "gitHead": "8478e7a78d20fc1548ddb038aef60fa11df7b588"
115
+ "gitHead": "9442f00874e0cd738030abae80e5bdef184a2581"
116
116
  }
@@ -0,0 +1,62 @@
1
+ import { useState, useCallback } from 'react';
2
+ import { type ViewProps } from 'react-native';
3
+
4
+ import { type DOMProps, type WebViewProps } from '../dom.types';
5
+
6
+ type UseDebugZeroHeightType = (dom: DOMProps) => {
7
+ debugZeroHeightStyle: WebViewProps['containerStyle'] | undefined;
8
+ debugOnLayout: ViewProps['onLayout'];
9
+ };
10
+
11
+ /**
12
+ * Debug only hook to help identify zero height issues in the DOM component.
13
+ */
14
+ export const useDebugZeroHeight: UseDebugZeroHeightType = __DEV__
15
+ ? (dom) => {
16
+ const [debugZeroHeightStyle, setDebugZeroHeightStyle] = useState<
17
+ WebViewProps['containerStyle'] | undefined
18
+ >(undefined);
19
+ const [hasLoggedWarning, setHasLoggedWarning] = useState(false);
20
+
21
+ const debugOnLayout = useCallback<NonNullable<ViewProps['onLayout']>>(
22
+ (event) => {
23
+ dom.onLayout?.(event);
24
+ if (dom.matchContents) {
25
+ return;
26
+ }
27
+ if (debugZeroHeightStyle !== undefined) {
28
+ return;
29
+ }
30
+ if (event.nativeEvent.layout.height === 0) {
31
+ if (!hasLoggedWarning) {
32
+ console.warn(`
33
+ The DOM component has a zero height in native hierarchy.
34
+ We are adding a debug style to help you identify the issue.
35
+ You can remove this style by using the \`matchContents\` prop or explicitly add a height from the component callsite.
36
+ \`\`\`
37
+ <YourDomComponent dom={{ matchContents: true }} />
38
+ // or
39
+ <YourDomComponent dom={{ style: { height: 50 } }} />
40
+ \`\`\`
41
+ `);
42
+ setHasLoggedWarning(true);
43
+ }
44
+ setDebugZeroHeightStyle({
45
+ borderWidth: 1,
46
+ borderColor: 'red',
47
+ borderRadius: 2,
48
+ minHeight: 40,
49
+ });
50
+ } else {
51
+ setDebugZeroHeightStyle({});
52
+ }
53
+ },
54
+ [dom.matchContents, dom.onLayout, debugZeroHeightStyle, hasLoggedWarning]
55
+ );
56
+
57
+ return { debugZeroHeightStyle, debugOnLayout };
58
+ }
59
+ : (dom) => ({
60
+ debugZeroHeightStyle: undefined,
61
+ debugOnLayout: dom.onLayout,
62
+ });
@@ -15,6 +15,7 @@ import {
15
15
  } from './injection';
16
16
  import ExpoDomWebView from './webview/ExpoDOMWebView';
17
17
  import RNWebView from './webview/RNWebView';
18
+ import { useDebugZeroHeight } from './webview/useDebugZeroHeight';
18
19
 
19
20
  interface Props {
20
21
  dom: DOMProps;
@@ -53,6 +54,8 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, filePath, ...marshalP
53
54
  const source = { uri: `${getBaseURL()}/${filePath}` };
54
55
  const [containerStyle, setContainerStyle] = React.useState<WebViewProps['containerStyle']>(null);
55
56
 
57
+ const { debugZeroHeightStyle, debugOnLayout } = useDebugZeroHeight(dom);
58
+
56
59
  const emit = React.useCallback(
57
60
  (detail: BridgeMessage<any>) => {
58
61
  webviewRef.current?.injectJavaScript(getInjectEventScript(detail));
@@ -110,8 +113,9 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, filePath, ...marshalP
110
113
  subscription.remove();
111
114
  });
112
115
  },
113
- containerStyle,
114
116
  ...dom,
117
+ containerStyle: [containerStyle, debugZeroHeightStyle, dom?.containerStyle],
118
+ onLayout: __DEV__ ? debugOnLayout : dom.onLayout,
115
119
  injectedJavaScriptBeforeContentLoaded: [
116
120
  // On first mount, inject `$$EXPO_INITIAL_PROPS` with the initial props.
117
121
  `window.$$EXPO_INITIAL_PROPS = ${JSON.stringify(smartActions)};true;`,