@module-federation/nextjs-mf 8.8.70 → 8.8.72

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 (81) hide show
  1. package/dist/client/UrlNode.d.mts +17 -0
  2. package/dist/client/UrlNode.d.ts +17 -0
  3. package/dist/node.d.mts +1 -0
  4. package/dist/node.d.ts +1 -0
  5. package/dist/src/federation-noop.d.mts +0 -1
  6. package/dist/src/federation-noop.d.ts +0 -1
  7. package/dist/src/index.d.mts +3 -2
  8. package/dist/src/index.d.ts +3 -2
  9. package/dist/src/internal.d.mts +50 -0
  10. package/dist/src/internal.d.ts +50 -0
  11. package/dist/src/loaders/fixImageLoader.d.mts +3 -8
  12. package/dist/src/loaders/fixImageLoader.d.ts +3 -8
  13. package/dist/src/loaders/fixUrlLoader.d.mts +2 -5
  14. package/dist/src/loaders/fixUrlLoader.d.ts +2 -5
  15. package/dist/src/loaders/helpers.d.mts +17 -0
  16. package/dist/src/loaders/helpers.d.ts +17 -0
  17. package/dist/src/loaders/nextPageMapLoader.d.mts +5 -10
  18. package/dist/src/loaders/nextPageMapLoader.d.ts +5 -10
  19. package/dist/src/logger.d.mts +2 -0
  20. package/dist/src/logger.d.ts +2 -0
  21. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.d.mts +5 -0
  22. package/dist/src/plugins/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +5 -0
  23. package/dist/src/plugins/CopyFederationPlugin.d.mts +20 -0
  24. package/dist/src/plugins/CopyFederationPlugin.d.ts +20 -0
  25. package/dist/src/plugins/NextFederationPlugin/FederatedStatsCompatibilityPlugin.d.mts +22 -0
  26. package/dist/src/plugins/NextFederationPlugin/FederatedStatsCompatibilityPlugin.d.ts +22 -0
  27. package/dist/src/plugins/NextFederationPlugin/FederatedStatsCompatibilityPlugin.js +43 -0
  28. package/dist/src/plugins/NextFederationPlugin/FederatedStatsCompatibilityPlugin.js.map +1 -0
  29. package/dist/src/plugins/NextFederationPlugin/FederatedStatsCompatibilityPlugin.mjs +42 -0
  30. package/dist/src/plugins/NextFederationPlugin/FederatedStatsCompatibilityPlugin.mjs.map +1 -0
  31. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.d.mts +23 -0
  32. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.d.ts +23 -0
  33. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js +7 -1
  34. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.js.map +1 -1
  35. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.mjs +7 -1
  36. package/dist/src/plugins/NextFederationPlugin/apply-client-plugins.mjs.map +1 -1
  37. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.d.mts +36 -0
  38. package/dist/src/plugins/NextFederationPlugin/apply-server-plugins.d.ts +36 -0
  39. package/dist/src/plugins/NextFederationPlugin/index.d.mts +23 -27
  40. package/dist/src/plugins/NextFederationPlugin/index.d.ts +23 -27
  41. package/dist/src/plugins/NextFederationPlugin/index.js +2 -4
  42. package/dist/src/plugins/NextFederationPlugin/index.js.map +1 -1
  43. package/dist/src/plugins/NextFederationPlugin/index.mjs +2 -4
  44. package/dist/src/plugins/NextFederationPlugin/index.mjs.map +1 -1
  45. package/dist/src/plugins/NextFederationPlugin/manifest-options.d.mts +4 -0
  46. package/dist/src/plugins/NextFederationPlugin/manifest-options.d.ts +4 -0
  47. package/dist/src/plugins/NextFederationPlugin/manifest-options.js +13 -0
  48. package/dist/src/plugins/NextFederationPlugin/manifest-options.js.map +1 -0
  49. package/dist/src/plugins/NextFederationPlugin/manifest-options.mjs +12 -0
  50. package/dist/src/plugins/NextFederationPlugin/manifest-options.mjs.map +1 -0
  51. package/dist/src/plugins/NextFederationPlugin/next-fragments.d.mts +18 -16
  52. package/dist/src/plugins/NextFederationPlugin/next-fragments.d.ts +18 -16
  53. package/dist/src/plugins/NextFederationPlugin/regex-equal.d.mts +14 -0
  54. package/dist/src/plugins/NextFederationPlugin/regex-equal.d.ts +14 -0
  55. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.d.mts +8 -0
  56. package/dist/src/plugins/NextFederationPlugin/remove-unnecessary-shared-keys.d.ts +8 -0
  57. package/dist/src/plugins/NextFederationPlugin/set-options.d.mts +6 -0
  58. package/dist/src/plugins/NextFederationPlugin/set-options.d.ts +6 -0
  59. package/dist/src/plugins/NextFederationPlugin/set-options.js.map +1 -1
  60. package/dist/src/plugins/NextFederationPlugin/set-options.mjs.map +1 -1
  61. package/dist/src/plugins/NextFederationPlugin/validate-options.d.mts +25 -0
  62. package/dist/src/plugins/NextFederationPlugin/validate-options.d.ts +25 -0
  63. package/dist/src/plugins/container/InvertedContainerPlugin.d.mts +5 -0
  64. package/dist/src/plugins/container/InvertedContainerPlugin.d.ts +5 -0
  65. package/dist/src/plugins/container/InvertedContainerRuntimeModule.d.mts +11 -0
  66. package/dist/src/plugins/container/InvertedContainerRuntimeModule.d.ts +11 -0
  67. package/dist/src/plugins/container/InvertedContainerRuntimeModule.js.map +1 -1
  68. package/dist/src/plugins/container/InvertedContainerRuntimeModule.mjs.map +1 -1
  69. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.d.mts +39 -0
  70. package/dist/src/plugins/container/RemoveEagerModulesFromRuntimePlugin.d.ts +39 -0
  71. package/dist/src/plugins/container/runtimePlugin.d.mts +2 -7
  72. package/dist/src/plugins/container/runtimePlugin.d.ts +2 -6
  73. package/dist/src/plugins/container/types.d.mts +2 -0
  74. package/dist/src/plugins/container/types.d.ts +2 -0
  75. package/dist/src/types.d.mts +28 -0
  76. package/dist/src/types.d.ts +28 -0
  77. package/dist/utils/flushedChunks.d.mts +5 -12
  78. package/dist/utils/flushedChunks.d.ts +5 -12
  79. package/dist/utils/index.d.mts +14 -8
  80. package/dist/utils/index.d.ts +14 -8
  81. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"set-options.js","names":[],"sources":["../../../../src/plugins/NextFederationPlugin/set-options.ts"],"sourcesContent":["import type { moduleFederationPlugin } from '@module-federation/sdk';\n\nexport interface NextFederationPluginExtraOptions {\n enableImageLoaderFix?: boolean;\n enableUrlLoaderFix?: boolean;\n exposePages?: boolean;\n skipSharingNextInternals?: boolean;\n automaticPageStitching?: boolean;\n debug?: boolean;\n}\n\nexport interface NextFederationPluginOptions\n extends moduleFederationPlugin.ModuleFederationPluginOptions {\n extraOptions: NextFederationPluginExtraOptions;\n}\n\nexport function setOptions(options: NextFederationPluginOptions): {\n mainOptions: moduleFederationPlugin.ModuleFederationPluginOptions;\n extraOptions: NextFederationPluginExtraOptions;\n} {\n const { extraOptions, ...mainOpts } = options;\n\n /**\n * Default extra options for NextFederationPlugin.\n * @type {NextFederationPluginExtraOptions}\n */\n const defaultExtraOptions: NextFederationPluginExtraOptions = {\n automaticPageStitching: false,\n enableImageLoaderFix: false,\n enableUrlLoaderFix: false,\n skipSharingNextInternals: false,\n debug: false,\n };\n\n return {\n mainOptions: mainOpts,\n extraOptions: { ...defaultExtraOptions, ...extraOptions },\n };\n}\n"],"mappings":";;AAgBA,SAAgB,WAAW,SAGzB;CACA,MAAM,EAAE,cAAc,GAAG,aAAa;AActC,QAAO;EACL,aAAa;EACb,cAAc;GATd,wBAAwB;GACxB,sBAAsB;GACtB,oBAAoB;GACpB,0BAA0B;GAC1B,OAAO;GAKiC,GAAG;GAAc;EAC1D"}
