@module-federation/data-prefetch 0.0.0-next-20240808083234 → 0.0.0-next-20240909062831

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/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
1
  @module-federation/data-prefetch
2
2
 
3
- ## 0.0.0-next-20240808083234
3
+ ## 0.0.0-next-20240909062831
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 3ddab21: feat(@module-federation/data-prefetch): support data prefetch in Module Federation
8
- - @module-federation/runtime@0.0.0-next-20240808083234
9
- - @module-federation/sdk@0.0.0-next-20240808083234
8
+ - @module-federation/runtime@0.0.0-next-20240909062831
9
+ - @module-federation/sdk@0.0.0-next-20240909062831
@@ -45,17 +45,9 @@ var MFDataPrefetch = class {
45
45
  const remoteInfo = getRemoteInfo(remote);
46
46
  const module = origin.moduleCache.get(remoteInfo.name);
47
47
  return getRemoteEntry({
48
+ origin,
48
49
  remoteInfo,
49
- remoteEntryExports: module ? module.remoteEntryExports : void 0,
50
- createScriptHook: (url) => {
51
- const res = origin.loaderHook.lifecycle.createScript.emit({
52
- url
53
- });
54
- if (res instanceof HTMLScriptElement) {
55
- return res;
56
- }
57
- return;
58
- }
50
+ remoteEntryExports: module ? module.remoteEntryExports : void 0
59
51
  });
60
52
  }
61
53
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-TTJJJ2WZ.js";
4
4
  import {
5
5
  MFDataPrefetch
6
- } from "./chunk-XYNYYK45.js";
6
+ } from "./chunk-57ZXBP7D.js";
7
7
  import {
8
8
  getSignalFromManifest
9
9
  } from "./chunk-VWDP6NMM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MFDataPrefetch
3
- } from "./chunk-XYNYYK45.js";
3
+ } from "./chunk-57ZXBP7D.js";
4
4
  import {
5
5
  getScope
6
6
  } from "./chunk-VWDP6NMM.js";
package/dist/esm/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  prefetchPlugin
3
- } from "./chunk-TW3B6M25.js";
3
+ } from "./chunk-H3DTWHY4.js";
4
4
  import "./chunk-TTJJJ2WZ.js";
5
5
  import {
6
6
  MFDataPrefetch
7
- } from "./chunk-XYNYYK45.js";
7
+ } from "./chunk-57ZXBP7D.js";
8
8
  import "./chunk-VWDP6NMM.js";
9
9
  export {
10
10
  MFDataPrefetch,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  plugin_default,
3
3
  prefetchPlugin
4
- } from "./chunk-TW3B6M25.js";
4
+ } from "./chunk-H3DTWHY4.js";
5
5
  import "./chunk-TTJJJ2WZ.js";
6
- import "./chunk-XYNYYK45.js";
6
+ import "./chunk-57ZXBP7D.js";
7
7
  import "./chunk-VWDP6NMM.js";
8
8
  export {
9
9
  plugin_default as default,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  prefetch
3
- } from "../chunk-V2LJYA45.js";
3
+ } from "../chunk-OIIVUMED.js";
4
4
  import {
5
5
  logger_default
6
6
  } from "../chunk-TTJJJ2WZ.js";
7
7
  import {
8
8
  MFDataPrefetch
9
- } from "../chunk-XYNYYK45.js";
9
+ } from "../chunk-57ZXBP7D.js";
10
10
  import {
11
11
  getScope
12
12
  } from "../chunk-VWDP6NMM.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  prefetch
3
- } from "../chunk-V2LJYA45.js";
4
- import "../chunk-XYNYYK45.js";
3
+ } from "../chunk-OIIVUMED.js";
4
+ import "../chunk-57ZXBP7D.js";
5
5
  import "../chunk-VWDP6NMM.js";
6
6
  export {
7
7
  prefetch
package/dist/index.js CHANGED
@@ -81,17 +81,9 @@ var MFDataPrefetch = class {
81
81
  const remoteInfo = (0, import_runtime.getRemoteInfo)(remote);
82
82
  const module2 = origin.moduleCache.get(remoteInfo.name);
83
83
  return (0, import_runtime.getRemoteEntry)({
84
+ origin,
84
85
  remoteInfo,
85
- remoteEntryExports: module2 ? module2.remoteEntryExports : void 0,
86
- createScriptHook: (url) => {
87
- const res = origin.loaderHook.lifecycle.createScript.emit({
88
- url
89
- });
90
- if (res instanceof HTMLScriptElement) {
91
- return res;
92
- }
93
- return;
94
- }
86
+ remoteEntryExports: module2 ? module2.remoteEntryExports : void 0
95
87
  });
96
88
  }
97
89
  }
