@module-federation/data-prefetch 0.19.1 → 0.20.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.
- package/dist/babel.cjs.cjs +23 -15
- package/dist/babel.cjs.cjs.map +1 -1
- package/dist/babel.esm.js +23 -15
- package/dist/babel.esm.js.map +1 -1
- package/dist/cli.cjs.cjs +43 -41
- package/dist/cli.cjs.cjs.map +1 -1
- package/dist/cli.esm.js +44 -42
- package/dist/cli.esm.js.map +1 -1
- package/dist/constant.cjs.cjs.map +1 -1
- package/dist/constant.esm.js.map +1 -1
- package/dist/index.cjs2.cjs.map +1 -1
- package/dist/index.esm2.js.map +1 -1
- package/dist/plugin.cjs.cjs +131 -131
- package/dist/plugin.cjs.cjs.map +1 -1
- package/dist/plugin.esm.js +131 -131
- package/dist/plugin.esm.js.map +1 -1
- package/dist/prefetch.cjs.cjs +49 -61
- package/dist/prefetch.cjs.cjs.map +1 -1
- package/dist/prefetch.esm.js +49 -61
- package/dist/prefetch.esm.js.map +1 -1
- package/dist/react.cjs.cjs +18 -17
- package/dist/react.cjs.cjs.map +1 -1
- package/dist/react.esm.js +18 -17
- package/dist/react.esm.js.map +1 -1
- package/dist/runtime-utils.cjs.cjs +6 -5
- package/dist/runtime-utils.cjs.cjs.map +1 -1
- package/dist/runtime-utils.esm.js +6 -5
- package/dist/runtime-utils.esm.js.map +1 -1
- package/dist/universal.cjs.cjs +7 -5
- package/dist/universal.cjs.cjs.map +1 -1
- package/dist/universal.esm.js +7 -5
- package/dist/universal.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/universal.cjs.cjs
CHANGED
|
@@ -6,18 +6,20 @@ var runtimeUtils = require('./runtime-utils.cjs.cjs');
|
|
|
6
6
|
function prefetch(options) {
|
|
7
7
|
const { id, functionId = 'default' } = options;
|
|
8
8
|
const mfScope = runtimeUtils.getScope();
|
|
9
|
-
const prefetchInstance = prefetch$1.MFDataPrefetch.getInstance(mfScope) ||
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const prefetchInstance = prefetch$1.MFDataPrefetch.getInstance(mfScope) ||
|
|
10
|
+
new prefetch$1.MFDataPrefetch({
|
|
11
|
+
name: mfScope,
|
|
12
|
+
});
|
|
12
13
|
const res = prefetchInstance.getProjectExports();
|
|
13
14
|
if (res instanceof Promise) {
|
|
14
|
-
const promise = res.then(()=>{
|
|
15
|
+
const promise = res.then(() => {
|
|
15
16
|
const result = prefetchInstance.prefetch(options);
|
|
16
17
|
prefetchInstance.memorize(id + functionId, result);
|
|
17
18
|
return result;
|
|
18
19
|
});
|
|
19
20
|
return promise;
|
|
20
|
-
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
21
23
|
const result = prefetchInstance.prefetch(options);
|
|
22
24
|
prefetchInstance.memorize(id + functionId, result);
|
|
23
25
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal.cjs.cjs","sources":["../src/universal/index.ts"],"sourcesContent":["import { MFDataPrefetch } from '../prefetch';\nimport { getScope } from '../common/runtime-utils';\nexport function prefetch(options) {\n const { id, functionId = 'default' } = options;\n const mfScope = getScope();\n const prefetchInstance = MFDataPrefetch.getInstance(mfScope) ||\n new MFDataPrefetch({\n name: mfScope,\n });\n const res = prefetchInstance.getProjectExports();\n if (res instanceof Promise) {\n const promise = res.then(() => {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n });\n return promise;\n }\n else {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n }\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"universal.cjs.cjs","sources":["../src/universal/index.ts"],"sourcesContent":["import { MFDataPrefetch } from '../prefetch';\nimport { getScope } from '../common/runtime-utils';\nexport function prefetch(options) {\n const { id, functionId = 'default' } = options;\n const mfScope = getScope();\n const prefetchInstance = MFDataPrefetch.getInstance(mfScope) ||\n new MFDataPrefetch({\n name: mfScope,\n });\n const res = prefetchInstance.getProjectExports();\n if (res instanceof Promise) {\n const promise = res.then(() => {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n });\n return promise;\n }\n else {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n }\n}\n"],"names":["getScope","MFDataPrefetch"],"mappings":";;;;;AAEO,SAAS,QAAQ,CAAC,OAAO,EAAE;AAClC,IAAI,MAAM,EAAE,EAAE,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO;AAClD,IAAI,MAAM,OAAO,GAAGA,qBAAQ,EAAE;AAC9B,IAAI,MAAM,gBAAgB,GAAGC,yBAAc,CAAC,WAAW,CAAC,OAAO,CAAC;AAChE,QAAQ,IAAIA,yBAAc,CAAC;AAC3B,YAAY,IAAI,EAAE,OAAO;AACzB,SAAS,CAAC;AACV,IAAI,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,EAAE;AACpD,IAAI,IAAI,GAAG,YAAY,OAAO,EAAE;AAChC,QAAQ,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM;AACvC,YAAY,MAAM,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC;AAC7D,YAAY,gBAAgB,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,CAAC;AAC9D,YAAY,OAAO,MAAM;AACzB,SAAS,CAAC;AACV,QAAQ,OAAO,OAAO;AACtB;AACA,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC;AACzD,QAAQ,gBAAgB,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,CAAC;AAC1D,QAAQ,OAAO,MAAM;AACrB;AACA;;;;"}
|
package/dist/universal.esm.js
CHANGED
|
@@ -4,18 +4,20 @@ import { g as getScope } from './runtime-utils.esm.js';
|
|
|
4
4
|
function prefetch(options) {
|
|
5
5
|
const { id, functionId = 'default' } = options;
|
|
6
6
|
const mfScope = getScope();
|
|
7
|
-
const prefetchInstance = MFDataPrefetch.getInstance(mfScope) ||
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const prefetchInstance = MFDataPrefetch.getInstance(mfScope) ||
|
|
8
|
+
new MFDataPrefetch({
|
|
9
|
+
name: mfScope,
|
|
10
|
+
});
|
|
10
11
|
const res = prefetchInstance.getProjectExports();
|
|
11
12
|
if (res instanceof Promise) {
|
|
12
|
-
const promise = res.then(()=>{
|
|
13
|
+
const promise = res.then(() => {
|
|
13
14
|
const result = prefetchInstance.prefetch(options);
|
|
14
15
|
prefetchInstance.memorize(id + functionId, result);
|
|
15
16
|
return result;
|
|
16
17
|
});
|
|
17
18
|
return promise;
|
|
18
|
-
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
19
21
|
const result = prefetchInstance.prefetch(options);
|
|
20
22
|
prefetchInstance.memorize(id + functionId, result);
|
|
21
23
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal.esm.js","sources":["../src/universal/index.ts"],"sourcesContent":["import { MFDataPrefetch } from '../prefetch';\nimport { getScope } from '../common/runtime-utils';\nexport function prefetch(options) {\n const { id, functionId = 'default' } = options;\n const mfScope = getScope();\n const prefetchInstance = MFDataPrefetch.getInstance(mfScope) ||\n new MFDataPrefetch({\n name: mfScope,\n });\n const res = prefetchInstance.getProjectExports();\n if (res instanceof Promise) {\n const promise = res.then(() => {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n });\n return promise;\n }\n else {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n }\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"universal.esm.js","sources":["../src/universal/index.ts"],"sourcesContent":["import { MFDataPrefetch } from '../prefetch';\nimport { getScope } from '../common/runtime-utils';\nexport function prefetch(options) {\n const { id, functionId = 'default' } = options;\n const mfScope = getScope();\n const prefetchInstance = MFDataPrefetch.getInstance(mfScope) ||\n new MFDataPrefetch({\n name: mfScope,\n });\n const res = prefetchInstance.getProjectExports();\n if (res instanceof Promise) {\n const promise = res.then(() => {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n });\n return promise;\n }\n else {\n const result = prefetchInstance.prefetch(options);\n prefetchInstance.memorize(id + functionId, result);\n return result;\n }\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,QAAQ,CAAC,OAAO,EAAE;AAClC,IAAI,MAAM,EAAE,EAAE,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO;AAClD,IAAI,MAAM,OAAO,GAAG,QAAQ,EAAE;AAC9B,IAAI,MAAM,gBAAgB,GAAG,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC;AAChE,QAAQ,IAAI,cAAc,CAAC;AAC3B,YAAY,IAAI,EAAE,OAAO;AACzB,SAAS,CAAC;AACV,IAAI,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,EAAE;AACpD,IAAI,IAAI,GAAG,YAAY,OAAO,EAAE;AAChC,QAAQ,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM;AACvC,YAAY,MAAM,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC;AAC7D,YAAY,gBAAgB,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,CAAC;AAC9D,YAAY,OAAO,MAAM;AACzB,SAAS,CAAC;AACV,QAAQ,OAAO,OAAO;AACtB;AACA,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC;AACzD,QAAQ,gBAAgB,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,CAAC;AAC1D,QAAQ,OAAO,MAAM;AACrB;AACA;;;;"}
|
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.
|
|
4
|
+
"version": "0.20.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "nieyan <nyqykk@foxmail.com>",
|
|
7
7
|
"homepage": "https://github.com/module-federation/core",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"fs-extra": "9.1.0",
|
|
92
|
-
"@module-federation/
|
|
93
|
-
"@module-federation/
|
|
92
|
+
"@module-federation/sdk": "0.20.0",
|
|
93
|
+
"@module-federation/runtime": "0.20.0"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"test": "jest"
|