expo 52.0.0-preview.7 → 52.0.0-preview.8
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/android/build.gradle +2 -2
- package/build/dom/dom-hooks.d.ts.map +1 -1
- package/build/dom/injection.d.ts +1 -0
- package/build/dom/injection.d.ts.map +1 -1
- package/build/dom/webview-wrapper.d.ts.map +1 -1
- package/bundledNativeModules.json +5 -5
- package/package.json +7 -7
- package/src/dom/dom-hooks.ts +8 -0
- package/src/dom/injection.ts +1 -0
- package/src/dom/webview-wrapper.tsx +24 -9
package/android/build.gradle
CHANGED
|
@@ -33,7 +33,7 @@ def getRNVersion() {
|
|
|
33
33
|
ensureDependeciesWereEvaluated(project)
|
|
34
34
|
|
|
35
35
|
group = 'host.exp.exponent'
|
|
36
|
-
version = '52.0.0-preview.
|
|
36
|
+
version = '52.0.0-preview.8'
|
|
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.
|
|
49
|
+
versionName "52.0.0-preview.8"
|
|
50
50
|
consumerProguardFiles("proguard-rules.pro")
|
|
51
51
|
}
|
|
52
52
|
testOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-hooks.d.ts","sourceRoot":"","sources":["../../src/dom/dom-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEnG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"dom-hooks.d.ts","sourceRoot":"","sources":["../../src/dom/dom-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEnG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,oBAAoB,EACnE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EACX,IAAI,EAAE,MAAM,CAAC,EACb,IAAI,CAAC,EAAE,cAAc,QA4BtB"}
|
package/build/dom/injection.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const NATIVE_ACTION = "$$native_action";
|
|
|
3
3
|
export declare const NATIVE_ACTION_RESULT = "$$native_action_result";
|
|
4
4
|
export declare const DOM_EVENT = "$$dom_event";
|
|
5
5
|
export declare const MATCH_CONTENTS_EVENT = "$$match_contents_event";
|
|
6
|
+
export declare const REGISTER_DOM_IMPERATIVE_HANDLE_PROPS = "$$register_dom_imperative_handle_props";
|
|
6
7
|
export declare const getInjectEventScript: <T extends BridgeMessage<any>>(detail: T) => string;
|
|
7
8
|
export declare function getInjectEnvsScript(): string;
|
|
8
9
|
export declare function getInjectBodySizeObserverScript(): string;
|
|
@@ -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;
|
|
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 +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;
|
|
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"}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"expo-haptics": "~14.0.0",
|
|
46
46
|
"expo-image": "~2.0.0-preview.0",
|
|
47
47
|
"expo-image-loader": "~5.0.0",
|
|
48
|
-
"expo-image-manipulator": "~13.0.
|
|
48
|
+
"expo-image-manipulator": "~13.0.5",
|
|
49
49
|
"expo-image-picker": "~16.0.0",
|
|
50
50
|
"expo-intent-launcher": "~12.0.1",
|
|
51
51
|
"expo-insights": "~0.8.1",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"expo-mail-composer": "~14.0.1",
|
|
59
59
|
"expo-media-library": "~17.0.0",
|
|
60
60
|
"expo-module-template": "~10.15.3",
|
|
61
|
-
"expo-modules-core": "~2.0.0-preview.
|
|
61
|
+
"expo-modules-core": "~2.0.0-preview.6",
|
|
62
62
|
"expo-navigation-bar": "~4.0.1",
|
|
63
63
|
"expo-network": "~7.0.0",
|
|
64
|
-
"expo-notifications": "~0.29.
|
|
64
|
+
"expo-notifications": "~0.29.4",
|
|
65
65
|
"expo-print": "~14.0.2",
|
|
66
|
-
"expo-router": "~4.0.0-preview.
|
|
66
|
+
"expo-router": "~4.0.0-preview.5",
|
|
67
67
|
"expo-screen-capture": "~7.0.0",
|
|
68
68
|
"expo-screen-orientation": "~8.0.0",
|
|
69
69
|
"expo-secure-store": "~14.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"expo-video-thumbnails": "~9.0.0",
|
|
84
84
|
"expo-video": "~2.0.0-preview.0",
|
|
85
85
|
"expo-web-browser": "~14.0.0",
|
|
86
|
-
"jest-expo": "52.0.0-preview.
|
|
86
|
+
"jest-expo": "~52.0.0-preview.2",
|
|
87
87
|
"lottie-react-native": "7.0.0",
|
|
88
88
|
"react": "18.3.1",
|
|
89
89
|
"react-dom": "18.3.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo",
|
|
3
|
-
"version": "52.0.0-preview.
|
|
3
|
+
"version": "52.0.0-preview.8",
|
|
4
4
|
"description": "The Expo SDK",
|
|
5
5
|
"main": "src/Expo.ts",
|
|
6
6
|
"module": "src/Expo.ts",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"homepage": "https://github.com/expo/expo/tree/main/packages/expo",
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@babel/runtime": "^7.20.0",
|
|
69
|
-
"@expo/cli": "0.19.
|
|
69
|
+
"@expo/cli": "0.19.5",
|
|
70
70
|
"@expo/config": "10.0.2",
|
|
71
|
-
"@expo/config-plugins": "9.0.
|
|
71
|
+
"@expo/config-plugins": "9.0.4",
|
|
72
72
|
"@expo/metro-config": "0.19.0-preview.2",
|
|
73
73
|
"@expo/vector-icons": "^14.0.0",
|
|
74
74
|
"babel-preset-expo": "~12.0.0-preview.1",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"expo-font": "~13.0.0",
|
|
78
78
|
"expo-keep-awake": "~14.0.1",
|
|
79
79
|
"expo-modules-autolinking": "2.0.0-preview.2",
|
|
80
|
-
"expo-modules-core": "2.0.0-preview.
|
|
80
|
+
"expo-modules-core": "2.0.0-preview.6",
|
|
81
81
|
"fbemitter": "^3.0.0",
|
|
82
82
|
"web-streams-polyfill": "^3.3.2",
|
|
83
83
|
"whatwg-url-without-unicode": "8.0.0-3"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@types/react": "~18.
|
|
87
|
-
"@types/react-test-renderer": "^18.
|
|
86
|
+
"@types/react": "~18.3.12",
|
|
87
|
+
"@types/react-test-renderer": "^18.3.0",
|
|
88
88
|
"expo-module-scripts": "^4.0.0",
|
|
89
89
|
"react": "18.3.1",
|
|
90
90
|
"react-dom": "18.3.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"optional": true
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "8b9f5addf49cb5ef7598ca27ff60c0accff6a1c3"
|
|
112
112
|
}
|
package/src/dom/dom-hooks.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useImperativeHandle, type DependencyList, type Ref } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { DOMImperativeFactory } from './dom.types';
|
|
4
|
+
import { REGISTER_DOM_IMPERATIVE_HANDLE_PROPS } from './injection';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A React `useImperativeHandle` like hook for DOM components.
|
|
@@ -23,6 +24,13 @@ export function useDOMImperativeHandle<T extends DOMImperativeFactory>(
|
|
|
23
24
|
useEffect(() => {
|
|
24
25
|
if (!isTargetWeb) {
|
|
25
26
|
globalThis._domRefProxy = init();
|
|
27
|
+
// @ts-expect-error: Added via react-native-webview
|
|
28
|
+
window.ReactNativeWebView.postMessage(
|
|
29
|
+
JSON.stringify({
|
|
30
|
+
type: REGISTER_DOM_IMPERATIVE_HANDLE_PROPS,
|
|
31
|
+
data: Object.keys(globalThis._domRefProxy),
|
|
32
|
+
})
|
|
33
|
+
);
|
|
26
34
|
}
|
|
27
35
|
return () => {
|
|
28
36
|
if (!isTargetWeb) {
|
package/src/dom/injection.ts
CHANGED
|
@@ -4,6 +4,7 @@ export const NATIVE_ACTION = '$$native_action';
|
|
|
4
4
|
export const NATIVE_ACTION_RESULT = '$$native_action_result';
|
|
5
5
|
export const DOM_EVENT = '$$dom_event';
|
|
6
6
|
export const MATCH_CONTENTS_EVENT = '$$match_contents_event';
|
|
7
|
+
export const REGISTER_DOM_IMPERATIVE_HANDLE_PROPS = '$$register_dom_imperative_handle_props';
|
|
7
8
|
|
|
8
9
|
export const getInjectEventScript = <T extends BridgeMessage<any>>(detail: T) => {
|
|
9
10
|
return `;(function() {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
MATCH_CONTENTS_EVENT,
|
|
12
12
|
NATIVE_ACTION,
|
|
13
13
|
NATIVE_ACTION_RESULT,
|
|
14
|
+
REGISTER_DOM_IMPERATIVE_HANDLE_PROPS,
|
|
14
15
|
} from './injection';
|
|
15
16
|
import ExpoDomWebView from './webview/ExpoDOMWebView';
|
|
16
17
|
import RNWebView from './webview/RNWebView';
|
|
@@ -23,18 +24,26 @@ interface Props {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalProps }, ref) => {
|
|
26
|
-
if (ref != null && typeof ref
|
|
27
|
+
if (ref != null && typeof ref === 'object' && ref.current == null) {
|
|
27
28
|
ref.current = new Proxy(
|
|
28
29
|
{},
|
|
29
30
|
{
|
|
30
|
-
get(
|
|
31
|
+
get(_, prop) {
|
|
31
32
|
const propName = String(prop);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
if (domImperativeHandlePropsRef.current?.includes(propName)) {
|
|
34
|
+
return function (...args) {
|
|
35
|
+
const serializedArgs = args.map((arg) => JSON.stringify(arg)).join(',');
|
|
36
|
+
webviewRef.current?.injectJavaScript(
|
|
37
|
+
`window._domRefProxy.${propName}(${serializedArgs})`
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (typeof webviewRef.current?.[propName] === 'function') {
|
|
42
|
+
return function (...args) {
|
|
43
|
+
return webviewRef.current?.[propName](...args);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
38
47
|
},
|
|
39
48
|
}
|
|
40
49
|
);
|
|
@@ -42,6 +51,7 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalPro
|
|
|
42
51
|
|
|
43
52
|
const webView = resolveWebView(dom?.useExpoDOMWebView ?? false);
|
|
44
53
|
const webviewRef = React.useRef<WebViewRef>(null);
|
|
54
|
+
const domImperativeHandlePropsRef = React.useRef<string[]>([]);
|
|
45
55
|
const [containerStyle, setContainerStyle] = React.useState<WebViewProps['containerStyle']>(null);
|
|
46
56
|
|
|
47
57
|
const emit = React.useCallback(
|
|
@@ -77,7 +87,7 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalPro
|
|
|
77
87
|
return React.createElement(webView, {
|
|
78
88
|
webviewDebuggingEnabled: __DEV__,
|
|
79
89
|
// Make iOS scrolling feel native.
|
|
80
|
-
decelerationRate: 'normal',
|
|
90
|
+
decelerationRate: process.env.EXPO_OS === 'ios' ? 'normal' : undefined,
|
|
81
91
|
originWhitelist: ['*'],
|
|
82
92
|
allowFileAccess: true,
|
|
83
93
|
allowFileAccessFromFileURLs: true,
|
|
@@ -128,6 +138,11 @@ const RawWebView = React.forwardRef<object, Props>(({ dom, source, ...marshalPro
|
|
|
128
138
|
return;
|
|
129
139
|
}
|
|
130
140
|
|
|
141
|
+
if (type === REGISTER_DOM_IMPERATIVE_HANDLE_PROPS) {
|
|
142
|
+
domImperativeHandlePropsRef.current = data;
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
131
146
|
if (type === NATIVE_ACTION) {
|
|
132
147
|
const action = marshalProps[data.actionId];
|
|
133
148
|
if (action == null) {
|