@lvce-editor/extension-host-worker 5.1.0 → 5.3.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.
|
@@ -1668,7 +1668,7 @@ const registerPromise = () => {
|
|
|
1668
1668
|
promise
|
|
1669
1669
|
};
|
|
1670
1670
|
};
|
|
1671
|
-
const create$2$
|
|
1671
|
+
const create$2$2 = (method, params) => {
|
|
1672
1672
|
const {
|
|
1673
1673
|
id,
|
|
1674
1674
|
promise
|
|
@@ -1960,7 +1960,7 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
1960
1960
|
const {
|
|
1961
1961
|
message,
|
|
1962
1962
|
promise
|
|
1963
|
-
} = create$2$
|
|
1963
|
+
} = create$2$2(method, params);
|
|
1964
1964
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
1965
1965
|
ipc.sendAndTransfer(message);
|
|
1966
1966
|
} else {
|
|
@@ -2084,6 +2084,26 @@ const MessagePortRpcParent = {
|
|
|
2084
2084
|
__proto__: null,
|
|
2085
2085
|
create: create$8
|
|
2086
2086
|
};
|
|
2087
|
+
const create$2$1 = async ({
|
|
2088
|
+
commandMap,
|
|
2089
|
+
messagePort
|
|
2090
|
+
}) => {
|
|
2091
|
+
// TODO create a commandMap per rpc instance
|
|
2092
|
+
register$1(commandMap);
|
|
2093
|
+
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
2094
|
+
messagePort,
|
|
2095
|
+
isMessagePortOpen: true
|
|
2096
|
+
});
|
|
2097
|
+
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
2098
|
+
handleIpc(ipc);
|
|
2099
|
+
const rpc = createRpc$1(ipc);
|
|
2100
|
+
messagePort.start();
|
|
2101
|
+
return rpc;
|
|
2102
|
+
};
|
|
2103
|
+
const PlainMessagePortRpcParent = {
|
|
2104
|
+
__proto__: null,
|
|
2105
|
+
create: create$2$1
|
|
2106
|
+
};
|
|
2087
2107
|
const create$1$1 = async ({
|
|
2088
2108
|
commandMap,
|
|
2089
2109
|
webSocket
|
|
@@ -2191,6 +2211,8 @@ const create$5 = async ({
|
|
|
2191
2211
|
type
|
|
2192
2212
|
}) => {
|
|
2193
2213
|
const port = await getPort();
|
|
2214
|
+
// TODO rpc module should start port
|
|
2215
|
+
port.start();
|
|
2194
2216
|
const rpc = await MessagePortRpcParent.create({
|
|
2195
2217
|
messagePort: port,
|
|
2196
2218
|
isMessagePortOpen: true,
|
|
@@ -4931,6 +4953,16 @@ const handleBeforeUnload = () => {
|
|
|
4931
4953
|
// console.log('before unload')
|
|
4932
4954
|
};
|
|
4933
4955
|
|
|
4956
|
+
const handleMessagePort2 = async (port, rpcId) => {
|
|
4957
|
+
const rpc = await PlainMessagePortRpcParent.create({
|
|
4958
|
+
messagePort: port,
|
|
4959
|
+
commandMap: {}
|
|
4960
|
+
});
|
|
4961
|
+
if (rpcId) {
|
|
4962
|
+
set$9(rpcId, rpc);
|
|
4963
|
+
}
|
|
4964
|
+
};
|
|
4965
|
+
|
|
4934
4966
|
const handleMessagePort = async (port, rpcId) => {
|
|
4935
4967
|
const rpc = await MessagePortRpcClient.create({
|
|
4936
4968
|
messagePort: port,
|
|
@@ -5540,6 +5572,7 @@ const commandMap = {
|
|
|
5540
5572
|
'FileSystemMemory.writeFile': writeFile,
|
|
5541
5573
|
'HandleBeforeUnload.handleBeforeUnload': handleBeforeUnload,
|
|
5542
5574
|
'HandleMessagePort.handleMessagePort': handleMessagePort,
|
|
5575
|
+
'HandleMessagePort.handleMessagePort2': handleMessagePort2,
|
|
5543
5576
|
'IconTheme.getJson': getIconThemeJson,
|
|
5544
5577
|
'IconTheme.getState': getState,
|
|
5545
5578
|
'IconTheme.hydrate': hydrate,
|