@module-federation/nextjs-mf 7.0.8 → 8.0.1-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.
Files changed (107) hide show
  1. package/CHANGELOG.md +545 -411
  2. package/README.md +29 -15
  3. package/client/MFClient.js +1 -2
  4. package/client/MFClient.js.map +1 -1
  5. package/client/RemoteContainer.js +2 -1
  6. package/client/RemoteContainer.js.map +1 -1
  7. package/client/RemotePages.js +2 -1
  8. package/client/RemotePages.js.map +1 -1
  9. package/client/UrlNode.js +2 -10
  10. package/client/UrlNode.js.map +1 -1
  11. package/node.d.ts +1 -1
  12. package/node.js.map +1 -1
  13. package/package.json +7 -5
  14. package/src/default-delegate.js +64 -9
  15. package/src/default-delegate.js.map +1 -1
  16. package/src/federation-noop.js +13 -1
  17. package/src/federation-noop.js.map +1 -1
  18. package/src/index.d.ts +1 -1
  19. package/src/internal.d.ts +18 -12
  20. package/src/internal.js +83 -71
  21. package/src/internal.js.map +1 -1
  22. package/src/loaders/delegateLoader.d.ts +5 -2
  23. package/src/loaders/delegateLoader.js +19 -9
  24. package/src/loaders/delegateLoader.js.map +1 -1
  25. package/src/loaders/fixImageLoader.d.ts +12 -11
  26. package/src/loaders/fixImageLoader.js +17 -13
  27. package/src/loaders/fixImageLoader.js.map +1 -1
  28. package/src/loaders/fixUrlLoader.d.ts +7 -7
  29. package/src/loaders/fixUrlLoader.js +11 -11
  30. package/src/loaders/fixUrlLoader.js.map +1 -1
  31. package/src/loaders/helpers.d.ts +10 -3
  32. package/src/loaders/helpers.js +22 -13
  33. package/src/loaders/helpers.js.map +1 -1
  34. package/src/loaders/inject-hoist.d.ts +11 -0
  35. package/src/loaders/inject-hoist.js +7 -0
  36. package/src/loaders/inject-hoist.js.map +1 -1
  37. package/src/loaders/nextPageMapLoader.d.ts +12 -3
  38. package/src/loaders/nextPageMapLoader.js +45 -29
  39. package/src/loaders/nextPageMapLoader.js.map +1 -1
  40. package/src/loaders/patchDefaultSharedLoader.d.ts +9 -0
  41. package/src/loaders/patchDefaultSharedLoader.js +11 -0
  42. package/src/loaders/patchDefaultSharedLoader.js.map +1 -1
  43. package/src/loaders/patchNextClientPageLoader.d.ts +4 -2
  44. package/src/loaders/patchNextClientPageLoader.js +36 -18
  45. package/src/loaders/patchNextClientPageLoader.js.map +1 -1
  46. package/src/plugins/CopyFederationPlugin.d.ts +13 -0
  47. package/src/plugins/CopyFederationPlugin.js +40 -19
  48. package/src/plugins/CopyFederationPlugin.js.map +1 -1
  49. package/src/plugins/NextFederationPlugin/apply-client-plugins.d.ts +2 -3
  50. package/src/plugins/NextFederationPlugin/apply-client-plugins.js +9 -6
  51. package/src/plugins/NextFederationPlugin/apply-client-plugins.js.map +1 -1
  52. package/src/plugins/NextFederationPlugin/apply-server-plugins.d.ts +17 -10
  53. package/src/plugins/NextFederationPlugin/apply-server-plugins.js +35 -27
  54. package/src/plugins/NextFederationPlugin/apply-server-plugins.js.map +1 -1
  55. package/src/plugins/NextFederationPlugin/index.d.ts +18 -6
  56. package/src/plugins/NextFederationPlugin/index.js +108 -75
  57. package/src/plugins/NextFederationPlugin/index.js.map +1 -1
  58. package/src/plugins/NextFederationPlugin/next-fragments.d.ts +23 -17
  59. package/src/plugins/NextFederationPlugin/next-fragments.js +26 -18
  60. package/src/plugins/NextFederationPlugin/next-fragments.js.map +1 -1
  61. package/src/plugins/NextFederationPlugin/regex-equal.d.ts +8 -8
  62. package/src/plugins/NextFederationPlugin/regex-equal.js +7 -7
  63. package/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.d.ts +7 -0
  64. package/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js +20 -9
  65. package/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.js.map +1 -1
  66. package/src/plugins/NextFederationPlugin/set-options.d.ts +6 -6
  67. package/src/plugins/NextFederationPlugin/set-options.js +10 -6
  68. package/src/plugins/NextFederationPlugin/set-options.js.map +1 -1
  69. package/src/plugins/NextFederationPlugin/validate-options.d.ts +13 -14
  70. package/src/plugins/NextFederationPlugin/validate-options.js +15 -15
  71. package/src/plugins/NextFederationPlugin/validate-options.js.map +1 -1
  72. package/src/plugins/container/EmbeddedContainerPlugin.d.ts +40 -0
  73. package/src/plugins/container/EmbeddedContainerPlugin.js +73 -0
  74. package/src/plugins/container/EmbeddedContainerPlugin.js.map +1 -0
  75. package/src/plugins/container/InvertedContainerPlugin.d.ts +21 -14
  76. package/src/plugins/container/InvertedContainerPlugin.js +21 -148
  77. package/src/plugins/container/InvertedContainerPlugin.js.map +1 -1
  78. package/src/plugins/container/InvertedContainerRuntimeModule.d.ts +3 -33
  79. package/src/plugins/container/InvertedContainerRuntimeModule.js +64 -518
  80. package/src/plugins/container/InvertedContainerRuntimeModule.js.map +1 -1
  81. package/src/plugins/container/ModuleFederationPlugin.d.ts +17 -0
  82. package/src/plugins/container/ModuleFederationPlugin.js +97 -0
  83. package/src/plugins/container/ModuleFederationPlugin.js.map +1 -0
  84. package/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.d.ts +28 -6
  85. package/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js +34 -57
  86. package/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.js.map +1 -1
  87. package/src/plugins/container/types.d.ts +1 -1
  88. package/src/types.d.ts +3 -0
  89. package/utilities.js.map +1 -1
  90. package/utils/Template.d.ts +1 -1
  91. package/utils/Template.js +23 -15
  92. package/utils/Template.js.map +1 -1
  93. package/utils/build-utils.d.ts +9 -0
  94. package/utils/build-utils.js +9 -0
  95. package/utils/build-utils.js.map +1 -1
  96. package/utils/flushedChunks.d.ts +15 -0
  97. package/utils/flushedChunks.js +8 -0
  98. package/utils/flushedChunks.js.map +1 -1
  99. package/utils/index.d.ts +27 -3
  100. package/utils/index.js +45 -1
  101. package/utils/index.js.map +1 -1
  102. package/src/plugins/JsonpChunkLoading.d.ts +0 -7
  103. package/src/plugins/JsonpChunkLoading.js +0 -43
  104. package/src/plugins/JsonpChunkLoading.js.map +0 -1
  105. package/src/plugins/container/custom-jsonp.d.ts +0 -2
  106. package/src/plugins/container/custom-jsonp.js +0 -90
  107. package/src/plugins/container/custom-jsonp.js.map +0 -1
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const webpack_sources_1 = require("webpack-sources");
7
- const InvertedContainerRuntimeModule_1 = __importDefault(require("./InvertedContainerRuntimeModule"));
8
- const webpack_1 = require("webpack");
9
- const RemoveEagerModulesFromRuntimePlugin_1 = __importDefault(require("./RemoveEagerModulesFromRuntimePlugin"));
6
+ const EmbeddedContainerPlugin_1 = __importDefault(require("./EmbeddedContainerPlugin"));
7
+ const enhanced_1 = require("@module-federation/enhanced");
10
8
  /**
11
9
  * InvertedContainerPlugin is a Webpack plugin that handles loading of chunks in a federated module.
10
+ * @class
12
11
  */