package/dist/plugin.js CHANGED
@@ -80,17 +80,9 @@ var MFDataPrefetch = class {
80
80
  const remoteInfo = (0, import_runtime.getRemoteInfo)(remote);
81
81
  const module2 = origin.moduleCache.get(remoteInfo.name);
82
82
  return (0, import_runtime.getRemoteEntry)({
83
+ origin,
83
84
  remoteInfo,
84
- remoteEntryExports: module2 ? module2.remoteEntryExports : void 0,
85
- createScriptHook: (url) => {
86
- const res = origin.loaderHook.lifecycle.createScript.emit({
87
- url
88
- });
89
- if (res instanceof HTMLScriptElement) {
90
- return res;
91
- }
92
- return;
93
- }
85
+ remoteEntryExports: module2 ? module2.remoteEntryExports : void 0
94
86
  });
95
87
  }
96
88
  }
@@ -83,17 +83,9 @@ var MFDataPrefetch = class {
83
83
  const remoteInfo = (0, import_runtime.getRemoteInfo)(remote);
84
84
  const module2 = origin.moduleCache.get(remoteInfo.name);
85
85
  return (0, import_runtime.getRemoteEntry)({
86
+ origin,
86
87
  remoteInfo,
87
- remoteEntryExports: module2 ? module2.remoteEntryExports : void 0,
88
- createScriptHook: (url) => {
89
- const res = origin.loaderHook.lifecycle.createScript.emit({
90
- url
91
- });
92
- if (res instanceof HTMLScriptElement) {
93
- return res;
94
- }
95
- return;
96
- }
88
+ remoteEntryExports: module2 ? module2.remoteEntryExports : void 0
97
89
  });
98
90
  }
99
91
  }
@@ -76,17 +76,9 @@ var MFDataPrefetch = class {
76
76
  const remoteInfo = (0, import_runtime.getRemoteInfo)(remote);
77
77
  const module2 = origin.moduleCache.get(remoteInfo.name);
78
78
  return (0, import_runtime.getRemoteEntry)({
79
+ origin,
79
80
  remoteInfo,
80
- remoteEntryExports: module2 ? module2.remoteEntryExports : void 0,
81
- createScriptHook: (url) => {
82
- const res = origin.loaderHook.lifecycle.createScript.emit({
83
- url
84
- });
85
- if (res instanceof HTMLScriptElement) {
86
- return res;
87
- }
88
- return;
89
- }
81
+ remoteEntryExports: module2 ? module2.remoteEntryExports : void 0
90
82
  });
91
83
  }
92
84
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@module-federation/data-prefetch",
3
3
  "description": "Module Federation Data Prefetch",
4
- "version": "0.0.0-next-20240808083234",
4
+ "version": "0.0.0-next-20240909062831",
5
5
  "author": "nieyan <nyqykk@foxmail.com>",
6
6
  "homepage": "https://github.com/module-federation/core",
7
7
  "license": "MIT",
@@ -85,8 +85,8 @@
85
85
  },
86
86
  "dependencies": {
87
87
  "fs-extra": "9.1.0",
88
- "@module-federation/sdk": "0.0.0-next-20240808083234",
89
- "@module-federation/runtime": "0.0.0-next-20240808083234"
88
+ "@module-federation/sdk": "0.0.0-next-20240909062831",
89
+ "@module-federation/runtime": "0.0.0-next-20240909062831"
90
90
  },
91
91
  "scripts": {
92
92
  "dev": "cross-env WATCH=true tsup",
package/src/prefetch.ts CHANGED
@@ -82,17 +82,9 @@ export class MFDataPrefetch {
82
82
  const remoteInfo = getRemoteInfo(remote as Remote);
83
83
  const module = origin!.moduleCache.get(remoteInfo.name);
84
84
  return getRemoteEntry({
85
+ origin: origin!,
85
86
  remoteInfo,
86
87
  remoteEntryExports: module ? module.remoteEntryExports : undefined,
87
- createScriptHook: (url: string) => {
88
- const res = origin!.loaderHook.lifecycle.createScript.emit({
89
- url,
90
- });
91
- if (res instanceof HTMLScriptElement) {
92
- return res;
93
- }
94
- return;
95
- },
96
88
  });
97
89
  }
98
90
  }