zephyr-xpack-internal 0.0.0-canary-20250121101024 → 0.0.0-canary-20250122192655
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/federation-dashboard-legacy/get-build-stats.d.ts +2 -2
- package/dist/federation-dashboard-legacy/get-build-stats.js +2 -9
- package/dist/federation-dashboard-legacy/get-build-stats.js.map +1 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.d.ts +0 -33
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.js.map +1 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.d.ts +0 -18
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js +0 -18
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.js.map +1 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.d.ts +0 -25
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js +0 -25
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.js.map +1 -1
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.d.ts +0 -15
- package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js.map +1 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.d.ts +2 -47
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js +7 -59
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.js.map +1 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js +2 -19
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.js.map +1 -1
- package/dist/federation-dashboard-legacy/utils/federation-dashboard-plugin/federation-dashboard-plugin-options.d.ts +0 -2
- package/dist/index.d.ts +2 -5
- package/dist/index.js +1 -8
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -0
- package/dist/xpack-extract/create-mf-runtime-code.d.ts +1 -2
- package/dist/xpack-extract/create-mf-runtime-code.js +3 -4
- package/dist/xpack-extract/create-mf-runtime-code.js.map +1 -1
- package/dist/xpack-extract/extract-federated-dependency-pairs.js +15 -13
- package/dist/xpack-extract/extract-federated-dependency-pairs.js.map +1 -1
- package/dist/xpack-extract/index.d.ts +1 -1
- package/dist/xpack-extract/index.js +1 -2
- package/dist/xpack-extract/index.js.map +1 -1
- package/dist/xpack-extract/iterate-federation-config.d.ts +1 -1
- package/dist/xpack-extract/iterate-federation-config.js +5 -8
- package/dist/xpack-extract/iterate-federation-config.js.map +1 -1
- package/dist/xpack-extract/make-copy-of-module-federation-options.js +2 -4
- package/dist/xpack-extract/make-copy-of-module-federation-options.js.map +1 -1
- package/dist/xpack-extract/mut-webpack-federated-remotes-config.d.ts +1 -2
- package/dist/xpack-extract/mut-webpack-federated-remotes-config.js +9 -23
- package/dist/xpack-extract/mut-webpack-federated-remotes-config.js.map +1 -1
- package/dist/xpack.types.d.ts +7 -31
- package/package.json +4 -3
- package/dist/hooks/ze-setup-build-steps-logging.d.ts +0 -19
- package/dist/hooks/ze-setup-build-steps-logging.js +0 -26
- package/dist/hooks/ze-setup-build-steps-logging.js.map +0 -1
- package/dist/hooks/ze-setup-ze-deploy.d.ts +0 -33
- package/dist/hooks/ze-setup-ze-deploy.js +0 -31
- package/dist/hooks/ze-setup-ze-deploy.js.map +0 -1
- package/dist/xpack-extract/iterate-federated-remote-config.d.ts +0 -2
- package/dist/xpack-extract/iterate-federated-remote-config.js +0 -26
- package/dist/xpack-extract/iterate-federated-remote-config.js.map +0 -1
- package/dist/xpack-extract/ze-xpack-upload-agent.d.ts +0 -16
- package/dist/xpack-extract/ze-xpack-upload-agent.js +0 -42
- package/dist/xpack-extract/ze-xpack-upload-agent.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ConvertedGraph } from 'zephyr-edge-contract';
|
|
2
2
|
import { ZephyrEngine } from 'zephyr-agent';
|
|
3
3
|
import { ModuleFederationPlugin, XStats, XStatsCompilation } from '../xpack.types';
|
|
4
4
|
interface KnownAgentProps {
|
|
@@ -14,5 +14,5 @@ export declare function getBuildStats<ZephyrAgentProps extends KnownAgentProps>(
|
|
|
14
14
|
DOMAIN?: string;
|
|
15
15
|
PLATFORM?: string;
|
|
16
16
|
TYPE?: string;
|
|
17
|
-
}): Promise<
|
|
17
|
+
}): Promise<ConvertedGraph>;
|
|
18
18
|
export {};
|
|
@@ -16,11 +16,7 @@ async function getBuildStats({ stats, stats_json, pluginOptions, EDGE_URL, DOMAI
|
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
(0, zephyr_agent_1.ze_log)('process webpack graph');
|
|
19
|
-
const convertedGraph = dashboardPlugin.processWebpackGraph({
|
|
20
|
-
stats,
|
|
21
|
-
stats_json,
|
|
22
|
-
pluginOptions,
|
|
23
|
-
});
|
|
19
|
+
const convertedGraph = dashboardPlugin.processWebpackGraph({ stats, stats_json });
|
|
24
20
|
if (!convertedGraph) {
|
|
25
21
|
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_CONVERT_GRAPH_TO_DASHBOARD);
|
|
26
22
|
}
|
|
@@ -47,10 +43,7 @@ async function getBuildStats({ stats, stats_json, pluginOptions, EDGE_URL, DOMAI
|
|
|
47
43
|
context: { isCI },
|
|
48
44
|
};
|
|
49
45
|
// todo: extend data
|
|
50
|
-
const res = Object.assign({}, convertedGraph, data_overrides
|
|
51
|
-
project: name, // Add missing project property
|
|
52
|
-
tags: [], // Add missing tags property with empty array as default
|
|
53
|
-
});
|
|
46
|
+
const res = Object.assign({}, convertedGraph, data_overrides);
|
|
54
47
|
(0, zephyr_agent_1.ze_log)('get build stats done.', res);
|
|
55
48
|
return res;
|
|
56
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-build-stats.js","sourceRoot":"","sources":["../../src/federation-dashboard-legacy/get-build-stats.ts"],"names":[],"mappings":";;;AACA,6GAA0G;AAC1G,+CAA2E;AAapE,KAAK,UAAU,aAAa,CAA2C,EAC5E,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,GAML;IACC,IAAA,qBAAM,EAAC,6DAA6D,CAAC,CAAC;IACtE,MAAM,GAAG,GAAG,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAC;IAC9D,MAAM,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC;IAC1D,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC;IACjD,MAAM,eAAe,GAAG,IAAI,qDAAyB,CAAC;QACpD,GAAG;QACH,GAAG;QACH,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,CAAC;IAEH,IAAA,qBAAM,EAAC,uBAAuB,CAAC,CAAC;IAChC,MAAM,cAAc,GAAG,eAAe,CAAC,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"get-build-stats.js","sourceRoot":"","sources":["../../src/federation-dashboard-legacy/get-build-stats.ts"],"names":[],"mappings":";;;AACA,6GAA0G;AAC1G,+CAA2E;AAapE,KAAK,UAAU,aAAa,CAA2C,EAC5E,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,GAML;IACC,IAAA,qBAAM,EAAC,6DAA6D,CAAC,CAAC;IACtE,MAAM,GAAG,GAAG,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAC;IAC9D,MAAM,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC;IAC1D,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC;IACjD,MAAM,eAAe,GAAG,IAAI,qDAAyB,CAAC;Q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AI,EAAE;KAClB,CAAC;IAEF,oBAAoB;IACpB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IAC9D,IAAA,qBAAM,EAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,GAAG,CAAC;AACb,CAAC;AA/DD,sCA+DC"}
|
|
@@ -3,29 +3,11 @@ import { TopLevelPackage } from './validate-params';
|
|
|
3
3
|
import { XStatsChunk, XStatsModule } from '../../../xpack.types';
|
|
4
4
|
import { ConvertedGraph } from 'zephyr-edge-contract';
|
|
5
5
|
export interface ConvertToGraphParams {
|
|
6
|
-
/** Application name in module federation config */
|
|
7
6
|
name?: string;
|
|
8
|
-
/** Required filename in React Native actual output js.bundle */
|
|
9
|
-
filename?: string;
|
|
10
|
-
/** Key of remotes as a string of arrays */
|
|
11
7
|
remotes?: unknown;
|
|
12
|
-
/**
|
|
13
|
-
* Chunk of the remote entry,
|
|
14
|
-
*
|
|
15
|
-
* // TODO: in MF2 should it be js.bundle or mf-manifest.json?
|
|
16
|
-
*/
|
|
17
8
|
federationRemoteEntry: XStatsChunk | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Module compilation results return from getStats(), typically includes all chunks and
|
|
20
|
-
* modules needed for the build
|
|
21
|
-
*/
|
|
22
9
|
modules?: XStatsModule[];
|
|
23
|
-
/**
|
|
24
|
-
* Shared packages in package.json, an Object of Record<string, any>, could be
|
|
25
|
-
* `dependencies`, `devDependencies` or `optionalDependencies`
|
|
26
|
-
*/
|
|
27
10
|
topLevelPackage: TopLevelPackage;
|
|
28
|
-
/** PublicPath from getStats().toJson() */
|
|
29
11
|
publicPath?: string;
|
|
30
12
|
metadata: {
|
|
31
13
|
remote?: string;
|
|
@@ -34,28 +16,13 @@ export interface ConvertToGraphParams {
|
|
|
34
16
|
};
|
|
35
17
|
};
|
|
36
18
|
versionData?: never;
|
|
37
|
-
/**
|
|
38
|
-
* Either `development` or other development enviornment (`production`), default to
|
|
39
|
-
* `development` if not specified
|
|
40
|
-
*/
|
|
41
19
|
environment?: string;
|
|
42
|
-
/** Computed version based on file hash and _options.versionStrategy // */
|
|
43
20
|
version?: string;
|
|
44
|
-
/** Date.now() if not specified */
|
|
45
21
|
posted?: Date;
|
|
46
|
-
/** 'default' if not specified, not sure what it does and what it's supposed to do */
|
|
47
22
|
group?: string;
|
|
48
23
|
functionRemotes: [file: string, applicationID: string, name: string][];
|
|
49
|
-
/** Git sha */
|
|
50
24
|
sha?: string;
|
|
51
|
-
/** GetStats()'s hash */
|
|
52
25
|
buildHash?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Include referenced chunks in a remote, if the host app doesn't expose anything it
|
|
55
|
-
* will be empty
|
|
56
|
-
*/
|
|
57
26
|
chunkDependencies: unknown;
|
|
58
|
-
/** Repack specific 'ios' | 'android' | 'web' | undefined */
|
|
59
|
-
target?: 'ios' | 'android' | 'web' | undefined;
|
|
60
27
|
}
|
|
61
28
|
export declare function convertToGraph(params: ConvertToGraphParams): ConvertedGraph;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-graph.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.ts"],"names":[],"mappings":";;;AAEA,uDAAkD;AAClD,iEAA6D;AAC7D,uDAAkD;AAClD,yEAAoE;
|
|
1
|
+
{"version":3,"file":"convert-to-graph.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/convert-to-graph.ts"],"names":[],"mappings":";;;AAEA,uDAAkD;AAClD,iEAA6D;AAC7D,uDAAkD;AAClD,yEAAoE;AAgCpE,SAAgB,cAAc,CAC5B,MAA4B;AAC5B,uBAAuB;;IAEvB,MAAM,EACJ,IAAI;IACJ,yBAAyB;IACzB,OAAO,EACP,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,KAAK,EACL,eAAe,EACf,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N,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAChD,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CACrC;SACF,CAAC,CAAC;QACH,WAAW;QACX,OAAO;QACP,MAAM;QACN,KAAK;QACL,GAAG;QACH,SAAS;KACV,CAAC;AACJ,CAAC;AAxED,wCAwEC"}
|
|
@@ -12,23 +12,5 @@ interface ModulePartOneReturn {
|
|
|
12
12
|
modulesObj: Record<string, ModuleObject>;
|
|
13
13
|
npmModules: NpmModules;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* TODO: needs full rewrite Module analyzes the build statistics from Rspack to identify
|
|
17
|
-
* three key aspects of Module Federation. It calculate remote-module, container entry and
|
|
18
|
-
* node_modules
|
|
19
|
-
*
|
|
20
|
-
* 1. Remote Modules (remote-module) // TODO: this is broken needs to fix Tracks which
|
|
21
|
-
* modules are being consumed from other federated applications Maps the relationships
|
|
22
|
-
* between consuming applications and their remote dependencies Records where these
|
|
23
|
-
* remote modules are being used within the application
|
|
24
|
-
* 2. Container Entry (container entry) Processes the entry points exposed by the Module
|
|
25
|
-
* Federation container Creates a mapping of exposed modules and their file locations
|
|
26
|
-
* 3. Node Modules (node_modules) Collects information about third-party dependencies Gathers
|
|
27
|
-
* metadata like package versions, licenses, and sizes Helps track shared dependencies
|
|
28
|
-
* between federated applications
|
|
29
|
-
*
|
|
30
|
-
* @param modules - The stats object from @rspack/core to parse.
|
|
31
|
-
* @returns An object containing the consumes, modulesObj, and npmModules.
|
|
32
|
-
*/
|
|
33
15
|
export declare function modulePartOne(modules: XStatsModule[] | undefined): ModulePartOneReturn;
|
|
34
16
|
export {};
|
|
@@ -7,24 +7,6 @@ const get_licenses_1 = require("./get-licenses");
|
|
|
7
7
|
function isString(value) {
|
|
8
8
|
return typeof value === 'string';
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* TODO: needs full rewrite Module analyzes the build statistics from Rspack to identify
|
|
12
|
-
* three key aspects of Module Federation. It calculate remote-module, container entry and
|
|
13
|
-
* node_modules
|
|
14
|
-
*
|
|
15
|
-
* 1. Remote Modules (remote-module) // TODO: this is broken needs to fix Tracks which
|
|
16
|
-
* modules are being consumed from other federated applications Maps the relationships
|
|
17
|
-
* between consuming applications and their remote dependencies Records where these
|
|
18
|
-
* remote modules are being used within the application
|
|
19
|
-
* 2. Container Entry (container entry) Processes the entry points exposed by the Module
|
|
20
|
-
* Federation container Creates a mapping of exposed modules and their file locations
|
|
21
|
-
* 3. Node Modules (node_modules) Collects information about third-party dependencies Gathers
|
|
22
|
-
* metadata like package versions, licenses, and sizes Helps track shared dependencies
|
|
23
|
-
* between federated applications
|
|
24
|
-
*
|
|
25
|
-
* @param modules - The stats object from @rspack/core to parse.
|
|
26
|
-
* @returns An object containing the consumes, modulesObj, and npmModules.
|
|
27
|
-
*/
|
|
28
10
|
function modulePartOne(modules) {
|
|
29
11
|
const consumes = [];
|
|
30
12
|
const consumesByName = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-part-one.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,qCAAuC;AACvC,iDAA6C;AAoB7C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"module-part-one.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/module-part-one.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,qCAAuC;AACvC,iDAA6C;AAoB7C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,SAAgB,aAAa,CAAC,OAAmC;IAC/D,MAAM,QA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AAI,CAAC;oBAC9C,CAAC;oBACD,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;gBACpD,CAAC;qBAAM,CAAC;oBACN,MAAM,MAAM,GAAG;wBACb,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;4BACrB,IAAI,EAAE,WAAW,CAAC,IAAI;4BACtB,OAAO,EAAE,WAAW,CAAC,OAAO;4BAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;4BAC9B,OAAO,EAAE,IAAA,0BAAW,EAAC,WAAW,CAAC;4BACjC,IAAI;yBACL;qBACF,CAAC;oBACF,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAC9C,CAAC;AAtHD,sCAsHC;AAED,SAAS,2BAA2B,CAAC,SAAiB;IACpD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAqB,CAAC;IACxF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;AACH,CAAC"}
|
|
@@ -23,30 +23,5 @@ export interface Overrides {
|
|
|
23
23
|
interface ModulePartTwoReturn {
|
|
24
24
|
overrides: Record<string, unknown>;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
27
|
-
* TODO: needs full rewrite Analyzing shared dependencies and module overrides
|
|
28
|
-
*
|
|
29
|
-
* 1. Shared Module Analysis
|
|
30
|
-
*
|
|
31
|
-
* - Processes provide-module types (modules that are shared with other applications) //
|
|
32
|
-
* TODO: this is wrong and doesn't apply to Rspack - need to fix
|
|
33
|
-
* - Handles consume-shared-module types (modules that are consumed from the shared scope)
|
|
34
|
-
* // TODO: this is wrong and doesn't apply to Rspack
|
|
35
|
-
*
|
|
36
|
-
* - Need to fix
|
|
37
|
-
* - Builds dependency graphs between modules
|
|
38
|
-
*
|
|
39
|
-
* 2. Version Management
|
|
40
|
-
*
|
|
41
|
-
* - Tracks specific versions of shared dependencies
|
|
42
|
-
* - Handles version resolution for shared modules Creates override configurations for
|
|
43
|
-
* specific package versions
|
|
44
|
-
*
|
|
45
|
-
* @param name: Name of the federated app
|
|
46
|
-
* @param modules: Modules from the build stats
|
|
47
|
-
* @param modulesObj: Processed module objects
|
|
48
|
-
* @param convertedDeps: Converted dependencies
|
|
49
|
-
* @returns Overrides: Record<string, unknown>
|
|
50
|
-
*/
|
|
51
26
|
export declare function modulePartTwo(params: ModulePartTwoParams): ModulePartTwoReturn;
|
|
52
27
|
export {};
|
|
@@ -1,31 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.modulePartTwo = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* TODO: needs full rewrite Analyzing shared dependencies and module overrides
|
|
6
|
-
*
|
|
7
|
-
* 1. Shared Module Analysis
|
|
8
|
-
*
|
|
9
|
-
* - Processes provide-module types (modules that are shared with other applications) //
|
|
10
|
-
* TODO: this is wrong and doesn't apply to Rspack - need to fix
|
|
11
|
-
* - Handles consume-shared-module types (modules that are consumed from the shared scope)
|
|
12
|
-
* // TODO: this is wrong and doesn't apply to Rspack
|
|
13
|
-
*
|
|
14
|
-
* - Need to fix
|
|
15
|
-
* - Builds dependency graphs between modules
|
|
16
|
-
*
|
|
17
|
-
* 2. Version Management
|
|
18
|
-
*
|
|
19
|
-
* - Tracks specific versions of shared dependencies
|
|
20
|
-
* - Handles version resolution for shared modules Creates override configurations for
|
|
21
|
-
* specific package versions
|
|
22
|
-
*
|
|
23
|
-
* @param name: Name of the federated app
|
|
24
|
-
* @param modules: Modules from the build stats
|
|
25
|
-
* @param modulesObj: Processed module objects
|
|
26
|
-
* @param convertedDeps: Converted dependencies
|
|
27
|
-
* @returns Overrides: Record<string, unknown>
|
|
28
|
-
*/
|
|
29
4
|
function modulePartTwo(params) {
|
|
30
5
|
const { name, modules, modulesObj, convertedDeps } = params;
|
|
31
6
|
const overrides = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-part-two.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.ts"],"names":[],"mappings":";;;AA+BA
|
|
1
|
+
{"version":3,"file":"module-part-two.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/module-part-two.ts"],"names":[],"mappings":";;;AA+BA,SAAgB,aAAa,CAAC,MAA2B;IACvD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAC5D,MAAM,SAAS,GAAG,EAA+B,CAAC;IAElD,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACvB,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;QAE5D,IAAI,IAAI,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,UAAU,KAAK,gBAAgB,IAAI,IAAI,EAAE,CAAC;YAC5C,IAAI,UAAU,EAAE,CAAC;gBACf,iBAAiB;gBACjB,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC/D,IACE,UAAU,CAAC,wBAAwB,CAAC;oBACpC,UAAU,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EACrE,CAAC;oBACD,UAAU,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9D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,IAAI,IAAI,EAAE,CAAC;YACjB,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG;gBACnB,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;gBACX,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;gBACb,OAAO;gBACP,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;gBACjB,aAAa,EAAE,IAAI;aACpB,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC;AAjID,sCAiIC"}
|
package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
import { Consume } from './module-part-one';
|
|
2
|
-
/**
|
|
3
|
-
* This function processes dynamic remote module imports in a Module Federation setup. It
|
|
4
|
-
* tracks which files in the application consume (import) remote modules from other
|
|
5
|
-
* federated applications.
|
|
6
|
-
*
|
|
7
|
-
* For example, if app1 dynamically imports Button from app2 like: const Button = await
|
|
8
|
-
* import('app2/Button')
|
|
9
|
-
*
|
|
10
|
-
* This would be tracked as:
|
|
11
|
-
*
|
|
12
|
-
* - ApplicationID: 'app2'
|
|
13
|
-
* - Name: 'Button'
|
|
14
|
-
* - ConsumingApplicationID: 'Button'
|
|
15
|
-
* - UsedIn: Set of files in app1 that import Button
|
|
16
|
-
*/
|
|
17
2
|
interface ProcessFunctionRemoteParams {
|
|
18
3
|
functionRemotes: [file: string, applicationID: string, name: string][];
|
|
19
4
|
consumes: Consume[];
|
package/dist/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-function-remotes.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/convert-to-graph/process-function-remotes.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"process-function-remotes.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-leg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AS,CAAC,CAAC;SAC7B,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAA6B,CAC9B,CACF,CAAC;IACF,QAAQ,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;IAElC,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtB,CAAC;AAxCD,wDAwCC"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { ConvertedGraph, ZeUploadBuildStats } from 'zephyr-edge-contract';
|
|
2
|
-
import { ZephyrEngine } from 'zephyr-agent';
|
|
3
2
|
import { TopLevelPackage } from '../convert-to-graph/validate-params';
|
|
4
3
|
import { FederationDashboardPluginOptions } from './federation-dashboard-plugin-options';
|
|
5
4
|
import { Exposes } from './federation-dashboard-types';
|
|
6
|
-
import { XChunk, XCompiler, XStats, XStatsChunk, XStatsCompilation
|
|
5
|
+
import { XChunk, XCompiler, XStats, XStatsChunk, XStatsCompilation } from '../../../xpack.types';
|
|
7
6
|
interface ProcessWebpackGraphParams {
|
|
8
7
|
stats: XStats;
|
|
9
8
|
stats_json: XStatsCompilation;
|
|
10
|
-
pluginOptions: {
|
|
11
|
-
zephyr_engine: ZephyrEngine;
|
|
12
|
-
mfConfig: ModuleFederationPlugin[] | ModuleFederationPlugin | undefined;
|
|
13
|
-
upload_file?: boolean;
|
|
14
|
-
target?: 'ios' | 'android' | 'web' | undefined;
|
|
15
|
-
};
|
|
16
9
|
}
|
|
17
10
|
export declare class FederationDashboardPlugin {
|
|
18
11
|
_options: FederationDashboardPluginOptions;
|
|
@@ -21,55 +14,17 @@ export declare class FederationDashboardPlugin {
|
|
|
21
14
|
FederationPluginOptions: {
|
|
22
15
|
name?: string;
|
|
23
16
|
remotes?: unknown;
|
|
24
|
-
/**
|
|
25
|
-
* **bundle_name**: This is a placeholder option since Repack is fast iterating on
|
|
26
|
-
* Module Federation, right now they are consuming JS bundle and ignore
|
|
27
|
-
* mf-manifest.json, but if it comes back this field will be needed to understand what
|
|
28
|
-
* bundle name to look for in mf-manifest.json, Available in
|
|
29
|
-
* ApplicationVersion.metadata.
|
|
30
|
-
*/
|
|
31
|
-
bundle_name?: string;
|
|
32
|
-
filename?: string;
|
|
33
17
|
exposes?: Exposes;
|
|
34
18
|
};
|
|
35
19
|
constructor(options: Partial<FederationDashboardPluginOptions>);
|
|
36
20
|
/** @param {Compiler} compiler */
|
|
37
21
|
apply(compiler: XCompiler): void;
|
|
38
|
-
processWebpackGraph({ stats, stats_json,
|
|
22
|
+
processWebpackGraph({ stats, stats_json, }: ProcessWebpackGraphParams): ConvertedGraph | undefined;
|
|
39
23
|
getRemoteEntryChunk(stats: XStatsCompilation, FederationPluginOptions: typeof this.FederationPluginOptions): XStatsChunk | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* TODO: needs a full rewrite because `_group` no longer exists in both Rspack and
|
|
42
|
-
* Webpack
|
|
43
|
-
*
|
|
44
|
-
* Return { "main": [{...dep1Details}, {...dep2Details}], "vendor": [{...dep3Details}],
|
|
45
|
-
*
|
|
46
|
-
* 1. Useful for dynamic imports - object generated could inform the bundler or runtime
|
|
47
|
-
* loader about which chunks are needed for specific part of the app, enabling better
|
|
48
|
-
* performance optimization 1.1 if a chunk representing a React component dynamically
|
|
49
|
-
* loads, this dependency graph can help the runtime understand what other chunks
|
|
50
|
-
* need to be loaded alongside it.
|
|
51
|
-
* 2. Optimized loading and caching: By mapping chunk dependencies, this function supports
|
|
52
|
-
* advanced optimizations like caching. Chunks that haven’t changed between builds
|
|
53
|
-
* can be cached separately, reducing the need for users to download unchanged code.
|
|
54
|
-
*
|
|
55
|
-
* }
|
|
56
|
-
*/
|
|
57
24
|
getChunkDependencies(validChunkArray: XChunk[]): Record<string, never>;
|
|
58
25
|
buildVendorFederationMap(liveStats: XStats): TopLevelPackage;
|
|
59
26
|
mapToObjectRec(m: Record<string, XChunk[keyof XChunk]> | Map<string, XChunk[keyof XChunk]> | XChunk[keyof XChunk][]): Record<string, unknown>;
|
|
60
|
-
/**
|
|
61
|
-
* In a remote application, this function is used to find all the chunks that are
|
|
62
|
-
* referenced by the remote entry chunk It won't return anything from HostApp
|
|
63
|
-
*/
|
|
64
27
|
buildValidChunkArray(liveStats: XStats, FederationPluginOptions: typeof this.FederationPluginOptions): XChunk[];
|
|
65
|
-
/**
|
|
66
|
-
* We are doing this because the filename in React Native is the actual JS bundle, "How
|
|
67
|
-
* we understand the filename is different in react native" - filename would be at the
|
|
68
|
-
* end of the URL modified in get_mf_config.ts If we don't attach the remote bundle name
|
|
69
|
-
* to metadata, we will have no track record of the actual bundle when we need it later
|
|
70
|
-
* -- this is RePack specific.
|
|
71
|
-
*/
|
|
72
|
-
attach_remote_bundle_name_to_metadata(): Record<string, string> | undefined;
|
|
73
28
|
postDashboardData(dashData: any): Promise<{
|
|
74
29
|
value: ZeUploadBuildStats;
|
|
75
30
|
} | undefined>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FederationDashboardPlugin = void 0;
|
|
4
4
|
const node_path_1 = require("node:path");
|
|
5
|
-
const zephyr_agent_1 = require("zephyr-agent");
|
|
6
5
|
const convert_to_graph_1 = require("../convert-to-graph/convert-to-graph");
|
|
7
6
|
const find_package_json_1 = require("./find-package-json");
|
|
8
7
|
const compute_version_strategy_1 = require("./compute-version-strategy");
|
|
@@ -165,7 +164,7 @@ class FederationDashboardPlugin {
|
|
|
165
164
|
this.allArgumentsUsed = Object.values(uniqueArgs);
|
|
166
165
|
if (callback) callback();
|
|
167
166
|
}*/
|
|
168
|
-
processWebpackGraph({ stats, stats_json,
|
|
167
|
+
processWebpackGraph({ stats, stats_json, }) {
|
|
169
168
|
// async processWebpackGraph(/*curCompiler: Compilation*/): Promise<unknown> {
|
|
170
169
|
// const stats = curCompiler.getStats();
|
|
171
170
|
// const stats_json = stats.toJson();
|
|
@@ -173,36 +172,27 @@ class FederationDashboardPlugin {
|
|
|
173
172
|
// this.parseModuleAst(curCompiler);
|
|
174
173
|
// }
|
|
175
174
|
// fs.writeFileSync('stats.json', JSON.stringify(stats, null, 2))
|
|
176
|
-
this.FederationPluginOptions = Object.assign({}, this.FederationPluginOptions, pluginOptions.mfConfig);
|
|
177
175
|
// get RemoteEntryChunk
|
|
178
176
|
const RemoteEntryChunk = this.getRemoteEntryChunk(stats_json, this.FederationPluginOptions);
|
|
179
177
|
const validChunkArray = this.buildValidChunkArray(stats, this.FederationPluginOptions);
|
|
180
178
|
const chunkDependencies = this.getChunkDependencies(validChunkArray);
|
|
181
179
|
const vendorFederation = this.buildVendorFederationMap(stats);
|
|
182
|
-
// TODO: this type casting might not be every compilation result from rspack, but it's fine for now
|
|
183
|
-
const getPlatformFromStats = stats.compilation
|
|
184
|
-
.name;
|
|
185
|
-
const remotes = this.FederationPluginOptions?.remotes
|
|
186
|
-
? Object.keys(this.FederationPluginOptions.remotes)
|
|
187
|
-
: {};
|
|
188
180
|
const rawData = {
|
|
189
181
|
name: this.FederationPluginOptions?.name,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
metadata: Object.assign({}, this._options.metadata, this.attach_remote_bundle_name_to_metadata()) || {},
|
|
182
|
+
remotes: Object.keys(this.FederationPluginOptions?.remotes || {}),
|
|
183
|
+
metadata: this._options.metadata || {},
|
|
193
184
|
topLevelPackage: vendorFederation || {},
|
|
194
185
|
publicPath: stats_json.publicPath,
|
|
195
186
|
federationRemoteEntry: RemoteEntryChunk,
|
|
196
187
|
buildHash: stats_json.hash,
|
|
197
|
-
environment: this._options.environment
|
|
188
|
+
environment: this._options.environment, // 'development' if not specified
|
|
198
189
|
version: (0, compute_version_strategy_1.computeVersionStrategy)(stats_json, this._options.versionStrategy),
|
|
199
|
-
posted: this._options.posted
|
|
200
|
-
group: this._options.group
|
|
190
|
+
posted: this._options.posted, // Date.now() if not specified
|
|
191
|
+
group: this._options.group, // 'default' if not specified
|
|
201
192
|
sha: compute_version_strategy_1.gitSha,
|
|
202
193
|
modules: stats_json.modules,
|
|
203
194
|
chunkDependencies,
|
|
204
195
|
functionRemotes: this.allArgumentsUsed,
|
|
205
|
-
target: pluginOptions.target || getPlatformFromStats,
|
|
206
196
|
};
|
|
207
197
|
let graphData;
|
|
208
198
|
try {
|
|
@@ -307,30 +297,11 @@ class FederationDashboardPlugin {
|
|
|
307
297
|
}
|
|
308
298
|
});*/
|
|
309
299
|
}
|
|
310
|
-
// TODO: add notes on why we need these and what does these do
|
|
311
300
|
getRemoteEntryChunk(stats, FederationPluginOptions) {
|
|
312
301
|
if (!stats.chunks)
|
|
313
302
|
return;
|
|
314
|
-
// TODO: print all chunk name and see if it has the bundle name or actual remote name. in Rspack this field would return in remote application but won't return in host application due to Rspack's data structure - need external PR to fix
|
|
315
303
|
return stats.chunks.find((chunk) => chunk.names?.find((name) => name === FederationPluginOptions.name));
|
|
316
304
|
}
|
|
317
|
-
/**
|
|
318
|
-
* TODO: needs a full rewrite because `_group` no longer exists in both Rspack and
|
|
319
|
-
* Webpack
|
|
320
|
-
*
|
|
321
|
-
* Return { "main": [{...dep1Details}, {...dep2Details}], "vendor": [{...dep3Details}],
|
|
322
|
-
*
|
|
323
|
-
* 1. Useful for dynamic imports - object generated could inform the bundler or runtime
|
|
324
|
-
* loader about which chunks are needed for specific part of the app, enabling better
|
|
325
|
-
* performance optimization 1.1 if a chunk representing a React component dynamically
|
|
326
|
-
* loads, this dependency graph can help the runtime understand what other chunks
|
|
327
|
-
* need to be loaded alongside it.
|
|
328
|
-
* 2. Optimized loading and caching: By mapping chunk dependencies, this function supports
|
|
329
|
-
* advanced optimizations like caching. Chunks that haven’t changed between builds
|
|
330
|
-
* can be cached separately, reducing the need for users to download unchanged code.
|
|
331
|
-
*
|
|
332
|
-
* }
|
|
333
|
-
*/
|
|
334
305
|
getChunkDependencies(validChunkArray) {
|
|
335
306
|
return validChunkArray.reduce((acc, chunk) => {
|
|
336
307
|
const subset = chunk.getAllReferencedChunks();
|
|
@@ -348,7 +319,6 @@ class FederationDashboardPlugin {
|
|
|
348
319
|
}, {});
|
|
349
320
|
}
|
|
350
321
|
buildVendorFederationMap(liveStats) {
|
|
351
|
-
// calling it "vendor", it's actually npm dependencies
|
|
352
322
|
const vendorFederation = {};
|
|
353
323
|
let packageJson;
|
|
354
324
|
if (this._options.packageJsonPath) {
|
|
@@ -387,7 +357,6 @@ class FederationDashboardPlugin {
|
|
|
387
357
|
}
|
|
388
358
|
return vendorFederation;
|
|
389
359
|
}
|
|
390
|
-
// Clean up the Chunks to a clear object with keys
|
|
391
360
|
mapToObjectRec(m) {
|
|
392
361
|
const lo = {};
|
|
393
362
|
for (const [key, value] of Object.entries(m)) {
|
|
@@ -403,10 +372,6 @@ class FederationDashboardPlugin {
|
|
|
403
372
|
}
|
|
404
373
|
return lo;
|
|
405
374
|
}
|
|
406
|
-
/**
|
|
407
|
-
* In a remote application, this function is used to find all the chunks that are
|
|
408
|
-
* referenced by the remote entry chunk It won't return anything from HostApp
|
|
409
|
-
*/
|
|
410
375
|
buildValidChunkArray(liveStats, FederationPluginOptions) {
|
|
411
376
|
if (!FederationPluginOptions.name)
|
|
412
377
|
return [];
|
|
@@ -444,25 +409,8 @@ class FederationDashboardPlugin {
|
|
|
444
409
|
|
|
445
410
|
return Array.from(directReasons);
|
|
446
411
|
}*/
|
|
447
|
-
/**
|
|
448
|
-
* We are doing this because the filename in React Native is the actual JS bundle, "How
|
|
449
|
-
* we understand the filename is different in react native" - filename would be at the
|
|
450
|
-
* end of the URL modified in get_mf_config.ts If we don't attach the remote bundle name
|
|
451
|
-
* to metadata, we will have no track record of the actual bundle when we need it later
|
|
452
|
-
* -- this is RePack specific.
|
|
453
|
-
*/
|
|
454
|
-
attach_remote_bundle_name_to_metadata() {
|
|
455
|
-
if (!this.FederationPluginOptions.exposes) {
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
// TODO: not sure if this error would break the build. Silently log it for now
|
|
459
|
-
if (!this.FederationPluginOptions.bundle_name) {
|
|
460
|
-
console.warn(zephyr_agent_1.ZeErrors.ERR_MF_CONFIG_MISSING_FILENAME);
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
return { remote_bundle_name: this.FederationPluginOptions.bundle_name };
|
|
464
|
-
}
|
|
465
412
|
async postDashboardData(dashData) {
|
|
413
|
+
console.log(dashData);
|
|
466
414
|
throw new Error('not implemented, override it');
|
|
467
415
|
}
|
|
468
416
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederationDashboardPlugin.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;
|
|
1
|
+
{"version":3,"file":"FederationDashboardPlugin.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/FederationDashboardPlugin.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAIhC,2EAG8C;AAE9C,2DAAsD;AACtD,yEAA4E;AAE5E,+GAAuG;AAEvG,oGAA8F;AAS9F,wCAAwC;AACxC,8DAA8D;AAC9D,MAAM,yBAAyB,GAAG,OAAO,CAAC,gDAAgD,CAAC,CAAC;AAO5F,MAAa,yBAAyB;IAYpC,mDAAmD;IACnD,YAAY,OAAkD;QAV9D,qBAAgB,GAA0D,EAAE,CAAC;QAE7E,4BAAuB,GAKnB,EAAE,CAAC;QAIL,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAC3B;YACE,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,KAAK;SACd,EACD,OAAO,CAC4B,CAAC;IACxC,CAAC;IAED,iCAAiC;IACjC,KAAK,CAAC,QAAmB;QACvB,+CAA+C;QAC/C,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QAEtD,IAAI,oFAAsC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE7D,MAAM,gBAAgB,GAAG,QAA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I,KAAK,CAAC,EAAE,KAAK,uBAAuB,CAAC,IAAI,EAAE,CAAC;gBAC9C,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,eAAe,CAAC;IACzB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IAEH,KAAK,CAAC,iBAAiB,CAAC,QAAa;QAMnC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;CACF;AA/dD,8DA+dC"}
|
|
@@ -4,31 +4,14 @@ exports.AddRuntimeRequirementToPromiseExternal = void 0;
|
|
|
4
4
|
class AddRuntimeRequirementToPromiseExternal {
|
|
5
5
|
apply(compiler) {
|
|
6
6
|
compiler.hooks.compilation.tap('AddRuntimeRequirementToPromiseExternal', (compilation) => {
|
|
7
|
-
// TODO: access runtime global
|
|
8
7
|
const { RuntimeGlobals } = compiler.webpack;
|
|
9
|
-
// compilation.outputOptions.trustedTypes are used in browser environment to ensure XSS attack, this won't be useful in React Native
|
|
10
|
-
// reference: https://github.com/web-infra-dev/rspack/blob/52d7dcd48df764674f50e65b51297a7a697c15e7/packages/rspack/src/config/types.ts#L306
|
|
11
8
|
if (compilation.outputOptions.trustedTypes) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
compilation.hooks.additionalModuleRuntimeRequirements.tap('AddRuntimeRequirementToPromiseExternal', (module, set) => {
|
|
15
|
-
if (module.externalType === 'promise') {
|
|
16
|
-
set.add(RuntimeGlobals.loadScript);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
// This is for Rspack (include Repack)
|
|
21
|
-
compilation.hooks.additionalTreeRuntimeRequirements.tap('AddRuntimeRequirementToPromiseExternal', (chunk, set) => {
|
|
22
|
-
if (chunk.externalType === 'promise') {
|
|
9
|
+
compilation.hooks.additionalModuleRuntimeRequirements.tap('AddRuntimeRequirementToPromiseExternal', (module, set) => {
|
|
10
|
+
if (module.externalType === 'promise') {
|
|
23
11
|
set.add(RuntimeGlobals.loadScript);
|
|
24
12
|
}
|
|
25
13
|
});
|
|
26
14
|
}
|
|
27
|
-
// even if `trustedTypes` don't exists, there isn't an external type, load the script anyways
|
|
28
|
-
// TODO: verify if this works
|
|
29
|
-
compilation.hooks.additionalTreeRuntimeRequirements.tap('AddRuntimeRequirementToPromiseExternal', (chunk, set) => {
|
|
30
|
-
set.add(RuntimeGlobals.loadScript);
|
|
31
|
-
});
|
|
32
15
|
});
|
|
33
16
|
}
|
|
34
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-runtime-requirement-to-promise-external.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.ts"],"names":[],"mappings":";;;AAEA,MAAa,sCAAsC;IACjD,KAAK,CAAC,QAAmB;QACvB,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAC5B,wCAAwC,EACxC,CAAC,WAAyB,EAAE,EAAE;YAC5B,
|
|
1
|
+
{"version":3,"file":"add-runtime-requirement-to-promise-external.js","sourceRoot":"","sources":["../../../../src/federation-dashboard-legacy/utils/federation-dashboard-plugin/add-runtime-requirement-to-promise-external.ts"],"names":[],"mappings":";;;AAEA,MAAa,sCAAsC;IACjD,KAAK,CAAC,QAAmB;QACvB,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAC5B,wCAAwC,EACxC,CAAC,WAAyB,EAAE,EAAE;YAC5B,MAAM,EAAE,cAAc,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;YAC5C,IAAI,WAAW,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;gBAC3C,WAAW,CAAC,KAAK,CAAC,mCAAmC,CAAC,GAAG,CACvD,wCAAwC,EACxC,CAAC,MAA2C,EAAE,GAAG,EAAE,EAAE;oBACnD,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;wBACtC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;oBACrC,CAAC;gBACH,CAAC,CACF,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAnBD,wFAmBC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export { onDeploymentDone, emitDeploymentDone } from './lifecycle-events';
|
|
2
2
|
export { isModuleFederationPlugin } from './xpack-extract/is-module-federation-plugin';
|
|
3
|
-
export { extractFederatedDependencyPairs, makeCopyOfModuleFederationOptions, mutWebpackFederatedRemotesConfig,
|
|
3
|
+
export { extractFederatedDependencyPairs, makeCopyOfModuleFederationOptions, mutWebpackFederatedRemotesConfig, } from './xpack-extract';
|
|
4
4
|
export { buildWebpackAssetMap } from './xpack-extract/build-webpack-assets-map';
|
|
5
|
-
export type { XPackConfiguration, ModuleFederationPlugin
|
|
5
|
+
export type { XPackConfiguration, ModuleFederationPlugin } from './xpack.types';
|
|
6
6
|
export { getBuildStats } from './federation-dashboard-legacy/get-build-stats';
|
|
7
|
-
export { setupZeDeploy } from './hooks/ze-setup-ze-deploy';
|
|
8
|
-
export { logBuildSteps } from './hooks/ze-setup-build-steps-logging';
|
|
9
|
-
export { xpack_zephyr_agent } from './xpack-extract/ze-xpack-upload-agent';
|