expo 52.0.41 → 52.0.43
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/devtools/DevToolsPluginClient.d.ts +2 -0
- package/build/devtools/DevToolsPluginClient.d.ts.map +1 -1
- package/build/devtools/DevToolsPluginClientImplApp.d.ts +1 -0
- package/build/devtools/DevToolsPluginClientImplApp.d.ts.map +1 -1
- package/build/devtools/MessageFramePacker.d.ts +1 -1
- package/build/devtools/MessageFramePacker.d.ts.map +1 -1
- package/bundledNativeModules.json +21 -13
- package/package.json +6 -6
- package/src/devtools/DevToolsPluginClient.ts +12 -1
- package/src/devtools/DevToolsPluginClientImplApp.ts +40 -4
- package/src/devtools/MessageFramePacker.ts +5 -2
- package/src/winter/fetch/__tests__/convertFormData-test.native.ts +1 -1
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.
|
|
36
|
+
version = '52.0.43'
|
|
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.
|
|
49
|
+
versionName "52.0.43"
|
|
50
50
|
consumerProguardFiles("proguard-rules.pro")
|
|
51
51
|
}
|
|
52
52
|
testOptions {
|
|
@@ -30,6 +30,8 @@ export declare abstract class DevToolsPluginClient {
|
|
|
30
30
|
* @param params any extra payload.
|
|
31
31
|
*/
|
|
32
32
|
sendMessage(method: string, params: any): void;
|
|
33
|
+
protected sendMessageLegacy(method: string, params: any): void;
|
|
34
|
+
private sendMessageImpl;
|
|
33
35
|
/**
|
|
34
36
|
* Subscribe to a message from the other end of DevTools.
|
|
35
37
|
* @param method Subscribe to a message with a method name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevToolsPluginClient.d.ts","sourceRoot":"","sources":["../../src/devtools/DevToolsPluginClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,KAAK,EACV,cAAc,EACd,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAS1B;;;GAGG;AACH,8BAAsB,oBAAoB;aAYtB,cAAc,EAAE,cAAc;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAZ3B,SAAS,CAAC,YAAY,EAAE,YAAY,CAAsB;IAE1D,OAAO,CAAC,MAAM,CAAC,cAAc,CAAsD;IACnF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8D;IAEtF,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,OAAO,SAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CACR;gBAGT,cAAc,EAAE,cAAc,EAC7B,OAAO,CAAC,yCAA6B;IAKxD;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQvC;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAWxC;;;;OAIG;IACI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;
|
|
1
|
+
{"version":3,"file":"DevToolsPluginClient.d.ts","sourceRoot":"","sources":["../../src/devtools/DevToolsPluginClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,KAAK,EACV,cAAc,EACd,2BAA2B,EAC3B,sBAAsB,EAC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YAAY,IAAI,OAAO,CAAC,SAAS,CAAC;IAyB5C,SAAS,CAAC,aAAa,UAAiB,qBAAqB,mBAuB3D;IAEF;;;OAGG;IACI,wBAAwB,IAAI,qBAAqB;CAGzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevToolsPluginClientImplApp.d.ts","sourceRoot":"","sources":["../../src/devtools/DevToolsPluginClientImplApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"DevToolsPluginClientImplApp.d.ts","sourceRoot":"","sources":["../../src/devtools/DevToolsPluginClientImplApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAS9D;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,oBAAoB;IACnE,OAAO,CAAC,gBAAgB,CAA6C;IAErE;;;OAGG;IACY,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;IAUhD,OAAO,CAAC,mBAAmB;IAiD3B,OAAO,CAAC,sBAAsB;CAQ/B"}
|
|
@@ -38,7 +38,7 @@ interface MessageFrame<T extends MessageKeyTypeBase> {
|
|
|
38
38
|
export declare class MessageFramePacker<T extends MessageKeyTypeBase> {
|
|
39
39
|
private textEncoder;
|
|
40
40
|
private textDecoder;
|
|
41
|
-
pack({ messageKey, payload }: MessageFrame<T
|
|
41
|
+
pack({ messageKey, payload }: MessageFrame<T>, useLegacyTransport?: boolean): string | Uint8Array | Promise<Uint8Array>;
|
|
42
42
|
unpack(packedData: string | ArrayBuffer): MessageFrame<T>;
|
|
43
43
|
private isFastPathPayload;
|
|
44
44
|
private payloadToUint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageFramePacker.d.ts","sourceRoot":"","sources":["../../src/devtools/MessageFramePacker.ts"],"names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AG,YAAY,CAAC,CAAC,CAAC;IA0BhE,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,QAAQ;IA8BhB,OAAO,CAAC,kBAAkB;IAoC1B,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAqBvC"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"@dev-plugins/apollo-client": "~0.2.0",
|
|
3
|
+
"@dev-plugins/async-storage": "~0.2.0",
|
|
4
|
+
"@dev-plugins/react-native-mmkv": "~0.2.0",
|
|
5
|
+
"@dev-plugins/react-navigation": "~0.2.0",
|
|
6
|
+
"@dev-plugins/react-query": "~0.2.0",
|
|
7
|
+
"@dev-plugins/redux": "~0.2.0",
|
|
8
|
+
"@dev-plugins/tinybase": "~0.2.0",
|
|
9
|
+
"@dev-plugins/vanilla-log-viewer": "~0.2.0",
|
|
2
10
|
"@expo/metro-runtime": "~4.0.1",
|
|
3
11
|
"@expo/vector-icons": "^14.0.2",
|
|
4
12
|
"@react-native-async-storage/async-storage": "1.23.1",
|
|
@@ -20,8 +28,8 @@
|
|
|
20
28
|
"expo-audio": "~0.3.5",
|
|
21
29
|
"expo-auth-session": "~6.0.3",
|
|
22
30
|
"expo-av": "~15.0.2",
|
|
23
|
-
"expo-background-fetch": "~13.0.
|
|
24
|
-
"expo-background-task": "~0.1.
|
|
31
|
+
"expo-background-fetch": "~13.0.6",
|
|
32
|
+
"expo-background-task": "~0.1.4",
|
|
25
33
|
"expo-battery": "~9.0.2",
|
|
26
34
|
"expo-blur": "~14.0.3",
|
|
27
35
|
"expo-brightness": "~13.0.3",
|
|
@@ -34,13 +42,13 @@
|
|
|
34
42
|
"expo-constants": "~17.0.8",
|
|
35
43
|
"expo-contacts": "~14.0.5",
|
|
36
44
|
"expo-crypto": "~14.0.2",
|
|
37
|
-
"expo-dev-client": "~5.0.
|
|
38
|
-
"expo-device": "~7.0.
|
|
45
|
+
"expo-dev-client": "~5.0.19",
|
|
46
|
+
"expo-device": "~7.0.3",
|
|
39
47
|
"expo-document-picker": "~13.0.3",
|
|
40
48
|
"expo-face-detector": "~13.0.2",
|
|
41
49
|
"expo-file-system": "~18.0.12",
|
|
42
50
|
"expo-font": "~13.0.4",
|
|
43
|
-
"expo-gl": "~15.0.
|
|
51
|
+
"expo-gl": "~15.0.5",
|
|
44
52
|
"expo-google-app-auth": "~8.3.0",
|
|
45
53
|
"expo-haptics": "~14.0.1",
|
|
46
54
|
"expo-image": "~2.0.7",
|
|
@@ -54,16 +62,16 @@
|
|
|
54
62
|
"expo-linking": "~7.0.5",
|
|
55
63
|
"expo-local-authentication": "~15.0.2",
|
|
56
64
|
"expo-localization": "~16.0.1",
|
|
57
|
-
"expo-location": "~18.0.
|
|
65
|
+
"expo-location": "~18.0.10",
|
|
58
66
|
"expo-mail-composer": "~14.0.2",
|
|
59
67
|
"expo-media-library": "~17.0.6",
|
|
60
|
-
"expo-module-template": "~10.15.
|
|
68
|
+
"expo-module-template": "~10.15.14",
|
|
61
69
|
"expo-modules-core": "~2.2.3",
|
|
62
|
-
"expo-navigation-bar": "~4.0.
|
|
70
|
+
"expo-navigation-bar": "~4.0.9",
|
|
63
71
|
"expo-network": "~7.0.5",
|
|
64
72
|
"expo-notifications": "~0.29.14",
|
|
65
73
|
"expo-print": "~14.0.3",
|
|
66
|
-
"expo-router": "~4.0.
|
|
74
|
+
"expo-router": "~4.0.20",
|
|
67
75
|
"expo-screen-capture": "~7.0.1",
|
|
68
76
|
"expo-screen-orientation": "~8.0.4",
|
|
69
77
|
"expo-secure-store": "~14.0.1",
|
|
@@ -72,12 +80,12 @@
|
|
|
72
80
|
"expo-sms": "~13.0.1",
|
|
73
81
|
"expo-speech": "~13.0.1",
|
|
74
82
|
"expo-splash-screen": "~0.29.22",
|
|
75
|
-
"expo-sqlite": "~15.1.
|
|
83
|
+
"expo-sqlite": "~15.1.4",
|
|
76
84
|
"expo-status-bar": "~2.0.1",
|
|
77
85
|
"expo-store-review": "~8.0.1",
|
|
78
86
|
"expo-symbols": "~0.2.2",
|
|
79
|
-
"expo-system-ui": "~4.0.
|
|
80
|
-
"expo-task-manager": "~12.0.
|
|
87
|
+
"expo-system-ui": "~4.0.9",
|
|
88
|
+
"expo-task-manager": "~12.0.6",
|
|
81
89
|
"expo-tracking-transparency": "~5.1.1",
|
|
82
90
|
"expo-updates": "~0.27.4",
|
|
83
91
|
"expo-video-thumbnails": "~9.0.3",
|
|
@@ -87,7 +95,7 @@
|
|
|
87
95
|
"lottie-react-native": "7.1.0",
|
|
88
96
|
"react": "18.3.1",
|
|
89
97
|
"react-dom": "18.3.1",
|
|
90
|
-
"react-native": "0.76.
|
|
98
|
+
"react-native": "0.76.9",
|
|
91
99
|
"react-native-web": "~0.19.13",
|
|
92
100
|
"react-native-gesture-handler": "~2.20.2",
|
|
93
101
|
"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.
|
|
3
|
+
"version": "52.0.43",
|
|
4
4
|
"description": "The Expo SDK",
|
|
5
5
|
"main": "src/Expo.ts",
|
|
6
6
|
"module": "src/Expo.ts",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"homepage": "https://github.com/expo/expo/tree/main/packages/expo",
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@babel/runtime": "^7.20.0",
|
|
75
|
-
"@expo/cli": "0.22.
|
|
75
|
+
"@expo/cli": "0.22.24",
|
|
76
76
|
"@expo/config": "~10.0.11",
|
|
77
77
|
"@expo/config-plugins": "~9.0.17",
|
|
78
78
|
"@expo/fingerprint": "0.11.11",
|
|
79
79
|
"@expo/metro-config": "0.19.12",
|
|
80
80
|
"@expo/vector-icons": "^14.0.0",
|
|
81
|
-
"babel-preset-expo": "~12.0.
|
|
81
|
+
"babel-preset-expo": "~12.0.11",
|
|
82
82
|
"expo-asset": "~11.0.5",
|
|
83
83
|
"expo-constants": "~17.0.8",
|
|
84
84
|
"expo-file-system": "~18.0.12",
|
|
@@ -93,10 +93,10 @@
|
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@types/react": "~18.3.12",
|
|
95
95
|
"@types/react-test-renderer": "^18.3.0",
|
|
96
|
-
"expo-module-scripts": "^4.0.
|
|
96
|
+
"expo-module-scripts": "^4.0.5",
|
|
97
97
|
"react": "18.3.1",
|
|
98
98
|
"react-dom": "18.3.1",
|
|
99
|
-
"react-native": "0.76.
|
|
99
|
+
"react-native": "0.76.9"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@expo/dom-webview": "*",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"optional": true
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "e6e04f1d8f887acfbb0f2164058c5fd444c2f439"
|
|
120
120
|
}
|
|
@@ -70,6 +70,14 @@ export abstract class DevToolsPluginClient {
|
|
|
70
70
|
* @param params any extra payload.
|
|
71
71
|
*/
|
|
72
72
|
public sendMessage(method: string, params: any) {
|
|
73
|
+
this.sendMessageImpl(method, params, false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
protected sendMessageLegacy(method: string, params: any) {
|
|
77
|
+
this.sendMessageImpl(method, params, true);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private sendMessageImpl(method: string, params: any, useLegacyTransport: boolean) {
|
|
73
81
|
if (this.wsStore.ws?.readyState === WebSocket.CLOSED) {
|
|
74
82
|
logger.warn('Unable to send message in a disconnected state.');
|
|
75
83
|
return;
|
|
@@ -78,7 +86,10 @@ export abstract class DevToolsPluginClient {
|
|
|
78
86
|
pluginName: this.connectionInfo.pluginName,
|
|
79
87
|
method,
|
|
80
88
|
};
|
|
81
|
-
const packedData = this.messageFramePacker.pack(
|
|
89
|
+
const packedData = this.messageFramePacker.pack(
|
|
90
|
+
{ messageKey, payload: params },
|
|
91
|
+
useLegacyTransport
|
|
92
|
+
);
|
|
82
93
|
if (!(packedData instanceof Promise)) {
|
|
83
94
|
this.wsStore.ws?.send(packedData);
|
|
84
95
|
return;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { DevToolsPluginClient } from './DevToolsPluginClient';
|
|
2
|
+
import type { HandshakeMessageParams } from './devtools.types';
|
|
2
3
|
import * as logger from './logger';
|
|
3
4
|
|
|
5
|
+
interface BrowserClientMetadata {
|
|
6
|
+
browserClientId: string;
|
|
7
|
+
useLegacyTransport?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
/**
|
|
5
11
|
* The DevToolsPluginClient for the app -> browser communication.
|
|
6
12
|
*/
|
|
7
13
|
export class DevToolsPluginClientImplApp extends DevToolsPluginClient {
|
|
8
|
-
|
|
9
|
-
private browserClientMap: Record<string, string> = {};
|
|
14
|
+
private browserClientMap: Record<string, BrowserClientMetadata> = {};
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* Initialize the connection.
|
|
@@ -17,6 +22,16 @@ export class DevToolsPluginClientImplApp extends DevToolsPluginClient {
|
|
|
17
22
|
this.addHandshakeHandler();
|
|
18
23
|
}
|
|
19
24
|
|
|
25
|
+
override sendMessage(method: string, params: any) {
|
|
26
|
+
const pluginName = this.connectionInfo.pluginName;
|
|
27
|
+
const useLegacyTransport = this.browserClientMap[pluginName]?.useLegacyTransport ?? false;
|
|
28
|
+
if (useLegacyTransport) {
|
|
29
|
+
this.sendMessageLegacy(method, params);
|
|
30
|
+
} else {
|
|
31
|
+
super.sendMessage(method, params);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
20
35
|
private addHandshakeHandler() {
|
|
21
36
|
this.addHandskakeMessageListener((params) => {
|
|
22
37
|
if (params.method === 'handshake') {
|
|
@@ -33,15 +48,36 @@ export class DevToolsPluginClientImplApp extends DevToolsPluginClient {
|
|
|
33
48
|
}
|
|
34
49
|
|
|
35
50
|
// [1] Terminate duplicated browser clients for the same plugin
|
|
36
|
-
const
|
|
51
|
+
const previousBrowserClientMetadata = this.browserClientMap[pluginName];
|
|
52
|
+
const previousBrowserClientId = previousBrowserClientMetadata?.browserClientId;
|
|
37
53
|
if (previousBrowserClientId != null && previousBrowserClientId !== params.browserClientId) {
|
|
38
54
|
logger.info(
|
|
39
55
|
`Terminate the previous browser client connection - previousBrowserClientId[${previousBrowserClientId}]`
|
|
40
56
|
);
|
|
41
57
|
this.terminateBrowserClient(pluginName, previousBrowserClientId);
|
|
42
58
|
}
|
|
43
|
-
this.browserClientMap[pluginName] =
|
|
59
|
+
this.browserClientMap[pluginName] = {
|
|
60
|
+
browserClientId: params.browserClientId,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// backward compatible handshaking
|
|
66
|
+
this.addMessageListener('handshake', (params: HandshakeMessageParams) => {
|
|
67
|
+
console.warn(`Received a legacy plugin handshake message - pluginName[${params.pluginName}]`);
|
|
68
|
+
const { pluginName } = params;
|
|
69
|
+
const previousBrowserClientMetadata = this.browserClientMap[pluginName];
|
|
70
|
+
const previousBrowserClientId = previousBrowserClientMetadata?.browserClientId;
|
|
71
|
+
if (previousBrowserClientId != null && previousBrowserClientId !== params.browserClientId) {
|
|
72
|
+
logger.info(
|
|
73
|
+
`Terminate the previous browser client connection - previousBrowserClientId[${previousBrowserClientId}]`
|
|
74
|
+
);
|
|
75
|
+
this.sendMessage('terminateBrowserClient', { browserClientId: previousBrowserClientId });
|
|
44
76
|
}
|
|
77
|
+
this.browserClientMap[pluginName] = {
|
|
78
|
+
browserClientId: params.browserClientId,
|
|
79
|
+
useLegacyTransport: true,
|
|
80
|
+
};
|
|
45
81
|
});
|
|
46
82
|
}
|
|
47
83
|
|
|
@@ -55,9 +55,12 @@ export class MessageFramePacker<T extends MessageKeyTypeBase> {
|
|
|
55
55
|
private textEncoder = new TextEncoder();
|
|
56
56
|
private textDecoder = new TextDecoder();
|
|
57
57
|
|
|
58
|
-
public pack(
|
|
58
|
+
public pack(
|
|
59
|
+
{ messageKey, payload }: MessageFrame<T>,
|
|
60
|
+
useLegacyTransport?: boolean
|
|
61
|
+
): string | Uint8Array | Promise<Uint8Array> {
|
|
59
62
|
// Fast path to pack as string given `JSON.stringify` is fast.
|
|
60
|
-
if (this.isFastPathPayload(payload)) {
|
|
63
|
+
if (this.isFastPathPayload(payload) && !useLegacyTransport) {
|
|
61
64
|
return JSON.stringify({ messageKey, payload });
|
|
62
65
|
}
|
|
63
66
|
|
|
@@ -40,7 +40,7 @@ describe(convertFormDataAsync, () => {
|
|
|
40
40
|
const { body, boundary: resultBoundary } = await convertFormDataAsync(formData, boundary);
|
|
41
41
|
expect(new TextDecoder().decode(body)).toMatchInlineSnapshot(`
|
|
42
42
|
"------ExpoFetchFormBoundary0000000000000000
|
|
43
|
-
content-disposition: form-data; name="blob"; filename="blobFile"
|
|
43
|
+
content-disposition: form-data; name="blob"; filename="blobFile"
|
|
44
44
|
content-type: text/plain
|
|
45
45
|
|
|
46
46
|
hello blob
|