@lvce-editor/embeds-worker 2.1.0 → 2.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.
@@ -756,6 +756,9 @@ const createRpc = ipc => {
756
756
  },
757
757
  invokeAndTransfer(method, ...params) {
758
758
  return invokeAndTransfer$1(ipc, method, ...params);
759
+ },
760
+ async dispose() {
761
+ await ipc?.dispose();
759
762
  }
760
763
  };
761
764
  return rpc;
@@ -876,7 +879,7 @@ const create$1 = async ({
876
879
  port2
877
880
  } = getPortTuple();
878
881
  // TODO call sendMessagePortToSharedProcess function instead
879
- await invokeAndTransfer('IpcParent.create', [port1], {
882
+ await invokeAndTransfer('IpcParent.create', {
880
883
  method: 8,
881
884
  type: 1,
882
885
  initialCommand,
@@ -914,11 +917,15 @@ const create = async options => {
914
917
  };
915
918
 
916
919
  const launchEmbedsProcessIpc = async () => {
917
- const ipc = await create({
918
- initialCommand: 'HandleMessagePortForEmbedsProcess.handleMessagePortForEmbedsProcess'
919
- });
920
- handleIpc(ipc);
921
- return ipc;
920
+ try {
921
+ const ipc = await create({
922
+ initialCommand: 'HandleMessagePortForEmbedsProcess.handleMessagePortForEmbedsProcess'
923
+ });
924
+ handleIpc(ipc);
925
+ return ipc;
926
+ } catch (error) {
927
+ throw new VError(error, `Failed to launch embeds process`);
928
+ }
922
929
  };
923
930
 
924
931
  const state = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/embeds-worker",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "main": "dist/embedsWorkerMain.js",
6
6
  "type": "module",