@module-federation/nextjs-mf 5.7.8 → 5.8.3

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
@@ -2,6 +2,80 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [5.8.3](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.8.2...nextjs-mf-5.8.3) (2022-10-06)
6
+
7
+
8
+
9
+ ## [5.8.2](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.8.1...nextjs-mf-5.8.2) (2022-10-06)
10
+
11
+
12
+
13
+ ## [5.8.1](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.8.0...nextjs-mf-5.8.1) (2022-10-06)
14
+
15
+
16
+
17
+ # [5.8.0](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.2...nextjs-mf-5.8.0) (2022-10-06)
18
+
19
+
20
+
21
+ # [5.8.0](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.2...nextjs-mf-5.8.0) (2022-10-06)
22
+
23
+
24
+
25
+ ## [5.7.2](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.1...nextjs-mf-5.7.2) (2022-10-06)
26
+
27
+
28
+
29
+ ## [5.7.1](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.0...nextjs-mf-5.7.1) (2022-10-06)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * flush CSS chunks, cache bust remote entry on render ([#269](https://github.com/module-federation/nextjs-mf/issues/269)) ([85a216a](https://github.com/module-federation/nextjs-mf/commit/85a216a8fd34ae849630ff5b42bacb26c855a9ce))
35
+ * improve handling of offline remotes ([#263](https://github.com/module-federation/nextjs-mf/issues/263)) ([e0eb437](https://github.com/module-federation/nextjs-mf/commit/e0eb437bbc0259a8f263ededa505a397fa59b97b))
36
+ * **update versions:** bumping versions ([f72209a](https://github.com/module-federation/nextjs-mf/commit/f72209ae070fb50c9d317e764caf872facd4b887))
37
+
38
+
39
+
40
+ ## [5.7.1](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.0...nextjs-mf-5.7.1) (2022-10-06)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * flush CSS chunks, cache bust remote entry on render ([#269](https://github.com/module-federation/nextjs-mf/issues/269)) ([85a216a](https://github.com/module-federation/nextjs-mf/commit/85a216a8fd34ae849630ff5b42bacb26c855a9ce))
46
+ * improve handling of offline remotes ([#263](https://github.com/module-federation/nextjs-mf/issues/263)) ([e0eb437](https://github.com/module-federation/nextjs-mf/commit/e0eb437bbc0259a8f263ededa505a397fa59b97b))
47
+ * **update versions:** bumping versions ([f72209a](https://github.com/module-federation/nextjs-mf/commit/f72209ae070fb50c9d317e764caf872facd4b887))
48
+
49
+
50
+
51
+ # [5.8.0](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.0...nextjs-mf-5.8.0) (2022-10-05)
52
+
53
+
54
+ ### Bug Fixes
55
+
56
+ * improve handling of offline remotes ([3ae596e](https://github.com/module-federation/nextjs-mf/commit/3ae596ee82d2ccf0d828d7928cbdc4fbec509d55))
57
+ * patch share scope on client server ([fc7f82f](https://github.com/module-federation/nextjs-mf/commit/fc7f82fd1f299a078552ce811d074b816e796109))
58
+ * patch share scope on client server ([b4461fd](https://github.com/module-federation/nextjs-mf/commit/b4461fdbe6999390cbf4b57c18c537563cf04cc9))
59
+ * patch share scope on client server ([31b4c24](https://github.com/module-federation/nextjs-mf/commit/31b4c24112e27630b588410d9d78e89acc579d26))
60
+ * patch share scope on client server ([272c110](https://github.com/module-federation/nextjs-mf/commit/272c110a9cd3a194d2fdeaf1d620b14b29330b30))
61
+ * **update versions:** bumping versions ([f72209a](https://github.com/module-federation/nextjs-mf/commit/f72209ae070fb50c9d317e764caf872facd4b887))
62
+
63
+
64
+
65
+ ## [5.7.1](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.0...nextjs-mf-5.7.1) (2022-10-05)
66
+
67
+
68
+ ### Bug Fixes
69
+
70
+ * improve handling of offline remotes ([3ae596e](https://github.com/module-federation/nextjs-mf/commit/3ae596ee82d2ccf0d828d7928cbdc4fbec509d55))
71
+ * patch share scope on client server ([fc7f82f](https://github.com/module-federation/nextjs-mf/commit/fc7f82fd1f299a078552ce811d074b816e796109))
72
+ * patch share scope on client server ([b4461fd](https://github.com/module-federation/nextjs-mf/commit/b4461fdbe6999390cbf4b57c18c537563cf04cc9))
73
+ * patch share scope on client server ([31b4c24](https://github.com/module-federation/nextjs-mf/commit/31b4c24112e27630b588410d9d78e89acc579d26))
74
+ * patch share scope on client server ([272c110](https://github.com/module-federation/nextjs-mf/commit/272c110a9cd3a194d2fdeaf1d620b14b29330b30))
75
+ * **update versions:** bumping versions ([f72209a](https://github.com/module-federation/nextjs-mf/commit/f72209ae070fb50c9d317e764caf872facd4b887))
76
+
77
+
78
+
5
79
  ## [5.7.1](https://github.com/module-federation/nextjs-mf/compare/nextjs-mf-5.7.0...nextjs-mf-5.7.1) (2022-10-04)
6
80
 
7
81
  ### Dependency Updates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/nextjs-mf",
3
- "version": "5.7.8",
3
+ "version": "5.8.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -16,8 +16,8 @@
16
16
  "fast-glob": "^3.2.11",
17
17
  "webpack-sources": "^3.2.3",
18
18
  "eventemitter3": "^4.0.7",
19
- "@module-federation/node": "0.4.4",
20
- "@module-federation/utilities": "0.0.4",
19
+ "@module-federation/node": "0.5.6",
20
+ "@module-federation/utilities": "0.1.3",
21
21
  "@swc/core": "^1.3.3",
22
22
  "tslib": "^2.3.0"
23
23
  },
package/utils/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  export { extractUrlAndGlobal, injectScript } from '@module-federation/utilities';
2
2
  export { flushChunks } from '@module-federation/node/utils';
3
3
  export declare const revalidate: () => Promise<any>;
4
- export declare const FlushedChunksHead: (props: {
5
- chunks: string[];
6
- }) => import("react").FunctionComponentElement<{
7
- children: import("react").ReactNode;
8
- }>;
4
+ export declare const FlushedChunks: {
5
+ ({ chunks }: {
6
+ chunks: any;
7
+ }): any[];
8
+ defaultProps: {
9
+ chunks: never[];
10
+ };
11
+ };
package/utils/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlushedChunksHead = exports.revalidate = exports.flushChunks = exports.injectScript = exports.extractUrlAndGlobal = void 0;
3
+ exports.FlushedChunks = exports.revalidate = exports.flushChunks = exports.injectScript = exports.extractUrlAndGlobal = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const react_1 = require("react");
6
- const head_1 = tslib_1.__importDefault(require("next/head"));
5
+ const React = tslib_1.__importStar(require("react"));
7
6
  var utilities_1 = require("@module-federation/utilities");
8
7
  Object.defineProperty(exports, "extractUrlAndGlobal", { enumerable: true, get: function () { return utilities_1.extractUrlAndGlobal; } });
9
8
  Object.defineProperty(exports, "injectScript", { enumerable: true, get: function () { return utilities_1.injectScript; } });
@@ -21,23 +20,29 @@ const revalidate = () => {
21
20
  });
22
21
  };
23
22
  exports.revalidate = revalidate;
24
- const FlushedChunksHead = (props) => {
25
- const chunks = props.chunks || [];
26
- const scripts = chunks.filter((c) => c.endsWith('.js')).map((chunk) => {
27
- return /*#__PURE__*/ (0, react_1.createElement)("script", {
28
- key: chunk,
23
+ //@ts-ignore
24
+ const FlushedChunks = ({ chunks }) => {
25
+ //@ts-ignore
26
+ const scripts = chunks.filter((c) => c.endsWith(".js")).map((chunk) => {
27
+ if (!chunk.includes('?') && chunk.includes('remoteEntry')) {
28
+ chunk = chunk + '?t=' + Date.now();
29
+ }
30
+ return React.createElement("script", {
29
31
  src: chunk,
30
32
  async: true
31
- });
33
+ }, null);
32
34
  });
33
- const css = chunks.filter((c) => c.endsWith('.css')).map((chunk) => {
34
- return /*#__PURE__*/ (0, react_1.createElement)("link", {
35
- key: chunk,
35
+ //@ts-ignore
36
+ const css = chunks.filter((c) => c.endsWith(".css")).map((chunk) => {
37
+ return React.createElement("link", {
36
38
  href: chunk,
37
39
  rel: "stylesheet"
38
- });
40
+ }, null);
39
41
  });
40
- return /*#__PURE__*/ (0, react_1.createElement)(head_1.default, null, scripts, css);
42
+ return [css, scripts];
43
+ };
44
+ exports.FlushedChunks = FlushedChunks;
45
+ exports.FlushedChunks.defaultProps = {
46
+ chunks: []
41
47
  };
42
- exports.FlushedChunksHead = FlushedChunksHead;
43
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/nextjs-mf/utils/index.ts"],"names":[],"mappings":";;;;AAAA,iCAAoC;AACpC,6DAA6B;AAC7B,0DAAiF;AAAxE,gHAAA,mBAAmB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC1C,aAAa;AACb,uDAA0D;AAAlD,oGAAA,WAAW,OAAA;AAEZ,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,IAAG,OAAO,MAAM,KAAK,WAAW,EAAE;QAChC,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAC9D,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC/B;IACD,aAAa;IACb,OAAO,0DAAO,+BAA+B,IAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5D,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AATY,QAAA,UAAU,cAStB;AAGM,MAAM,iBAAiB,GAAG,CAAC,KAA4B,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,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