@rspack/core 0.6.2-canary-796c734-20240418055822 → 0.6.2-canary-5e6c853-20240418111828
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/container/ModuleFederationPlugin.js +0 -2
- package/dist/container/default.runtime.js +14 -18
- package/dist/exports.d.ts +2 -2
- package/dist/exports.js +24 -1
- package/dist/loader-runner/index.js +3 -3
- package/dist/loader-runner/loadLoader.js +2 -4
- package/package.json +4 -4
- package/dist/container/FederationRuntimePlugin.d.ts +0 -10
- package/dist/container/FederationRuntimePlugin.js +0 -6
|
@@ -4,7 +4,6 @@ exports.ModuleFederationPlugin = void 0;
|
|
|
4
4
|
const config_1 = require("../config");
|
|
5
5
|
const options_1 = require("./options");
|
|
6
6
|
const validate_1 = require("../util/validate");
|
|
7
|
-
const FederationRuntimePlugin_1 = require("./FederationRuntimePlugin");
|
|
8
7
|
class ModuleFederationPlugin {
|
|
9
8
|
constructor(_options) {
|
|
10
9
|
this._options = _options;
|
|
@@ -20,7 +19,6 @@ class ModuleFederationPlugin {
|
|
|
20
19
|
compiler.hooks.afterPlugins.tap(ModuleFederationPlugin.name, () => {
|
|
21
20
|
new webpack.EntryPlugin(compiler.context, getDefaultEntryRuntime(paths, this._options, compiler), { name: undefined }).apply(compiler);
|
|
22
21
|
});
|
|
23
|
-
new FederationRuntimePlugin_1.FederationRuntimePlugin().apply(compiler);
|
|
24
22
|
new webpack.container.ModuleFederationPluginV1({
|
|
25
23
|
...this._options,
|
|
26
24
|
enhanced: true
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
var __module_federation_bundler_runtime__, __module_federation_runtime_plugins__, __module_federation_remote_infos__, __module_federation_container_name__;
|
|
4
4
|
module.exports = function () {
|
|
5
5
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
6
|
-
if (
|
|
7
|
-
__webpack_require__.initializeExposesData)
|
|
8
|
-
__webpack_require__.federation) {
|
|
6
|
+
if (__webpack_require__.initializeSharingData ||
|
|
7
|
+
__webpack_require__.initializeExposesData) {
|
|
9
8
|
const override = (obj, key, value) => {
|
|
10
9
|
if (!obj)
|
|
11
10
|
return;
|
|
@@ -37,10 +36,7 @@ module.exports = function () {
|
|
|
37
36
|
const initializeSharingInitPromises = [];
|
|
38
37
|
const initializeSharingInitTokens = [];
|
|
39
38
|
const containerShareScope = (_l = __webpack_require__.initializeExposesData) === null || _l === void 0 ? void 0 : _l.shareScope;
|
|
40
|
-
|
|
41
|
-
__webpack_require__.federation[key] =
|
|
42
|
-
__module_federation_bundler_runtime__[key];
|
|
43
|
-
}
|
|
39
|
+
early(__webpack_require__, "federation", () => __module_federation_bundler_runtime__);
|
|
44
40
|
early(__webpack_require__.federation, "consumesLoadingModuleToHandlerMapping", () => {
|
|
45
41
|
const consumesLoadingModuleToHandlerMapping = {};
|
|
46
42
|
for (let [moduleId, data] of Object.entries(consumesLoadingModuleToConsumeDataMapping)) {
|
|
@@ -110,11 +106,11 @@ module.exports = function () {
|
|
|
110
106
|
}
|
|
111
107
|
return idToRemoteMap;
|
|
112
108
|
});
|
|
113
|
-
override(__webpack_require__, "S",
|
|
114
|
-
if (
|
|
115
|
-
|
|
109
|
+
override(__webpack_require__, "S", __module_federation_bundler_runtime__.bundlerRuntime.S);
|
|
110
|
+
if (__module_federation_bundler_runtime__.attachShareScopeMap) {
|
|
111
|
+
__module_federation_bundler_runtime__.attachShareScopeMap(__webpack_require__);
|
|
116
112
|
}
|
|
117
|
-
override(__webpack_require__.f, "remotes", (chunkId, promises) =>
|
|
113
|
+
override(__webpack_require__.f, "remotes", (chunkId, promises) => __module_federation_bundler_runtime__.bundlerRuntime.remotes({
|
|
118
114
|
chunkId,
|
|
119
115
|
promises,
|
|
120
116
|
chunkMapping: remotesLoadingChunkMapping,
|
|
@@ -124,7 +120,7 @@ module.exports = function () {
|
|
|
124
120
|
.idToRemoteMap,
|
|
125
121
|
webpackRequire: __webpack_require__
|
|
126
122
|
}));
|
|
127
|
-
override(__webpack_require__.f, "consumes", (chunkId, promises) =>
|
|
123
|
+
override(__webpack_require__.f, "consumes", (chunkId, promises) => __module_federation_bundler_runtime__.bundlerRuntime.consumes({
|
|
128
124
|
chunkId,
|
|
129
125
|
promises,
|
|
130
126
|
chunkMapping: consumesLoadingChunkMapping,
|
|
@@ -132,14 +128,14 @@ module.exports = function () {
|
|
|
132
128
|
installedModules: consumesLoadinginstalledModules,
|
|
133
129
|
webpackRequire: __webpack_require__
|
|
134
130
|
}));
|
|
135
|
-
override(__webpack_require__, "I", (name, initScope) =>
|
|
131
|
+
override(__webpack_require__, "I", (name, initScope) => __module_federation_bundler_runtime__.bundlerRuntime.I({
|
|
136
132
|
shareScopeName: name,
|
|
137
133
|
initScope,
|
|
138
134
|
initPromises: initializeSharingInitPromises,
|
|
139
135
|
initTokens: initializeSharingInitTokens,
|
|
140
136
|
webpackRequire: __webpack_require__
|
|
141
137
|
}));
|
|
142
|
-
override(__webpack_require__, "initContainer", (shareScope, initScope, remoteEntryInitOptions) =>
|
|
138
|
+
override(__webpack_require__, "initContainer", (shareScope, initScope, remoteEntryInitOptions) => __module_federation_bundler_runtime__.bundlerRuntime.initContainerEntry({
|
|
143
139
|
shareScope,
|
|
144
140
|
initScope,
|
|
145
141
|
remoteEntryInitOptions,
|
|
@@ -157,14 +153,14 @@ module.exports = function () {
|
|
|
157
153
|
__webpack_require__.R = undefined;
|
|
158
154
|
return getScope;
|
|
159
155
|
});
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
__module_federation_bundler_runtime__.instance =
|
|
157
|
+
__module_federation_bundler_runtime__.runtime.init(__module_federation_bundler_runtime__.initOptions);
|
|
162
158
|
if ((_m = __webpack_require__.consumesLoadingData) === null || _m === void 0 ? void 0 : _m.initialConsumes) {
|
|
163
|
-
|
|
159
|
+
__module_federation_bundler_runtime__.bundlerRuntime.installInitialConsumes({
|
|
164
160
|
webpackRequire: __webpack_require__,
|
|
165
161
|
installedModules: consumesLoadinginstalledModules,
|
|
166
162
|
initialConsumes: __webpack_require__.consumesLoadingData.initialConsumes,
|
|
167
|
-
moduleToHandlerMapping:
|
|
163
|
+
moduleToHandlerMapping: __module_federation_bundler_runtime__.consumesLoadingModuleToHandlerMapping
|
|
168
164
|
});
|
|
169
165
|
}
|
|
170
166
|
}
|
package/dist/exports.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export { MultiStats } from "./MultiStats";
|
|
|
14
14
|
export type { ChunkGroup } from "./ChunkGroup";
|
|
15
15
|
export type { NormalModuleFactory } from "./NormalModuleFactory";
|
|
16
16
|
export { NormalModule } from "./NormalModule";
|
|
17
|
-
|
|
17
|
+
import * as ModuleFilenameHelpers from "./lib/ModuleFilenameHelpers";
|
|
18
18
|
export { ModuleFilenameHelpers };
|
|
19
|
-
|
|
19
|
+
import Template = require("./Template");
|
|
20
20
|
export { Template };
|
|
21
21
|
export declare const WebpackError: ErrorConstructor;
|
|
22
22
|
export type { Watching } from "./Watching";
|
package/dist/exports.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -25,7 +48,7 @@ Object.defineProperty(exports, "MultiStats", { enumerable: true, get: function (
|
|
|
25
48
|
var NormalModule_1 = require("./NormalModule");
|
|
26
49
|
Object.defineProperty(exports, "NormalModule", { enumerable: true, get: function () { return NormalModule_1.NormalModule; } });
|
|
27
50
|
// API extractor not working with some re-exports, see: https://github.com/microsoft/fluentui/issues/20694
|
|
28
|
-
const ModuleFilenameHelpers = require("./lib/ModuleFilenameHelpers");
|
|
51
|
+
const ModuleFilenameHelpers = __importStar(require("./lib/ModuleFilenameHelpers"));
|
|
29
52
|
exports.ModuleFilenameHelpers = ModuleFilenameHelpers;
|
|
30
53
|
// API extractor not working with some re-exports, see: https://github.com/microsoft/fluentui/issues/20694
|
|
31
54
|
const Template = require("./Template");
|
|
@@ -520,7 +520,7 @@ async function runLoaders(compiler, rawContext) {
|
|
|
520
520
|
resolve({
|
|
521
521
|
content: (0, util_1.isNil)(content) ? undefined : (0, util_1.toBuffer)(content),
|
|
522
522
|
sourceMap: (0, util_1.serializeObject)(sourceMap),
|
|
523
|
-
additionalData
|
|
523
|
+
additionalData,
|
|
524
524
|
buildDependencies,
|
|
525
525
|
cacheable,
|
|
526
526
|
fileDependencies,
|
|
@@ -542,7 +542,7 @@ async function runLoaders(compiler, rawContext) {
|
|
|
542
542
|
: (0, util_1.toObject)(rawContext.sourceMap),
|
|
543
543
|
(0, util_1.isNil)(rawContext.additionalData)
|
|
544
544
|
? undefined
|
|
545
|
-
:
|
|
545
|
+
: rawContext.additionalData
|
|
546
546
|
], (err, result) => {
|
|
547
547
|
if (err) {
|
|
548
548
|
return reject(err);
|
|
@@ -551,7 +551,7 @@ async function runLoaders(compiler, rawContext) {
|
|
|
551
551
|
resolve({
|
|
552
552
|
content: (0, util_1.isNil)(content) ? undefined : (0, util_1.toBuffer)(content),
|
|
553
553
|
sourceMap: (0, util_1.serializeObject)(sourceMap),
|
|
554
|
-
additionalData
|
|
554
|
+
additionalData,
|
|
555
555
|
buildDependencies,
|
|
556
556
|
cacheable,
|
|
557
557
|
fileDependencies,
|
|
@@ -54,7 +54,7 @@ module.exports = function loadLoader(loader, callback) {
|
|
|
54
54
|
Object.assign({}, this.__internal__context, {
|
|
55
55
|
content: isNil(content) ? undefined : toBuffer(content),
|
|
56
56
|
sourceMap: serializeObject(sourceMap),
|
|
57
|
-
additionalData
|
|
57
|
+
additionalData
|
|
58
58
|
}));
|
|
59
59
|
// @ts-expect-error
|
|
60
60
|
this.__internal__context.additionalDataExternal =
|
|
@@ -69,9 +69,7 @@ module.exports = function loadLoader(loader, callback) {
|
|
|
69
69
|
context.buildDependencies.forEach(this.addBuildDependency);
|
|
70
70
|
callback(null, context.content, isNil(context.sourceMap)
|
|
71
71
|
? undefined
|
|
72
|
-
: toObject(context.sourceMap), isNil(context.additionalData)
|
|
73
|
-
? undefined
|
|
74
|
-
: toObject(context.additionalData));
|
|
72
|
+
: toObject(context.sourceMap), isNil(context.additionalData) ? undefined : context.additionalData);
|
|
75
73
|
// @ts-expect-error
|
|
76
74
|
this._compilation.__internal__pushNativeDiagnostics(context.diagnosticsExternal);
|
|
77
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "0.6.2-canary-
|
|
3
|
+
"version": "0.6.2-canary-5e6c853-20240418111828",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Fast Rust-based Web Bundler",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"styled-components": "^6.0.8",
|
|
61
61
|
"terser": "5.27.2",
|
|
62
62
|
"wast-loader": "^1.11.4",
|
|
63
|
-
"@rspack/core": "0.6.2-canary-
|
|
64
|
-
"@rspack/plugin-minify": "^0.6.2-canary-
|
|
63
|
+
"@rspack/core": "0.6.2-canary-5e6c853-20240418111828",
|
|
64
|
+
"@rspack/plugin-minify": "^0.6.2-canary-5e6c853-20240418111828"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@module-federation/runtime-tools": "0.1.6",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"webpack-sources": "3.2.3",
|
|
77
77
|
"zod": "^3.21.4",
|
|
78
78
|
"zod-validation-error": "1.3.1",
|
|
79
|
-
"@rspack/binding": "0.6.2-canary-
|
|
79
|
+
"@rspack/binding": "0.6.2-canary-5e6c853-20240418111828"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@swc/helpers": ">=0.5.1"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BuiltinPluginName } from "@rspack/binding";
|
|
2
|
-
export declare const FederationRuntimePlugin: {
|
|
3
|
-
new (): {
|
|
4
|
-
name: BuiltinPluginName;
|
|
5
|
-
_options: void;
|
|
6
|
-
affectedHooks: "done" | "compilation" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
8
|
-
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FederationRuntimePlugin = void 0;
|
|
4
|
-
const binding_1 = require("@rspack/binding");
|
|
5
|
-
const base_1 = require("../builtin-plugin/base");
|
|
6
|
-
exports.FederationRuntimePlugin = (0, base_1.create)(binding_1.BuiltinPluginName.FederationRuntimePlugin, () => { });
|