@lvce-editor/extension-host-worker 3.21.0 → 4.0.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.
@@ -1556,7 +1556,8 @@ class IpcParentWithMessagePort extends Ipc {
1556
1556
  this._rawIpc.postMessage(message);
1557
1557
  }
1558
1558
  sendAndTransfer(message) {
1559
- throw new Error('not implemented');
1559
+ const transfer = getTransferrables(message);
1560
+ this._rawIpc.postMessage(message, transfer);
1560
1561
  }
1561
1562
  dispose() {
1562
1563
  this._rawIpc.close();
@@ -3642,52 +3643,24 @@ const getAssetDir = () => {
3642
3643
  };
3643
3644
  const assetDir = getAssetDir();
3644
3645
 
3645
- const webExtensionsUrl = `${assetDir}/config/webExtensions.json`;
3646
+ const extensionsUrl = `${assetDir}/config/extensions.json`;
3646
3647
 
3647
- const getSharedProcessExtensions$1 = () => {
3648
- return invoke$2(/* ExtensionManagement.getExtensions */'ExtensionManagement.getExtensions');
3649
- };
3650
- const getStaticWebExtensions = () => {
3651
- return getJson(webExtensionsUrl);
3652
- };
3653
- const getWebExtensionsWeb = async () => {
3654
- const staticWebExtensions = await getStaticWebExtensions();
3655
- return [...staticWebExtensions, ...state$5.webExtensions];
3656
- };
3657
- const isWebExtension = extension => {
3658
- return extension && typeof extension.browser === 'string';
3659
- };
3660
- const getWebExtensionsDefault = async () => {
3661
- const staticWebExtensions = await getStaticWebExtensions();
3662
- const sharedProcessExtensions = await getSharedProcessExtensions$1();
3663
- const sharedProcessWebExtensions = sharedProcessExtensions.filter(isWebExtension);
3664
- return [...staticWebExtensions, sharedProcessWebExtensions, ...state$5.webExtensions];
3665
- };
3666
3648
  const getWebExtensions = async () => {
3667
- try {
3668
- switch (platform) {
3669
- case Web:
3670
- return await getWebExtensionsWeb();
3671
- default:
3672
- return await getWebExtensionsDefault();
3673
- }
3674
- } catch {
3675
- return state$5.webExtensions;
3676
- }
3649
+ return getJson(extensionsUrl);
3677
3650
  };
3678
3651
 
3679
3652
  const getSharedProcessExtensions = () => {
3680
3653
  return invoke$2(/* ExtensionManagement.getExtensions */'ExtensionManagement.getExtensions');
3681
3654
  };
3682
3655
  const doGetExtensions = async () => {
3656
+ const meta = state$5.webExtensions;
3683
3657
  if (platform === Web) {
3684
3658
  const webExtensions = await getWebExtensions();
3685
- return webExtensions;
3659
+ return [...webExtensions, ...meta];
3686
3660
  }
3687
3661
  if (platform === Remote) {
3688
- const webExtensions = await getWebExtensions();
3689
3662
  const sharedProcessExtensions = await getSharedProcessExtensions();
3690
- return [...sharedProcessExtensions, ...webExtensions];
3663
+ return [...sharedProcessExtensions(), ...meta];
3691
3664
  }
3692
3665
  const extensions = await getSharedProcessExtensions();
3693
3666
  return extensions;
@@ -5490,11 +5463,21 @@ const listen = async () => {
5490
5463
  };
5491
5464
 
5492
5465
  const main = async () => {
5466
+ const start = performance.timeOrigin;
5467
+ const a = performance.now();
5493
5468
  setup({
5494
5469
  errorConstructor: Error,
5495
5470
  global: globalThis
5496
5471
  });
5497
5472
  await listen();
5473
+ const e = performance.now();
5474
+ console.log({
5475
+ times: {
5476
+ start,
5477
+ a,
5478
+ e
5479
+ }
5480
+ });
5498
5481
  };
5499
5482
 
5500
5483
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "3.21.0",
3
+ "version": "4.0.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "main": "dist/extensionHostWorkerMain.js",
6
6
  "type": "module",