13
12
  class InvertedContainerPlugin {
14
13
  /**
@@ -16,159 +15,33 @@ class InvertedContainerPlugin {
16
15
  * @param {InvertedContainerOptions} options - Plugin configuration options.
17
16
  */
18
17
  constructor(options) {
19
- this.options = options || {};
20
- }
21
- /**
22
- * Resolves the container module for the given compilation.
23
- * @param {Compilation} compilation - Webpack compilation instance.
24
- * @returns {Module | undefined} - The container module or undefined if not found.
25
- */
26
- resolveContainerModule(compilation) {
27
- if (!this.options.container) {
28
- return undefined;
29
- }
30
- const container = compilation.entrypoints
31
- .get(this.options.container)
32
- ?.getRuntimeChunk?.();
33
- if (!container)
34
- return undefined;
35
- const entrymodule = compilation.chunkGraph.getChunkEntryModulesIterable(container);
36
- for (const module of entrymodule) {
37
- return module;
38
- }
39
- return undefined;
18
+ this.options = options;
40
19
  }
41
20
  /**
42
21
  * Apply method for the Webpack plugin, handling the plugin logic and hooks.
43
22
  * @param {Compiler} compiler - Webpack compiler instance.
44
23
  */
45
24
  apply(compiler) {
46
- new RemoveEagerModulesFromRuntimePlugin_1.default({
25
+ new EmbeddedContainerPlugin_1.default({
26
+ runtime: this.options.runtime,
47
27
  container: this.options.container,
48
- debug: this.options.debug,
28
+ chunkToEmbed: this.options.chunkToEmbed,
49
29
  }).apply(compiler);
50
- const { Template, javascript } = compiler.webpack;
51
- // Hook into the compilation process.
52
- compiler.hooks.thisCompilation.tap('InvertedContainerPlugin', (compilation) => {
53
- // Create a WeakSet to store chunks that have already been processed.
54
- const onceForChunkSet = new WeakSet();
55
- // Define a handler function to be called for each chunk in the compilation.
56
- const handler = (chunk, set) => {
57
- // If the chunk has already been processed, skip it.
58
- if (onceForChunkSet.has(chunk))
59
- return;
60
- set.add(webpack_1.RuntimeGlobals.onChunksLoaded);
61
- // Mark the chunk as processed by adding it to the WeakSet.
62
- onceForChunkSet.add(chunk);
63
- if (chunk.hasRuntime()) {
64
- // Add an InvertedContainerRuntimeModule to the chunk, which handles
65
- // the runtime logic for loading remote modules.
66
- compilation.addRuntimeModule(chunk, new InvertedContainerRuntimeModule_1.default(set, this.options, {
67
- webpack: compiler.webpack,
68
- debug: this.options.debug,
69
- }));
70
- }
71
- };
72
- compilation.hooks.additionalChunkRuntimeRequirements.tap('InvertedContainerPlugin', handler);
73
- compilation.hooks.optimizeChunks.tap('InvertedContainerPlugin', (chunks) => {
74
- const containerEntryModule = this.resolveContainerModule(compilation);
75
- if (!containerEntryModule)
76
- return;
77
- for (const chunk of chunks) {
78
- if (!compilation.chunkGraph.isModuleInChunk(containerEntryModule, chunk) &&
79
- chunk.hasRuntime()) {
80
- compilation.chunkGraph.connectChunkAndModule(chunk, containerEntryModule);
81
- }
82
- }
83
- });
84
- const hooks = javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);
85
- compilation.hooks.processAssets.tap({
86
- name: 'InvertedContainerPlugin',
87
- stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,
88
- }, (assets) => {
89
- for (const chunk of compilation.chunks) {
90
- for (const file of chunk.files) {
91
- const asset = compilation.getAsset(file);
92
- if (asset) {
93
- let source = asset.source.source();
94
- const chunkID = typeof chunk.id === 'string'
95
- ? JSON.stringify(chunk.id)
96
- : chunk.id;
97
- // Inject the chunk name at the beginning of the file
98
- source = source
99
- .toString()
100
- //@ts-ignore
101
- .replace('__INSERT_CH_ID__MF__', chunkID);
102
- const updatedSource = new webpack_sources_1.RawSource(source);
103
- //@ts-ignore
104
- compilation.updateAsset(file, updatedSource);
105
- }
106
- }
107
- }
108
- });
109
- hooks.renderStartup.tap('InvertedContainerPlugin',
110
- //@ts-ignore
111
- (source, renderContext) => {
112
- if (!renderContext ||
113
- //@ts-ignore
114
- renderContext?._name ||
115
- !renderContext?.debugId ||
116
- !compilation.chunkGraph.isEntryModule(renderContext) ||
117
- //@ts-ignore
118
- renderContext?.rawRequest?.includes('pages/api') ||
119
- renderContext?.layer === 'api') {
120
- // skip empty modules, container entry, and anything that doesnt have a moduleid or is not an entrypoint module.
121
- return source;
122
- }
123
- const { runtimeTemplate } = compilation;
124
- const replaceSource = source.source().toString().split('\n');
125
- const searchString = '__webpack_exec__';
126
- const replaceString = '__webpack_exec_proxy__';
127
- const originalExec = replaceSource.findIndex((s) => s.includes(searchString));
128
- if (originalExec === -1) {
129
- return source;
130
- }
131
- const firstHalf = replaceSource.slice(0, originalExec + 1);
132
- const secondHalf = replaceSource.slice(originalExec + 1, replaceSource.length);
133
- const originalRuntimeCode = firstHalf
134
- .join('\n')
135
- .replace(searchString, replaceString);
136
- const fancyTemplate = Template.asString([
137
- runtimeTemplate.returningFunction(Template.asString([
138
- '__webpack_require__.own_remote.then(',
139
- runtimeTemplate.returningFunction(Template.asString([
140
- 'Promise.all([',
141
- Template.indent([
142
- 'Promise.all(__webpack_require__.initRemotes)',
143
- 'Promise.all(__webpack_require__.initConsumes)',
144
- ].join(',\n')),
145
- '])',
146
- ])),
147
- ').then(',
148
- runtimeTemplate.returningFunction(Template.asString([`${replaceString}(moduleId)`])),
149
- ')',
150
- ].join('')), 'moduleId'),
151
- ]);
152
- const wholeTem = Template.asString([
153
- `var ${searchString} =`,
154
- fancyTemplate,
155
- ]);
156
- return Template.asString([
157
- '',
158
- 'var currentChunkId = __INSERT_CH_ID__MF__;',
159
- `if(currentChunkId) {`,
160
- Template.indent([
161
- `if(__webpack_require__.getEagerSharedForChunkId) {__webpack_require__.getEagerSharedForChunkId(currentChunkId,__webpack_require__.initConsumes)}`,
162
- `if(__webpack_require__.getEagerRemotesForChunkId) {__webpack_require__.getEagerRemotesForChunkId(currentChunkId,__webpack_require__.initRemotes)}`,
163
- ]),
164
- '}',
165
- originalRuntimeCode,
166
- wholeTem,
167
- ...secondHalf,
168
- '',
169
- ]);
170
- });
30
+ const asyncBoundaryPlugin = new enhanced_1.AsyncBoundaryPlugin();
31
+ asyncBoundaryPlugin.hooks.checkInvalidContext.tap('InvertedContainerPlugin', (renderContext, compilation) => {
32
+ return (!renderContext ||
33
+ //@ts-ignore
34
+ renderContext?._name ||
35
+ //@ts-ignore
36
+ !renderContext?.debugId ||
37
+ //@ts-ignore
38
+ !compilation.chunkGraph.isEntryModule(renderContext) ||
39
+ //@ts-ignore
40
+ renderContext?.rawRequest?.includes('pages/api') ||
41
+ //@ts-ignore
42
+ renderContext?.layer === 'api');
171
43
  });
44
+ asyncBoundaryPlugin.apply(compiler);
172
45
  }
173
46
  }
174
47
  exports.default = InvertedContainerPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"InvertedContainerPlugin.js","sourceRoot":"","sources":["../../../../../../packages/nextjs-mf/src/plugins/container/InvertedContainerPlugin.ts"],"names":[],"mappings":";;;;;AACA,qDAA4C;AAG5C,sGAA8E;AAC9E,qCAAsD;AAEtD,gHAAwF;AAWxF;;GAEG;AACH,MAAM,uBAAuB;IAG3B;;;OAGG;IACH,YAAY,OAKX;QACC,IAAI,CAAC,OAAO,GAAG,OAAO,IAAK,EAA+B,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACH,sBAAsB,CAAC,WAAwB;QAC7C,IAAI,C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C5C,sBAAsB;oBACtB,QAAQ,CAAC,MAAM,CAAC;wBACd,kJAAkJ;wBAClJ,mJAAmJ;qBACpJ,CAAC;oBACF,GAAG;oBACH,mBAAmB;oBACnB,QAAQ;oBACR,GAAG,UAAU;oBACb,EAAE;iBACH,CAAC,CAAC;YACL,CAAC,CACF,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"InvertedContainerPlugin.js","sourceRoot":"","sources":["../../../../../../packages/nextjs-mf/src/plugins/container/InvertedContainerPlugin.ts"],"names":[],"mappings":";;;;;AAEA,wFAAgE;AAChE,0DAAkE;AAqBlE;;;GAGG;AACH,MAAM,uBAAuB;IAG3B;;;OAGG;IACH,YAAY,OAAiC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,QAAkB;QAC7B,IAAI,iCAAuB,CAAC;YAC1B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY;SACxC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEnB,MAAM,mBAAmB,GAAG,IAAI,8BAAmB,EAAE,CAAC;QACtD,mBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,yBAAyB,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,EAAE;YAC1G,OAAO,CACL,CAAC,aAAa;gBACd,YAAY;gBACZ,aAAa,EAAE,KAAK;gBACpB,YAAY;gBACZ,CAAC,aAAa,EAAE,OAAO;gBACvB,YAAY;gBACZ,CAAC,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC;gBACpD,YAAY;gBACZ,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC;gBAChD,YAAY;gBACZ,aAAa,EAAE,KAAK,KAAK,KAAK,CAC/B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACF;AAED,kBAAe,uBAAuB,CAAC"}
@@ -1,9 +1,4 @@
1
- import type { Compiler, Module } from 'webpack';
2
- import { RuntimeModule } from 'webpack';
3
- /**
4
- * Interface for InvertedContainerRuntimeModuleOptions, containing
5
- * options for the InvertedContainerRuntimeModule class.
6
- */
1
+ import RuntimeModule from 'webpack/lib/RuntimeModule';
7
2
  interface InvertedContainerRuntimeModuleOptions {
8
3
  runtime: string;
9
4
  remotes: Record<string, string>;
@@ -11,35 +6,10 @@ interface InvertedContainerRuntimeModuleOptions {
11
6
  debug?: boolean;
12
7
  container?: string;
13
8
  }
14
- /**
15
- * Interface for ChunkLoadingContext, containing Webpack-related properties.
16
- */
17
- interface ChunkLoadingContext {
18
- webpack: Compiler['webpack'];
19
- debug?: boolean;
20
- }
21
- /**
22
- * InvertedContainerRuntimeModule is a Webpack runtime module that generates
23
- * the runtime code needed for loading federated modules in an inverted container.
24
- */
25
9
  declare class InvertedContainerRuntimeModule extends RuntimeModule {
26
- private runtimeRequirements;
27
10
  private options;
28
- private chunkLoadingContext;
29
- /**
30
- * Constructor for the InvertedContainerRuntimeModule.
31
- * @param {Set<string>} runtimeRequirements - A set of runtime requirement strings.
32
- * @param {InvertedContainerRuntimeModuleOptions} options - Runtime module options.
33
- * @param {ChunkLoadingContext} chunkLoadingContext - Chunk loading context.
34
- */
35
- constructor(runtimeRequirements: Set<string>, options: InvertedContainerRuntimeModuleOptions, chunkLoadingContext: ChunkLoadingContext);
36
- resolveContainerModule(): Module | undefined;
37
- mapShared(): string;
38
- mapChunks(): string;
39
- /**
40
- * Generate method for the runtime module, producing the runtime code.
41
- * @returns {string} runtime code
42
- */
11
+ constructor(options: InvertedContainerRuntimeModuleOptions);
12
+ private resolveContainerModule;
43
13
  generate(): string;
44
14
  }
45
15
  export default InvertedContainerRuntimeModule;