@module-federation/modern-js 0.0.0-next-20250623065058 → 0.0.0-next-20250626022312
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/cjs/react/index.js +19 -36
- package/dist/cjs/ssr-runtime/injectDataFetchFunctionPlugin.js +0 -1
- package/dist/esm/react/index.js +9 -22
- package/dist/esm/ssr-runtime/injectDataFetchFunctionPlugin.js +1 -2
- package/dist/esm-node/react/index.js +9 -23
- package/dist/esm-node/ssr-runtime/injectDataFetchFunctionPlugin.js +1 -2
- package/dist/types/react/index.d.ts +2 -10
- package/package.json +9 -9
package/dist/cjs/react/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,51 +15,36 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var react_exports = {};
|
|
30
20
|
__export(react_exports, {
|
|
21
|
+
CacheSize: () => import_bridge_react.CacheSize,
|
|
22
|
+
CacheTime: () => import_bridge_react.CacheTime,
|
|
31
23
|
ERROR_TYPE: () => import_bridge_react.ERROR_TYPE,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
cache: () => import_bridge_react.cache,
|
|
25
|
+
clearStore: () => import_bridge_react.clearStore,
|
|
26
|
+
collectSSRAssets: () => import_bridge_react.collectSSRAssets,
|
|
27
|
+
configureCache: () => import_bridge_react.configureCache,
|
|
28
|
+
createLazyComponent: () => import_bridge_react.createLazyComponent,
|
|
29
|
+
generateKey: () => import_bridge_react.generateKey,
|
|
30
|
+
prefetch: () => import_bridge_react.prefetch,
|
|
31
|
+
revalidateTag: () => import_bridge_react.revalidateTag,
|
|
32
|
+
wrapNoSSR: () => import_bridge_react.wrapNoSSR
|
|
36
33
|
});
|
|
37
34
|
module.exports = __toCommonJS(react_exports);
|
|
38
|
-
var mfRuntime = __toESM(require("@module-federation/enhanced/runtime"));
|
|
39
35
|
var import_bridge_react = require("@module-federation/bridge-react");
|
|
40
|
-
const createLazyComponent = (options) => {
|
|
41
|
-
return (0, import_bridge_react.createLazyComponent)({
|
|
42
|
-
...options,
|
|
43
|
-
runtime: mfRuntime
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
const collectSSRAssets = (options) => {
|
|
47
|
-
return (0, import_bridge_react.collectSSRAssets)({
|
|
48
|
-
...options,
|
|
49
|
-
runtime: mfRuntime
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
function wrapNoSSR(createLazyComponentFn) {
|
|
53
|
-
return (options) => {
|
|
54
|
-
return createLazyComponentFn({
|
|
55
|
-
...options,
|
|
56
|
-
noSSR: true
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
61
37
|
0 && (module.exports = {
|
|
38
|
+
CacheSize,
|
|
39
|
+
CacheTime,
|
|
62
40
|
ERROR_TYPE,
|
|
41
|
+
cache,
|
|
42
|
+
clearStore,
|
|
63
43
|
collectSSRAssets,
|
|
44
|
+
configureCache,
|
|
64
45
|
createLazyComponent,
|
|
65
|
-
|
|
46
|
+
generateKey,
|
|
47
|
+
prefetch,
|
|
48
|
+
revalidateTag,
|
|
66
49
|
wrapNoSSR
|
|
67
50
|
});
|
package/dist/esm/react/index.js
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
-
import * as mfRuntime from "@module-federation/enhanced/runtime";
|
|
4
|
-
import { ERROR_TYPE, createLazyComponent as rawCreateLazyComponent, collectSSRAssets as rawCollectSsrAssets, injectDataFetch } from "@module-federation/bridge-react";
|
|
5
|
-
var createLazyComponent = function(options) {
|
|
6
|
-
return rawCreateLazyComponent(_object_spread_props(_object_spread({}, options), {
|
|
7
|
-
runtime: mfRuntime
|
|
8
|
-
}));
|
|
9
|
-
};
|
|
10
|
-
var collectSSRAssets = function(options) {
|
|
11
|
-
return rawCollectSsrAssets(_object_spread_props(_object_spread({}, options), {
|
|
12
|
-
runtime: mfRuntime
|
|
13
|
-
}));
|
|
14
|
-
};
|
|
15
|
-
function wrapNoSSR(createLazyComponentFn) {
|
|
16
|
-
return function(options) {
|
|
17
|
-
return createLazyComponentFn(_object_spread_props(_object_spread({}, options), {
|
|
18
|
-
noSSR: true
|
|
19
|
-
}));
|
|
20
|
-
};
|
|
21
|
-
}
|
|
1
|
+
import { ERROR_TYPE, createLazyComponent, collectSSRAssets, wrapNoSSR, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, prefetch } from "@module-federation/bridge-react";
|
|
22
2
|
export {
|
|
3
|
+
CacheSize,
|
|
4
|
+
CacheTime,
|
|
23
5
|
ERROR_TYPE,
|
|
6
|
+
cache,
|
|
7
|
+
clearStore,
|
|
24
8
|
collectSSRAssets,
|
|
9
|
+
configureCache,
|
|
25
10
|
createLazyComponent,
|
|
26
|
-
|
|
11
|
+
generateKey,
|
|
12
|
+
prefetch,
|
|
13
|
+
revalidateTag,
|
|
27
14
|
wrapNoSSR
|
|
28
15
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
-
import { callDataFetch
|
|
3
|
+
import { callDataFetch } from "@module-federation/bridge-react/data-fetch-utils";
|
|
4
4
|
import { setSSREnv } from "@module-federation/bridge-react/lazy-utils";
|
|
5
5
|
var injectDataFetchFunctionPlugin = function(param) {
|
|
6
6
|
var fetchServerQuery = param.fetchServerQuery;
|
|
@@ -14,7 +14,6 @@ var injectDataFetchFunctionPlugin = function(param) {
|
|
|
14
14
|
setSSREnv({
|
|
15
15
|
fetchServerQuery
|
|
16
16
|
});
|
|
17
|
-
injectDataFetch();
|
|
18
17
|
return [
|
|
19
18
|
4,
|
|
20
19
|
callDataFetch()
|
|
@@ -1,29 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ERROR_TYPE, createLazyComponent as rawCreateLazyComponent, collectSSRAssets as rawCollectSsrAssets, injectDataFetch } from "@module-federation/bridge-react";
|
|
3
|
-
const createLazyComponent = (options) => {
|
|
4
|
-
return rawCreateLazyComponent({
|
|
5
|
-
...options,
|
|
6
|
-
runtime: mfRuntime
|
|
7
|
-
});
|
|
8
|
-
};
|
|
9
|
-
const collectSSRAssets = (options) => {
|
|
10
|
-
return rawCollectSsrAssets({
|
|
11
|
-
...options,
|
|
12
|
-
runtime: mfRuntime
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
function wrapNoSSR(createLazyComponentFn) {
|
|
16
|
-
return (options) => {
|
|
17
|
-
return createLazyComponentFn({
|
|
18
|
-
...options,
|
|
19
|
-
noSSR: true
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
}
|
|
1
|
+
import { ERROR_TYPE, createLazyComponent, collectSSRAssets, wrapNoSSR, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, prefetch } from "@module-federation/bridge-react";
|
|
23
2
|
export {
|
|
3
|
+
CacheSize,
|
|
4
|
+
CacheTime,
|
|
24
5
|
ERROR_TYPE,
|
|
6
|
+
cache,
|
|
7
|
+
clearStore,
|
|
25
8
|
collectSSRAssets,
|
|
9
|
+
configureCache,
|
|
26
10
|
createLazyComponent,
|
|
27
|
-
|
|
11
|
+
generateKey,
|
|
12
|
+
prefetch,
|
|
13
|
+
revalidateTag,
|
|
28
14
|
wrapNoSSR
|
|
29
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { callDataFetch
|
|
1
|
+
import { callDataFetch } from "@module-federation/bridge-react/data-fetch-utils";
|
|
2
2
|
import { setSSREnv } from "@module-federation/bridge-react/lazy-utils";
|
|
3
3
|
const injectDataFetchFunctionPlugin = ({ fetchServerQuery }) => ({
|
|
4
4
|
name: "@module-federation/inject-data-fetch-function-plugin",
|
|
@@ -7,7 +7,6 @@ const injectDataFetchFunctionPlugin = ({ fetchServerQuery }) => ({
|
|
|
7
7
|
setSSREnv({
|
|
8
8
|
fetchServerQuery
|
|
9
9
|
});
|
|
10
|
-
injectDataFetch();
|
|
11
10
|
await callDataFetch();
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { ERROR_TYPE };
|
|
4
|
-
type NewCreateLazyComponentOptions<T, E extends keyof T> = Omit<CreateLazyComponentOptions<T, E>, 'runtime'>;
|
|
5
|
-
type NewCreateLazyComponent = <T, E extends keyof T>(options: NewCreateLazyComponentOptions<T, E>) => ReturnType<typeof rawCreateLazyComponent<T, E>>;
|
|
6
|
-
export declare const createLazyComponent: NewCreateLazyComponent;
|
|
7
|
-
export declare const collectSSRAssets: (options: Omit<CollectSSRAssetsOptions, 'runtime'>) => ReturnType<typeof rawCollectSsrAssets>;
|
|
8
|
-
export declare function wrapNoSSR<T, E extends keyof T>(createLazyComponentFn: typeof createLazyComponent<T, E>): (options: Omit<NewCreateLazyComponentOptions<T, E>, 'noSSR'>) => ReturnType<typeof createLazyComponent<T, E>>;
|
|
9
|
-
export { injectDataFetch };
|
|
10
|
-
export type { DataFetchParams } from '@module-federation/bridge-react';
|
|
1
|
+
export { ERROR_TYPE, createLazyComponent, collectSSRAssets, wrapNoSSR, CacheSize, CacheTime, configureCache, generateKey, cache, revalidateTag, clearStore, prefetch, } from '@module-federation/bridge-react';
|
|
2
|
+
export type { DataFetchParams, CacheStatus, CacheStatsInfo, } from '@module-federation/bridge-react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/modern-js",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20250626022312",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
"@swc/helpers": "^0.5.17",
|
|
120
120
|
"node-fetch": "~3.3.0",
|
|
121
121
|
"react-error-boundary": "4.1.2",
|
|
122
|
-
"@module-federation/rsbuild-plugin": "0.0.0-next-
|
|
123
|
-
"@module-federation/bridge-react": "0.0.0-next-
|
|
124
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
125
|
-
"@module-federation/runtime": "0.0.0-next-
|
|
126
|
-
"@module-federation/node": "0.0.0-next-
|
|
127
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
128
|
-
"@module-federation/cli": "0.0.0-next-
|
|
122
|
+
"@module-federation/rsbuild-plugin": "0.0.0-next-20250626022312",
|
|
123
|
+
"@module-federation/bridge-react": "0.0.0-next-20250626022312",
|
|
124
|
+
"@module-federation/enhanced": "0.0.0-next-20250626022312",
|
|
125
|
+
"@module-federation/runtime": "0.0.0-next-20250626022312",
|
|
126
|
+
"@module-federation/node": "0.0.0-next-20250626022312",
|
|
127
|
+
"@module-federation/sdk": "0.0.0-next-20250626022312",
|
|
128
|
+
"@module-federation/cli": "0.0.0-next-20250626022312"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@modern-js/core": "2.67.5",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"@modern-js/module-tools": "2.67.6",
|
|
136
136
|
"@modern-js/runtime": "2.67.6",
|
|
137
137
|
"@modern-js/tsconfig": "2.67.6",
|
|
138
|
-
"@module-federation/manifest": "0.0.0-next-
|
|
138
|
+
"@module-federation/manifest": "0.0.0-next-20250626022312"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
141
|
"react": ">=17",
|