1
+ {"version":3,"file":"set-options.js","names":[],"sources":["../../../../src/plugins/NextFederationPlugin/set-options.ts"],"sourcesContent":["import type { moduleFederationPlugin } from '@module-federation/sdk';\nimport type {\n NextFederationPluginExtraOptions,\n NextFederationPluginOptions,\n} from './next-fragments';\n\nexport function setOptions(options: NextFederationPluginOptions): {\n mainOptions: moduleFederationPlugin.ModuleFederationPluginOptions;\n extraOptions: NextFederationPluginExtraOptions;\n} {\n const { extraOptions, ...mainOpts } = options;\n\n /**\n * Default extra options for NextFederationPlugin.\n * @type {NextFederationPluginExtraOptions}\n */\n const defaultExtraOptions: NextFederationPluginExtraOptions = {\n automaticPageStitching: false,\n enableImageLoaderFix: false,\n enableUrlLoaderFix: false,\n skipSharingNextInternals: false,\n debug: false,\n };\n\n return {\n mainOptions: mainOpts,\n extraOptions: { ...defaultExtraOptions, ...extraOptions },\n };\n}\n"],"mappings":";;AAMA,SAAgB,WAAW,SAGzB;CACA,MAAM,EAAE,cAAc,GAAG,aAAa;AActC,QAAO;EACL,aAAa;EACb,cAAc;GATd,wBAAwB;GACxB,sBAAsB;GACtB,oBAAoB;GACpB,0BAA0B;GAC1B,OAAO;GAKiC,GAAG;GAAc;EAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"set-options.mjs","names":[],"sources":["../../../../src/plugins/NextFederationPlugin/set-options.ts"],"sourcesContent":["import type { moduleFederationPlugin } from '@module-federation/sdk';\n\nexport interface NextFederationPluginExtraOptions {\n enableImageLoaderFix?: boolean;\n enableUrlLoaderFix?: boolean;\n exposePages?: boolean;\n skipSharingNextInternals?: boolean;\n automaticPageStitching?: boolean;\n debug?: boolean;\n}\n\nexport interface NextFederationPluginOptions\n extends moduleFederationPlugin.ModuleFederationPluginOptions {\n extraOptions: NextFederationPluginExtraOptions;\n}\n\nexport function setOptions(options: NextFederationPluginOptions): {\n mainOptions: moduleFederationPlugin.ModuleFederationPluginOptions;\n extraOptions: NextFederationPluginExtraOptions;\n} {\n const { extraOptions, ...mainOpts } = options;\n\n /**\n * Default extra options for NextFederationPlugin.\n * @type {NextFederationPluginExtraOptions}\n */\n const defaultExtraOptions: NextFederationPluginExtraOptions = {\n automaticPageStitching: false,\n enableImageLoaderFix: false,\n enableUrlLoaderFix: false,\n skipSharingNextInternals: false,\n debug: false,\n };\n\n return {\n mainOptions: mainOpts,\n extraOptions: { ...defaultExtraOptions, ...extraOptions },\n };\n}\n"],"mappings":";AAgBA,SAAgB,WAAW,SAGzB;CACA,MAAM,EAAE,cAAc,GAAG,aAAa;AActC,QAAO;EACL,aAAa;EACb,cAAc;GATd,wBAAwB;GACxB,sBAAsB;GACtB,oBAAoB;GACpB,0BAA0B;GAC1B,OAAO;GAKiC,GAAG;GAAc;EAC1D"}
1
+ {"version":3,"file":"set-options.mjs","names":[],"sources":["../../../../src/plugins/NextFederationPlugin/set-options.ts"],"sourcesContent":["import type { moduleFederationPlugin } from '@module-federation/sdk';\nimport type {\n NextFederationPluginExtraOptions,\n NextFederationPluginOptions,\n} from './next-fragments';\n\nexport function setOptions(options: NextFederationPluginOptions): {\n mainOptions: moduleFederationPlugin.ModuleFederationPluginOptions;\n extraOptions: NextFederationPluginExtraOptions;\n} {\n const { extraOptions, ...mainOpts } = options;\n\n /**\n * Default extra options for NextFederationPlugin.\n * @type {NextFederationPluginExtraOptions}\n */\n const defaultExtraOptions: NextFederationPluginExtraOptions = {\n automaticPageStitching: false,\n enableImageLoaderFix: false,\n enableUrlLoaderFix: false,\n skipSharingNextInternals: false,\n debug: false,\n };\n\n return {\n mainOptions: mainOpts,\n extraOptions: { ...defaultExtraOptions, ...extraOptions },\n };\n}\n"],"mappings":";AAMA,SAAgB,WAAW,SAGzB;CACA,MAAM,EAAE,cAAc,GAAG,aAAa;AActC,QAAO;EACL,aAAa;EACb,cAAc;GATd,wBAAwB;GACxB,sBAAsB;GACtB,oBAAoB;GACpB,0BAA0B;GAC1B,OAAO;GAKiC,GAAG;GAAc;EAC1D"}
@@ -0,0 +1,25 @@
1
+ import type { Compiler } from 'webpack';
2
+ import type { moduleFederationPlugin } from '@module-federation/sdk';
3
+ /**
4
+ * Validates the compiler options.
5
+ *
6
+ * @param {Compiler} compiler - The Webpack compiler instance.
7
+ * @returns {boolean} - Returns true if the compiler options are valid, false otherwise.
8
+ *
9
+ * @throws Will throw an error if the name option is not defined in the options.
10
+ * @remarks
11
+ * This function validates the options passed to the Webpack compiler. It checks if the name option is set to either "server" or
12
+ * "client", as Module Federation is only applied to the main server and client builds in Next.js.
13
+ */
14
+ export declare function validateCompilerOptions(compiler: Compiler): boolean;
15
+ /**
16
+ * Validates the NextFederationPlugin options.
17
+ *
18
+ * @param {moduleFederationPlugin.ModuleFederationPluginOptions} options - The ModuleFederationPluginOptions instance.
19
+ *
20
+ * @throws Will throw an error if the filename option is not defined in the options or if the name option is not specified.
21
+ * @remarks
22
+ * This function validates the options passed to NextFederationPlugin. It ensures that the filename and name options are defined,
23
+ * as they are required for using Module Federation.
24
+ */
25
+ export declare function validatePluginOptions(options: moduleFederationPlugin.ModuleFederationPluginOptions): boolean | void;
@@ -0,0 +1,25 @@
1
+ import type { Compiler } from 'webpack';
2
+ import type { moduleFederationPlugin } from '@module-federation/sdk';
3
+ /**
4
+ * Validates the compiler options.
5
+ *
6
+ * @param {Compiler} compiler - The Webpack compiler instance.
7
+ * @returns {boolean} - Returns true if the compiler options are valid, false otherwise.
8
+ *
9
+ * @throws Will throw an error if the name option is not defined in the options.
10
+ * @remarks
11
+ * This function validates the options passed to the Webpack compiler. It checks if the name option is set to either "server" or
12
+ * "client", as Module Federation is only applied to the main server and client builds in Next.js.
13
+ */
14
+ export declare function validateCompilerOptions(compiler: Compiler): boolean;
15
+ /**
16
+ * Validates the NextFederationPlugin options.
17
+ *
18
+ * @param {moduleFederationPlugin.ModuleFederationPluginOptions} options - The ModuleFederationPluginOptions instance.
19
+ *
20
+ * @throws Will throw an error if the filename option is not defined in the options or if the name option is not specified.
21
+ * @remarks
22
+ * This function validates the options passed to NextFederationPlugin. It ensures that the filename and name options are defined,
23
+ * as they are required for using Module Federation.
24
+ */
25
+ export declare function validatePluginOptions(options: moduleFederationPlugin.ModuleFederationPluginOptions): boolean | void;
@@ -0,0 +1,5 @@
1
+ import type { Compiler } from 'webpack';
2
+ declare class InvertedContainerPlugin {
3
+ apply(compiler: Compiler): void;
4
+ }
5
+ export default InvertedContainerPlugin;
@@ -0,0 +1,5 @@
1
+ import type { Compiler } from 'webpack';
2
+ declare class InvertedContainerPlugin {
3
+ apply(compiler: Compiler): void;
4
+ }
5
+ export default InvertedContainerPlugin;
@@ -0,0 +1,11 @@
1
+ declare const RuntimeModule: typeof import("node_modules/webpack/types").RuntimeModule;
2
+ interface InvertedContainerRuntimeModuleOptions {
3
+ name?: string;
4
+ containers: Set<any>;
5
+ }
6
+ declare class InvertedContainerRuntimeModule extends RuntimeModule {
7
+ private options;
8
+ constructor(options: InvertedContainerRuntimeModuleOptions);
9
+ generate(): string;
10
+ }
11
+ export default InvertedContainerRuntimeModule;
@@ -0,0 +1,11 @@
1
+ declare const RuntimeModule: typeof import("node_modules/webpack/types").RuntimeModule;
2
+ interface InvertedContainerRuntimeModuleOptions {
3
+ name?: string;
4
+ containers: Set<any>;
5
+ }
6
+ declare class InvertedContainerRuntimeModule extends RuntimeModule {
7
+ private options;
8
+ constructor(options: InvertedContainerRuntimeModuleOptions);
9
+ generate(): string;
10
+ }
11
+ export default InvertedContainerRuntimeModule;
@@ -1 +1 @@
1
- {"version":3,"file":"InvertedContainerRuntimeModule.js","names":[],"sources":["../../../../src/plugins/container/InvertedContainerRuntimeModule.ts"],"sourcesContent":["import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type ContainerEntryModule from '@module-federation/enhanced/src/lib/container/ContainerEntryModule';\nconst { RuntimeModule, Template, RuntimeGlobals } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\n\ninterface InvertedContainerRuntimeModuleOptions {\n name?: string;\n containers: Set<any>; // Adjust the type as necessary\n}\n\nclass InvertedContainerRuntimeModule extends RuntimeModule {\n private options: InvertedContainerRuntimeModuleOptions;\n\n constructor(options: InvertedContainerRuntimeModuleOptions) {\n super('inverted container startup', RuntimeModule.STAGE_TRIGGER);\n this.options = options;\n }\n\n override generate(): string {\n const { compilation, chunk, chunkGraph } = this;\n if (!compilation || !chunk || !chunkGraph) {\n return '';\n }\n if (chunk.runtime === 'webpack-api-runtime') {\n return '';\n }\n\n const runtimeChunk = compilation.options.optimization?.runtimeChunk;\n if (typeof runtimeChunk === 'object' && runtimeChunk !== null) {\n const logger = compilation.getLogger('InvertedContainerRuntimeModule');\n logger.info(\n 'Runtime chunk is configured. Consider adding runtime: false to your ModuleFederationPlugin configuration to prevent runtime conflicts.',\n );\n }\n\n let containerEntryModule;\n for (const containerDep of this.options.containers) {\n const mod = compilation.moduleGraph.getModule(containerDep);\n if (!mod) continue;\n if (chunkGraph.isModuleInChunk(mod, chunk)) {\n containerEntryModule = mod as ContainerEntryModule;\n }\n }\n\n if (!containerEntryModule) return '';\n\n if (\n compilation.chunkGraph.isEntryModuleInChunk(containerEntryModule, chunk)\n ) {\n // Don't apply to the remote entry itself\n return '';\n }\n const initRuntimeModuleGetter = compilation.runtimeTemplate.moduleRaw({\n module: containerEntryModule,\n chunkGraph,\n weak: false,\n runtimeRequirements: new Set(),\n });\n\n //@ts-ignore\n const nameJSON = JSON.stringify(containerEntryModule._name);\n\n return Template.asString([\n `var prevStartup = ${RuntimeGlobals.startup};`,\n `var hasRun = false;`,\n `var cachedRemote;`,\n `${RuntimeGlobals.startup} = ${compilation.runtimeTemplate.basicFunction(\n '',\n Template.asString([\n `if (!hasRun) {`,\n Template.indent(\n Template.asString([\n `hasRun = true;`,\n `if (typeof prevStartup === 'function') {`,\n Template.indent(Template.asString([`prevStartup();`])),\n `}`,\n `cachedRemote = ${initRuntimeModuleGetter};`,\n `var gs = ${RuntimeGlobals.global} || globalThis;`,\n `gs[${nameJSON}] = cachedRemote;`,\n ]),\n ),\n `} else if (typeof prevStartup === 'function') {`,\n Template.indent(`prevStartup();`),\n `}`,\n ]),\n )};`,\n ]);\n }\n}\n\nexport default InvertedContainerRuntimeModule;\n"],"mappings":";;;;AAEA,MAAM,EAAE,eAAe,UAAU,mBAAmB,gFAC7B,UAAU,CAChC;AAOD,IAAM,iCAAN,cAA6C,cAAc;CAGzD,YAAY,SAAgD;AAC1D,QAAM,8BAA8B,cAAc,cAAc;AAChE,OAAK,UAAU;;CAGjB,AAAS,WAAmB;EAC1B,MAAM,EAAE,aAAa,OAAO,eAAe;AAC3C,MAAI,CAAC,eAAe,CAAC,SAAS,CAAC,WAC7B,QAAO;AAET,MAAI,MAAM,YAAY,sBACpB,QAAO;EAGT,MAAM,eAAe,YAAY,QAAQ,cAAc;AACvD,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,KAEvD,CADe,YAAY,UAAU,iCAAiC,CAC/D,KACL,yIACD;EAGH,IAAI;AACJ,OAAK,MAAM,gBAAgB,KAAK,QAAQ,YAAY;GAClD,MAAM,MAAM,YAAY,YAAY,UAAU,aAAa;AAC3D,OAAI,CAAC,IAAK;AACV,OAAI,WAAW,gBAAgB,KAAK,MAAM,CACxC,wBAAuB;;AAI3B,MAAI,CAAC,qBAAsB,QAAO;AAElC,MACE,YAAY,WAAW,qBAAqB,sBAAsB,MAAM,CAGxE,QAAO;EAET,MAAM,0BAA0B,YAAY,gBAAgB,UAAU;GACpE,QAAQ;GACR;GACA,MAAM;GACN,qCAAqB,IAAI,KAAK;GAC/B,CAAC;EAGF,MAAM,WAAW,KAAK,UAAU,qBAAqB,MAAM;AAE3D,SAAO,SAAS,SAAS;GACvB,qBAAqB,eAAe,QAAQ;GAC5C;GACA;GACA,GAAG,eAAe,QAAQ,KAAK,YAAY,gBAAgB,cACzD,IACA,SAAS,SAAS;IAChB;IACA,SAAS,OACP,SAAS,SAAS;KAChB;KACA;KACA,SAAS,OAAO,SAAS,SAAS,CAAC,iBAAiB,CAAC,CAAC;KACtD;KACA,kBAAkB,wBAAwB;KAC1C,YAAY,eAAe,OAAO;KAClC,MAAM,SAAS;KAChB,CAAC,CACH;IACD;IACA,SAAS,OAAO,iBAAiB;IACjC;IACD,CAAC,CACH,CAAC;GACH,CAAC"}
1
+ {"version":3,"file":"InvertedContainerRuntimeModule.js","names":[],"sources":["../../../../src/plugins/container/InvertedContainerRuntimeModule.ts"],"sourcesContent":["import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nconst { RuntimeModule, Template, RuntimeGlobals } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack') & {\n RuntimeGlobals: Record<string, string>;\n};\n\ninterface InvertedContainerRuntimeModuleOptions {\n name?: string;\n containers: Set<any>; // Adjust the type as necessary\n}\n\ntype ContainerEntryModule = NonNullable<\n ReturnType<CompilationModuleGraph['getModule']>\n> & {\n _name?: string;\n};\n\ntype CompilationModuleGraph = {\n getModule: (dependency: unknown) => unknown;\n};\n\nclass InvertedContainerRuntimeModule extends RuntimeModule {\n private options: InvertedContainerRuntimeModuleOptions;\n\n constructor(options: InvertedContainerRuntimeModuleOptions) {\n super('inverted container startup', RuntimeModule.STAGE_TRIGGER);\n this.options = options;\n }\n\n override generate(): string {\n const { compilation, chunk, chunkGraph } = this;\n if (!compilation || !chunk || !chunkGraph) {\n return '';\n }\n if (chunk.runtime === 'webpack-api-runtime') {\n return '';\n }\n\n const runtimeChunk = compilation.options.optimization?.runtimeChunk;\n if (typeof runtimeChunk === 'object' && runtimeChunk !== null) {\n const logger = compilation.getLogger('InvertedContainerRuntimeModule');\n logger.info(\n 'Runtime chunk is configured. Consider adding runtime: false to your ModuleFederationPlugin configuration to prevent runtime conflicts.',\n );\n }\n\n let containerEntryModule;\n for (const containerDep of this.options.containers) {\n const mod = compilation.moduleGraph.getModule(containerDep);\n if (!mod) continue;\n if (chunkGraph.isModuleInChunk(mod, chunk)) {\n containerEntryModule = mod as ContainerEntryModule;\n }\n }\n\n if (!containerEntryModule) return '';\n\n if (\n compilation.chunkGraph.isEntryModuleInChunk(containerEntryModule, chunk)\n ) {\n // Don't apply to the remote entry itself\n return '';\n }\n const initRuntimeModuleGetter = compilation.runtimeTemplate.moduleRaw({\n module: containerEntryModule,\n chunkGraph,\n weak: false,\n runtimeRequirements: new Set(),\n });\n\n //@ts-ignore\n const nameJSON = JSON.stringify(containerEntryModule._name);\n\n return Template.asString([\n `var prevStartup = ${RuntimeGlobals.startup};`,\n `var hasRun = false;`,\n `var cachedRemote;`,\n `${RuntimeGlobals.startup} = ${compilation.runtimeTemplate.basicFunction(\n '',\n Template.asString([\n `if (!hasRun) {`,\n Template.indent(\n Template.asString([\n `hasRun = true;`,\n `if (typeof prevStartup === 'function') {`,\n Template.indent(Template.asString([`prevStartup();`])),\n `}`,\n `cachedRemote = ${initRuntimeModuleGetter};`,\n `var gs = ${RuntimeGlobals.global} || globalThis;`,\n `gs[${nameJSON}] = cachedRemote;`,\n ]),\n ),\n `} else if (typeof prevStartup === 'function') {`,\n Template.indent(`prevStartup();`),\n `}`,\n ]),\n )};`,\n ]);\n }\n}\n\nexport default InvertedContainerRuntimeModule;\n"],"mappings":";;;;AACA,MAAM,EAAE,eAAe,UAAU,mBAAmB,gFAC7B,UAAU,CAChC;AAmBD,IAAM,iCAAN,cAA6C,cAAc;CAGzD,YAAY,SAAgD;AAC1D,QAAM,8BAA8B,cAAc,cAAc;AAChE,OAAK,UAAU;;CAGjB,AAAS,WAAmB;EAC1B,MAAM,EAAE,aAAa,OAAO,eAAe;AAC3C,MAAI,CAAC,eAAe,CAAC,SAAS,CAAC,WAC7B,QAAO;AAET,MAAI,MAAM,YAAY,sBACpB,QAAO;EAGT,MAAM,eAAe,YAAY,QAAQ,cAAc;AACvD,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,KAEvD,CADe,YAAY,UAAU,iCAAiC,CAC/D,KACL,yIACD;EAGH,IAAI;AACJ,OAAK,MAAM,gBAAgB,KAAK,QAAQ,YAAY;GAClD,MAAM,MAAM,YAAY,YAAY,UAAU,aAAa;AAC3D,OAAI,CAAC,IAAK;AACV,OAAI,WAAW,gBAAgB,KAAK,MAAM,CACxC,wBAAuB;;AAI3B,MAAI,CAAC,qBAAsB,QAAO;AAElC,MACE,YAAY,WAAW,qBAAqB,sBAAsB,MAAM,CAGxE,QAAO;EAET,MAAM,0BAA0B,YAAY,gBAAgB,UAAU;GACpE,QAAQ;GACR;GACA,MAAM;GACN,qCAAqB,IAAI,KAAK;GAC/B,CAAC;EAGF,MAAM,WAAW,KAAK,UAAU,qBAAqB,MAAM;AAE3D,SAAO,SAAS,SAAS;GACvB,qBAAqB,eAAe,QAAQ;GAC5C;GACA;GACA,GAAG,eAAe,QAAQ,KAAK,YAAY,gBAAgB,cACzD,IACA,SAAS,SAAS;IAChB;IACA,SAAS,OACP,SAAS,SAAS;KAChB;KACA;KACA,SAAS,OAAO,SAAS,SAAS,CAAC,iBAAiB,CAAC,CAAC;KACtD;KACA,kBAAkB,wBAAwB;KAC1C,YAAY,eAAe,OAAO;KAClC,MAAM,SAAS;KAChB,CAAC,CACH;IACD;IACA,SAAS,OAAO,iBAAiB;IACjC;IACD,CAAC,CACH,CAAC;GACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InvertedContainerRuntimeModule.mjs","names":[],"sources":["../../../../src/plugins/container/InvertedContainerRuntimeModule.ts"],"sourcesContent":["import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type ContainerEntryModule from '@module-federation/enhanced/src/lib/container/ContainerEntryModule';\nconst { RuntimeModule, Template, RuntimeGlobals } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\n\ninterface InvertedContainerRuntimeModuleOptions {\n name?: string;\n containers: Set<any>; // Adjust the type as necessary\n}\n\nclass InvertedContainerRuntimeModule extends RuntimeModule {\n private options: InvertedContainerRuntimeModuleOptions;\n\n constructor(options: InvertedContainerRuntimeModuleOptions) {\n super('inverted container startup', RuntimeModule.STAGE_TRIGGER);\n this.options = options;\n }\n\n override generate(): string {\n const { compilation, chunk, chunkGraph } = this;\n if (!compilation || !chunk || !chunkGraph) {\n return '';\n }\n if (chunk.runtime === 'webpack-api-runtime') {\n return '';\n }\n\n const runtimeChunk = compilation.options.optimization?.runtimeChunk;\n if (typeof runtimeChunk === 'object' && runtimeChunk !== null) {\n const logger = compilation.getLogger('InvertedContainerRuntimeModule');\n logger.info(\n 'Runtime chunk is configured. Consider adding runtime: false to your ModuleFederationPlugin configuration to prevent runtime conflicts.',\n );\n }\n\n let containerEntryModule;\n for (const containerDep of this.options.containers) {\n const mod = compilation.moduleGraph.getModule(containerDep);\n if (!mod) continue;\n if (chunkGraph.isModuleInChunk(mod, chunk)) {\n containerEntryModule = mod as ContainerEntryModule;\n }\n }\n\n if (!containerEntryModule) return '';\n\n if (\n compilation.chunkGraph.isEntryModuleInChunk(containerEntryModule, chunk)\n ) {\n // Don't apply to the remote entry itself\n return '';\n }\n const initRuntimeModuleGetter = compilation.runtimeTemplate.moduleRaw({\n module: containerEntryModule,\n chunkGraph,\n weak: false,\n runtimeRequirements: new Set(),\n });\n\n //@ts-ignore\n const nameJSON = JSON.stringify(containerEntryModule._name);\n\n return Template.asString([\n `var prevStartup = ${RuntimeGlobals.startup};`,\n `var hasRun = false;`,\n `var cachedRemote;`,\n `${RuntimeGlobals.startup} = ${compilation.runtimeTemplate.basicFunction(\n '',\n Template.asString([\n `if (!hasRun) {`,\n Template.indent(\n Template.asString([\n `hasRun = true;`,\n `if (typeof prevStartup === 'function') {`,\n Template.indent(Template.asString([`prevStartup();`])),\n `}`,\n `cachedRemote = ${initRuntimeModuleGetter};`,\n `var gs = ${RuntimeGlobals.global} || globalThis;`,\n `gs[${nameJSON}] = cachedRemote;`,\n ]),\n ),\n `} else if (typeof prevStartup === 'function') {`,\n Template.indent(`prevStartup();`),\n `}`,\n ]),\n )};`,\n ]);\n }\n}\n\nexport default InvertedContainerRuntimeModule;\n"],"mappings":";;;;AAEA,MAAM,EAAE,eAAe,UAAU,6BAC/B,qBAAqB,UAAU,CAChC;AAOD,IAAM,iCAAN,cAA6C,cAAc;CAGzD,YAAY,SAAgD;AAC1D,QAAM,8BAA8B,cAAc,cAAc;AAChE,OAAK,UAAU;;CAGjB,AAAS,WAAmB;EAC1B,MAAM,EAAE,aAAa,OAAO,eAAe;AAC3C,MAAI,CAAC,eAAe,CAAC,SAAS,CAAC,WAC7B,QAAO;AAET,MAAI,MAAM,YAAY,sBACpB,QAAO;EAGT,MAAM,eAAe,YAAY,QAAQ,cAAc;AACvD,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,KAEvD,CADe,YAAY,UAAU,iCAAiC,CAC/D,KACL,yIACD;EAGH,IAAI;AACJ,OAAK,MAAM,gBAAgB,KAAK,QAAQ,YAAY;GAClD,MAAM,MAAM,YAAY,YAAY,UAAU,aAAa;AAC3D,OAAI,CAAC,IAAK;AACV,OAAI,WAAW,gBAAgB,KAAK,MAAM,CACxC,wBAAuB;;AAI3B,MAAI,CAAC,qBAAsB,QAAO;AAElC,MACE,YAAY,WAAW,qBAAqB,sBAAsB,MAAM,CAGxE,QAAO;EAET,MAAM,0BAA0B,YAAY,gBAAgB,UAAU;GACpE,QAAQ;GACR;GACA,MAAM;GACN,qCAAqB,IAAI,KAAK;GAC/B,CAAC;EAGF,MAAM,WAAW,KAAK,UAAU,qBAAqB,MAAM;AAE3D,SAAO,SAAS,SAAS;GACvB,qBAAqB,eAAe,QAAQ;GAC5C;GACA;GACA,GAAG,eAAe,QAAQ,KAAK,YAAY,gBAAgB,cACzD,IACA,SAAS,SAAS;IAChB;IACA,SAAS,OACP,SAAS,SAAS;KAChB;KACA;KACA,SAAS,OAAO,SAAS,SAAS,CAAC,iBAAiB,CAAC,CAAC;KACtD;KACA,kBAAkB,wBAAwB;KAC1C,YAAY,eAAe,OAAO;KAClC,MAAM,SAAS;KAChB,CAAC,CACH;IACD;IACA,SAAS,OAAO,iBAAiB;IACjC;IACD,CAAC,CACH,CAAC;GACH,CAAC"}
1
+ {"version":3,"file":"InvertedContainerRuntimeModule.mjs","names":[],"sources":["../../../../src/plugins/container/InvertedContainerRuntimeModule.ts"],"sourcesContent":["import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nconst { RuntimeModule, Template, RuntimeGlobals } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack') & {\n RuntimeGlobals: Record<string, string>;\n};\n\ninterface InvertedContainerRuntimeModuleOptions {\n name?: string;\n containers: Set<any>; // Adjust the type as necessary\n}\n\ntype ContainerEntryModule = NonNullable<\n ReturnType<CompilationModuleGraph['getModule']>\n> & {\n _name?: string;\n};\n\ntype CompilationModuleGraph = {\n getModule: (dependency: unknown) => unknown;\n};\n\nclass InvertedContainerRuntimeModule extends RuntimeModule {\n private options: InvertedContainerRuntimeModuleOptions;\n\n constructor(options: InvertedContainerRuntimeModuleOptions) {\n super('inverted container startup', RuntimeModule.STAGE_TRIGGER);\n this.options = options;\n }\n\n override generate(): string {\n const { compilation, chunk, chunkGraph } = this;\n if (!compilation || !chunk || !chunkGraph) {\n return '';\n }\n if (chunk.runtime === 'webpack-api-runtime') {\n return '';\n }\n\n const runtimeChunk = compilation.options.optimization?.runtimeChunk;\n if (typeof runtimeChunk === 'object' && runtimeChunk !== null) {\n const logger = compilation.getLogger('InvertedContainerRuntimeModule');\n logger.info(\n 'Runtime chunk is configured. Consider adding runtime: false to your ModuleFederationPlugin configuration to prevent runtime conflicts.',\n );\n }\n\n let containerEntryModule;\n for (const containerDep of this.options.containers) {\n const mod = compilation.moduleGraph.getModule(containerDep);\n if (!mod) continue;\n if (chunkGraph.isModuleInChunk(mod, chunk)) {\n containerEntryModule = mod as ContainerEntryModule;\n }\n }\n\n if (!containerEntryModule) return '';\n\n if (\n compilation.chunkGraph.isEntryModuleInChunk(containerEntryModule, chunk)\n ) {\n // Don't apply to the remote entry itself\n return '';\n }\n const initRuntimeModuleGetter = compilation.runtimeTemplate.moduleRaw({\n module: containerEntryModule,\n chunkGraph,\n weak: false,\n runtimeRequirements: new Set(),\n });\n\n //@ts-ignore\n const nameJSON = JSON.stringify(containerEntryModule._name);\n\n return Template.asString([\n `var prevStartup = ${RuntimeGlobals.startup};`,\n `var hasRun = false;`,\n `var cachedRemote;`,\n `${RuntimeGlobals.startup} = ${compilation.runtimeTemplate.basicFunction(\n '',\n Template.asString([\n `if (!hasRun) {`,\n Template.indent(\n Template.asString([\n `hasRun = true;`,\n `if (typeof prevStartup === 'function') {`,\n Template.indent(Template.asString([`prevStartup();`])),\n `}`,\n `cachedRemote = ${initRuntimeModuleGetter};`,\n `var gs = ${RuntimeGlobals.global} || globalThis;`,\n `gs[${nameJSON}] = cachedRemote;`,\n ]),\n ),\n `} else if (typeof prevStartup === 'function') {`,\n Template.indent(`prevStartup();`),\n `}`,\n ]),\n )};`,\n ]);\n }\n}\n\nexport default InvertedContainerRuntimeModule;\n"],"mappings":";;;;AACA,MAAM,EAAE,eAAe,UAAU,6BAC/B,qBAAqB,UAAU,CAChC;AAmBD,IAAM,iCAAN,cAA6C,cAAc;CAGzD,YAAY,SAAgD;AAC1D,QAAM,8BAA8B,cAAc,cAAc;AAChE,OAAK,UAAU;;CAGjB,AAAS,WAAmB;EAC1B,MAAM,EAAE,aAAa,OAAO,eAAe;AAC3C,MAAI,CAAC,eAAe,CAAC,SAAS,CAAC,WAC7B,QAAO;AAET,MAAI,MAAM,YAAY,sBACpB,QAAO;EAGT,MAAM,eAAe,YAAY,QAAQ,cAAc;AACvD,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,KAEvD,CADe,YAAY,UAAU,iCAAiC,CAC/D,KACL,yIACD;EAGH,IAAI;AACJ,OAAK,MAAM,gBAAgB,KAAK,QAAQ,YAAY;GAClD,MAAM,MAAM,YAAY,YAAY,UAAU,aAAa;AAC3D,OAAI,CAAC,IAAK;AACV,OAAI,WAAW,gBAAgB,KAAK,MAAM,CACxC,wBAAuB;;AAI3B,MAAI,CAAC,qBAAsB,QAAO;AAElC,MACE,YAAY,WAAW,qBAAqB,sBAAsB,MAAM,CAGxE,QAAO;EAET,MAAM,0BAA0B,YAAY,gBAAgB,UAAU;GACpE,QAAQ;GACR;GACA,MAAM;GACN,qCAAqB,IAAI,KAAK;GAC/B,CAAC;EAGF,MAAM,WAAW,KAAK,UAAU,qBAAqB,MAAM;AAE3D,SAAO,SAAS,SAAS;GACvB,qBAAqB,eAAe,QAAQ;GAC5C;GACA;GACA,GAAG,eAAe,QAAQ,KAAK,YAAY,gBAAgB,cACzD,IACA,SAAS,SAAS;IAChB;IACA,SAAS,OACP,SAAS,SAAS;KAChB;KACA;KACA,SAAS,OAAO,SAAS,SAAS,CAAC,iBAAiB,CAAC,CAAC;KACtD;KACA,kBAAkB,wBAAwB;KAC1C,YAAY,eAAe,OAAO;KAClC,MAAM,SAAS;KAChB,CAAC,CACH;IACD;IACA,SAAS,OAAO,iBAAiB;IACjC;IACD,CAAC,CACH,CAAC;GACH,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { Compiler } from 'webpack';
2
+ /**
3
+ * This plugin removes eager modules from the runtime.
4
+ * @class RemoveEagerModulesFromRuntimePlugin
5
+ */
6
+ declare class RemoveEagerModulesFromRuntimePlugin {
7
+ private container;
8
+ private debug;
9
+ private modulesToProcess;
10
+ /**
11
+ * Creates an instance of RemoveEagerModulesFromRuntimePlugin.
12
+ * @param {Object} options - The options for the plugin.
13
+ * @param {string} options.container - The container to remove modules from.
14
+ * @param {boolean} options.debug - Whether to log debug information.
15
+ */
16
+ constructor(options: {
17
+ container?: string;
18
+ debug?: boolean;
19
+ });
20
+ /**
21
+ * Applies the plugin to the compiler.
22
+ * @param {Compiler} compiler - The webpack compiler.
23
+ */
24
+ apply(compiler: Compiler): void;
25
+ /**
26
+ * Processes the modules in the chunk.
27
+ * @param {Compilation} compilation - The webpack compilation.
28
+ * @param {Chunk} chunk - The chunk to process.
29
+ * @param {Iterable<Module>} modules - The modules in the chunk.
30
+ */
31
+ private processModules;
32
+ /**
33
+ * Removes the modules from the chunk.
34
+ * @param {Compilation} compilation - The webpack compilation.
35
+ * @param {Chunk} chunk - The chunk to remove modules from.
36
+ */
37
+ private removeModules;
38
+ }
39
+ export default RemoveEagerModulesFromRuntimePlugin;
@@ -0,0 +1,39 @@
1
+ import type { Compiler } from 'webpack';
2
+ /**
3
+ * This plugin removes eager modules from the runtime.
4
+ * @class RemoveEagerModulesFromRuntimePlugin
5
+ */
6
+ declare class RemoveEagerModulesFromRuntimePlugin {
7
+ private container;
8
+ private debug;
9
+ private modulesToProcess;
10
+ /**
11
+ * Creates an instance of RemoveEagerModulesFromRuntimePlugin.
12
+ * @param {Object} options - The options for the plugin.
13
+ * @param {string} options.container - The container to remove modules from.
14
+ * @param {boolean} options.debug - Whether to log debug information.
15
+ */
16
+ constructor(options: {
17
+ container?: string;
18
+ debug?: boolean;
19
+ });
20
+ /**
21
+ * Applies the plugin to the compiler.
22
+ * @param {Compiler} compiler - The webpack compiler.
23
+ */
24
+ apply(compiler: Compiler): void;
25
+ /**
26
+ * Processes the modules in the chunk.
27
+ * @param {Compilation} compilation - The webpack compilation.
28
+ * @param {Chunk} chunk - The chunk to process.
29
+ * @param {Iterable<Module>} modules - The modules in the chunk.
30
+ */
31
+ private processModules;
32
+ /**
33
+ * Removes the modules from the chunk.
34
+ * @param {Compilation} compilation - The webpack compilation.
35
+ * @param {Chunk} chunk - The chunk to remove modules from.
36
+ */
37
+ private removeModules;
38
+ }
39
+ export default RemoveEagerModulesFromRuntimePlugin;
@@ -1,7 +1,2 @@
1
- import { ModuleFederationRuntimePlugin } from "@module-federation/runtime";
2
-
3
- //#region src/plugins/container/runtimePlugin.d.ts
4
- declare function export_default(): ModuleFederationRuntimePlugin;
5
- //#endregion
6
- export { export_default as default };
7
- //# sourceMappingURL=runtimePlugin.d.mts.map
1
+ import { ModuleFederationRuntimePlugin } from '@module-federation/runtime';
2
+ export default function (): ModuleFederationRuntimePlugin;
@@ -1,6 +1,2 @@
1
- import { ModuleFederationRuntimePlugin } from "@module-federation/runtime";
2
-
3
- //#region src/plugins/container/runtimePlugin.d.ts
4
- declare function export_default(): ModuleFederationRuntimePlugin;
5
- export = export_default;
6
- //# sourceMappingURL=runtimePlugin.d.ts.map
1
+ import { ModuleFederationRuntimePlugin } from '@module-federation/runtime';
2
+ export default function (): ModuleFederationRuntimePlugin;
@@ -0,0 +1,2 @@
1
+ import type { container } from 'webpack';
2
+ export type ModuleFederationPluginOptions = ConstructorParameters<typeof container.ModuleFederationPlugin>['0'];
@@ -0,0 +1,2 @@
1
+ import type { container } from 'webpack';
2
+ export type ModuleFederationPluginOptions = ConstructorParameters<typeof container.ModuleFederationPlugin>['0'];
@@ -0,0 +1,28 @@
1
+ export declare interface WatchOptions {
2
+ /**
3
+ * Delay the rebuilt after the first change. Value is a time in ms.
4
+ */
5
+ aggregateTimeout?: number;
6
+ /**
7
+ * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
8
+ */
9
+ followSymlinks?: boolean;
10
+ /**
11
+ * Ignore some files from watching (glob pattern or regexp).
12
+ */
13
+ ignored?: string | RegExp | string[];
14
+ /**
15
+ * Enable polling mode for watching.
16
+ */
17
+ poll?: number | boolean;
18
+ /**
19
+ * Stop watching when stdin stream has ended.
20
+ */
21
+ stdin?: boolean;
22
+ }
23
+ export declare interface CallbackFunction<T> {
24
+ (err?: null | Error, result?: T): any;
25
+ }
26
+ declare global {
27
+ var usedChunks: Set<string>;
28
+ }
@@ -0,0 +1,28 @@
1
+ export declare interface WatchOptions {
2
+ /**
3
+ * Delay the rebuilt after the first change. Value is a time in ms.
4
+ */
5
+ aggregateTimeout?: number;
6
+ /**
7
+ * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
8
+ */
9
+ followSymlinks?: boolean;
10
+ /**
11
+ * Ignore some files from watching (glob pattern or regexp).
12
+ */
13
+ ignored?: string | RegExp | string[];
14
+ /**
15
+ * Enable polling mode for watching.
16
+ */
17
+ poll?: number | boolean;
18
+ /**
19
+ * Stop watching when stdin stream has ended.
20
+ */
21
+ stdin?: boolean;
22
+ }
23
+ export declare interface CallbackFunction<T> {
24
+ (err?: null | Error, result?: T): any;
25
+ }
26
+ declare global {
27
+ var usedChunks: Set<string>;
28
+ }
@@ -1,6 +1,4 @@
1
- import * as React from "react";
2
-
3
- //#region utils/flushedChunks.d.ts
1
+ import * as React from 'react';
4
2
  /**
5
3
  * FlushedChunks component.
6
4
  * This component creates script and link elements for each chunk.
@@ -9,10 +7,8 @@ import * as React from "react";
9
7
  * @param {string[]} props.chunks - The chunks to be flushed.
10
8
  * @returns {React.ReactElement} The created script and link elements.
11
9
  */
12
- declare const FlushedChunks: ({
13
- chunks
14
- }: FlushedChunksProps) => React.FunctionComponentElement<{
15
- children?: React.ReactNode | undefined;
10
+ export declare const FlushedChunks: ({ chunks }: FlushedChunksProps) => React.FunctionComponentElement<{
11
+ children?: React.ReactNode | undefined;
16
12
  }>;
17
13
  /**
18
14
  * FlushedChunksProps interface.
@@ -21,9 +17,6 @@ declare const FlushedChunks: ({
21
17
  * @interface
22
18
  * @property {string[]} chunks - The chunks to be flushed.
23
19
  */
24
- interface FlushedChunksProps {
25
- chunks: string[];
20
+ export interface FlushedChunksProps {
21
+ chunks: string[];
26
22
  }
27
- //#endregion
28
- export { FlushedChunks, FlushedChunksProps };
29
- //# sourceMappingURL=flushedChunks.d.mts.map
@@ -1,6 +1,4 @@
1
- import * as React from "react";
2
-
3
- //#region utils/flushedChunks.d.ts
1
+ import * as React from 'react';
4
2
  /**
5
3
  * FlushedChunks component.
6
4
  * This component creates script and link elements for each chunk.
@@ -9,10 +7,8 @@ import * as React from "react";
9
7
  * @param {string[]} props.chunks - The chunks to be flushed.
10
8
  * @returns {React.ReactElement} The created script and link elements.
11
9
  */
12
- declare const FlushedChunks: ({
13
- chunks
14
- }: FlushedChunksProps) => React.FunctionComponentElement<{
15
- children?: React.ReactNode | undefined;
10
+ export declare const FlushedChunks: ({ chunks }: FlushedChunksProps) => React.FunctionComponentElement<{
11
+ children?: React.ReactNode | undefined;
16
12
  }>;
17
13
  /**
18
14
  * FlushedChunksProps interface.
@@ -21,9 +17,6 @@ declare const FlushedChunks: ({
21
17
  * @interface
22
18
  * @property {string[]} chunks - The chunks to be flushed.
23
19
  */
24
- interface FlushedChunksProps {
25
- chunks: string[];
20
+ export interface FlushedChunksProps {
21
+ chunks: string[];
26
22
  }
27
- //#endregion
28
- export { FlushedChunks, FlushedChunksProps };
29
- //# sourceMappingURL=flushedChunks.d.ts.map
@@ -1,14 +1,20 @@
1
- import { FlushedChunks, FlushedChunksProps } from "./flushedChunks.mjs";
2
- import { flushChunks } from "@module-federation/node/utils";
3
-
4
- //#region utils/index.d.ts
1
+ /**
2
+ * Flushes chunks from the module federation node utilities.
3
+ * @module @module-federation/node/utils
4
+ */
5
+ export { flushChunks } from '@module-federation/node/utils';
6
+ /**
7
+ * Exports the FlushedChunks component from the current directory.
8
+ */
9
+ export { FlushedChunks } from './flushedChunks';
10
+ /**
11
+ * Exports the FlushedChunksProps type from the current directory.
12
+ */
13
+ export type { FlushedChunksProps } from './flushedChunks';
5
14
  /**
6
15
  * Revalidates the current state.
7
16
  * If the function is called on the client side, it logs an error and returns a resolved promise with false.
8
17
  * If the function is called on the server side, it imports the revalidate function from the module federation node utilities and returns the result of calling that function.
9
18
  * @returns {Promise<boolean>} A promise that resolves with a boolean.
10
19
  */
11
- declare const revalidate: (fetchModule?: any, force?: boolean) => Promise<boolean>;
12
- //#endregion
13
- export { FlushedChunks, type FlushedChunksProps, flushChunks, revalidate };
14
- //# sourceMappingURL=index.d.mts.map
20
+ export declare const revalidate: (fetchModule?: any, force?: boolean) => Promise<boolean>;
@@ -1,14 +1,20 @@
1
- import { FlushedChunks, FlushedChunksProps } from "./flushedChunks.js";
2
- import { flushChunks } from "@module-federation/node/utils";
3
-
4
- //#region utils/index.d.ts
1
+ /**
2
+ * Flushes chunks from the module federation node utilities.
3
+ * @module @module-federation/node/utils
4
+ */
5
+ export { flushChunks } from '@module-federation/node/utils';
6
+ /**
7
+ * Exports the FlushedChunks component from the current directory.
8
+ */
9
+ export { FlushedChunks } from './flushedChunks';
10
+ /**
11
+ * Exports the FlushedChunksProps type from the current directory.
12
+ */
13
+ export type { FlushedChunksProps } from './flushedChunks';
5
14
  /**
6
15
  * Revalidates the current state.
7
16
  * If the function is called on the client side, it logs an error and returns a resolved promise with false.
8
17
  * If the function is called on the server side, it imports the revalidate function from the module federation node utilities and returns the result of calling that function.
9
18
  * @returns {Promise<boolean>} A promise that resolves with a boolean.
10
19
  */
11
- declare const revalidate: (fetchModule?: any, force?: boolean) => Promise<boolean>;
12
- //#endregion
13
- export { FlushedChunks, type FlushedChunksProps, flushChunks, revalidate };
14
- //# sourceMappingURL=index.d.ts.map
20
+ export declare const revalidate: (fetchModule?: any, force?: boolean) => Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/nextjs-mf",
3
- "version": "8.8.70",
3
+ "version": "8.8.72",
4
4
  "license": "MIT",
5
5
  "main": "dist/src/index.js",
6
6
  "module": "dist/src/index.mjs",
@@ -58,19 +58,19 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "fast-glob": "^3.2.11",
61
- "@module-federation/runtime": "2.7.0",
62
- "@module-federation/runtime-core": "2.7.0",
63
- "@module-federation/sdk": "2.7.0",
64
- "@module-federation/enhanced": "2.7.0",
65
- "@module-federation/node": "2.7.46",
66
- "@module-federation/webpack-bundler-runtime": "2.7.0"
61
+ "@module-federation/runtime": "2.8.1",
62
+ "@module-federation/runtime-core": "2.8.1",
63
+ "@module-federation/node": "2.7.48",
64
+ "@module-federation/webpack-bundler-runtime": "2.8.1",
65
+ "@module-federation/enhanced": "2.8.1",
66
+ "@module-federation/sdk": "2.8.1"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/btoa": "^1.2.5",
70
70
  "@types/react": "^18.3.1",
71
71
  "@types/react-dom": "^18.3.1",
72
72
  "tsdown": "0.20.3",
73
- "typescript": "6.0.3"
73
+ "typescript": "7.0.2"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "webpack": "^5.40.0",
@@ -98,7 +98,7 @@
98
98
  },
99
99
  "scripts": {
100
100
  "postinstall": "echo \"Deprecation Notice: We intend to deprecate 'nextjs-mf'. Please see https://github.com/module-federation/core/issues/3153 for more details.\"",
101
- "build": "tsdown --config tsdown.config.mts",
101
+ "build": "tsdown --config tsdown.config.mts && tsc -p tsconfig.lib.json && node ../../tools/scripts/copy-dts-to-dmts.mjs dist",
102
102
  "lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.js\" \"**/*.ts\"",
103
103
  "test": "pnpm exec jest --config jest.config.js --passWithNoTests",
104
104
  "pre-release": "pnpm run test && pnpm run build && rm -f ./dist/package.json"