@module-federation/modern-js 0.0.0-next-20240716111139 → 0.0.0-next-20240716130450

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.
@@ -140,6 +140,7 @@ function collectSSRAssets(options) {
140
140
  }
141
141
  function createRemoteSSRComponent(info) {
142
142
  return (props) => {
143
+ const { key, ...rest } = props;
143
144
  const exportName = (info === null || info === void 0 ? void 0 : info.export) || "default";
144
145
  const LazyComponent = /* @__PURE__ */ import_react.default.lazy(async () => {
145
146
  try {
@@ -158,7 +159,7 @@ function createRemoteSSRComponent(info) {
158
159
  children: [
159
160
  assets,
160
161
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Com, {
161
- ...props
162
+ ...rest
162
163
  })
163
164
  ]
164
165
  })
@@ -1,6 +1,7 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
3
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
4
+ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
4
5
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
5
6
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
6
7
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -98,6 +99,9 @@ function collectSSRAssets(options) {
98
99
  }
99
100
  function createRemoteSSRComponent(info) {
100
101
  return function(props) {
102
+ var key = props.key, rest = _object_without_properties(props, [
103
+ "key"
104
+ ]);
101
105
  var exportName = (info === null || info === void 0 ? void 0 : info.export) || "default";
102
106
  var LazyComponent = /* @__PURE__ */ React.lazy(/* @__PURE__ */ _async_to_generator(function() {
103
107
  var m, moduleId, assets, Com, err, FallbackFunctionComponent, FallbackNode;
@@ -132,7 +136,7 @@ function createRemoteSSRComponent(info) {
132
136
  return /* @__PURE__ */ _jsxs(_Fragment, {
133
137
  children: [
134
138
  assets,
135
- /* @__PURE__ */ _jsx(Com, _object_spread({}, props))
139
+ /* @__PURE__ */ _jsx(Com, _object_spread({}, rest))
136
140
  ]
137
141
  });
138
142
  }
@@ -106,6 +106,7 @@ function collectSSRAssets(options) {
106
106
  }
107
107
  function createRemoteSSRComponent(info) {
108
108
  return (props) => {
109
+ const { key, ...rest } = props;
109
110
  const exportName = (info === null || info === void 0 ? void 0 : info.export) || "default";
110
111
  const LazyComponent = /* @__PURE__ */ React.lazy(async () => {
111
112
  try {
@@ -124,7 +125,7 @@ function createRemoteSSRComponent(info) {
124
125
  children: [
125
126
  assets,
126
127
  /* @__PURE__ */ _jsx(Com, {
127
- ...props
128
+ ...rest
128
129
  })
129
130
  ]
130
131
  })
@@ -5,11 +5,14 @@ type IProps = {
5
5
  injectScript?: boolean;
6
6
  injectLink?: boolean;
7
7
  };
8
+ type IKey = {
9
+ key?: React.Key | null;
10
+ };
8
11
  export declare function collectSSRAssets(options: IProps): React.ReactNode[];
9
12
  export declare function createRemoteSSRComponent<T, E extends keyof T>(info: {
10
13
  loader: () => Promise<T>;
11
14
  loading: React.ReactNode;
12
15
  fallback: ErrorBoundaryPropsWithComponent['FallbackComponent'];
13
16
  export?: E;
14
- }): (props: T[E] extends (...args: any) => any ? Parameters<T[E]>[0] extends undefined ? Record<string, never> : Parameters<T[E]>[0] : Record<string, never>) => React.JSX.Element;
17
+ }): (props: T[E] extends (...args: any) => any ? Parameters<T[E]>[0] extends undefined ? IKey : Parameters<T[E]>[0] & IKey : IKey) => React.JSX.Element;
15
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/modern-js",
3
- "version": "0.0.0-next-20240716111139",
3
+ "version": "0.0.0-next-20240716130450",
4
4
  "files": [
5
5
  "dist/",
6
6
  "types.d.ts",
@@ -61,9 +61,9 @@
61
61
  "node-fetch": "~3.3.0",
62
62
  "react-error-boundary": "4.0.13",
63
63
  "hoist-non-react-statics": "3.3.2",
64
- "@module-federation/sdk": "0.0.0-next-20240716111139",
65
- "@module-federation/enhanced": "0.0.0-next-20240716111139",
66
- "@module-federation/node": "0.0.0-next-20240716111139"
64
+ "@module-federation/sdk": "0.0.0-next-20240716130450",
65
+ "@module-federation/enhanced": "0.0.0-next-20240716130450",
66
+ "@module-federation/node": "0.0.0-next-20240716130450"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/hoist-non-react-statics": "3.3.2",
@@ -72,7 +72,7 @@
72
72
  "@modern-js/runtime": "^2.55.0",
73
73
  "@modern-js/module-tools": "^2.55.0",
74
74
  "@modern-js/tsconfig": "^2.55.0",
75
- "@module-federation/manifest": "0.0.0-next-20240716111139"
75
+ "@module-federation/manifest": "0.0.0-next-20240716130450"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "react": ">=17",