@module-federation/rspack 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,293 +7,199 @@ var dtsPlugin = require('@module-federation/dts-plugin');
7
7
  var ReactBridgePlugin = require('@module-federation/bridge-react-webpack-plugin');
8
8
  var path = require('node:path');
9
9
  var fs = require('node:fs');
10
- var remoteEntryPlugin = require('./remote-entry-plugin.cjs.js');
10
+ var remoteEntryPlugin = require('./RemoteEntryPlugin.cjs.js');
11
11
 
12
- function _class_call_check(instance, Constructor) {
13
- if (!(instance instanceof Constructor)) {
14
- throw new TypeError("Cannot call a class as a function");
15
- }
16
- }
17
- function _defineProperties(target, props) {
18
- for(var i = 0; i < props.length; i++){
19
- var descriptor = props[i];
20
- descriptor.enumerable = descriptor.enumerable || false;
21
- descriptor.configurable = true;
22
- if ("value" in descriptor) descriptor.writable = true;
23
- Object.defineProperty(target, descriptor.key, descriptor);
24
- }
25
- }
26
- function _create_class(Constructor, protoProps, staticProps) {
27
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
- return Constructor;
29
- }
30
- function _define_property(obj, key, value) {
31
- if (key in obj) {
32
- Object.defineProperty(obj, key, {
33
- value: value,
34
- enumerable: true,
35
- configurable: true,
36
- writable: true
37
- });
38
- } else {
39
- obj[key] = value;
40
- }
41
- return obj;
42
- }
43
- function _instanceof(left, right) {
44
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
45
- return !!right[Symbol.hasInstance](left);
46
- } else {
47
- return left instanceof right;
12
+ const RuntimeToolsPath = require.resolve('@module-federation/runtime-tools');
13
+ const PLUGIN_NAME = 'RspackModuleFederationPlugin';
14
+ class ModuleFederationPlugin {
15
+ constructor(options) {
16
+ this.name = PLUGIN_NAME;
17
+ this._options = options;
48
18
  }
49
- }
50
- function _object_spread(target) {
51
- for(var i = 1; i < arguments.length; i++){
52
- var source = arguments[i] != null ? arguments[i] : {};
53
- var ownKeys = Object.keys(source);
54
- if (typeof Object.getOwnPropertySymbols === "function") {
55
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
56
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
57
- }));
19
+ _patchBundlerConfig(compiler) {
20
+ const { name, experiments } = this._options;
21
+ const definePluginOptions = {};
22
+ if (name) {
23
+ definePluginOptions['FEDERATION_BUILD_IDENTIFIER'] = JSON.stringify(sdk.composeKeyWithSeparator(name, managers.utils.getBuildVersion()));
58
24
  }
59
- ownKeys.forEach(function(key) {
60
- _define_property(target, key, source[key]);
61
- });
62
- }
63
- return target;
64
- }
65
- function ownKeys(object, enumerableOnly) {
66
- var keys = Object.keys(object);
67
- if (Object.getOwnPropertySymbols) {
68
- var symbols = Object.getOwnPropertySymbols(object);
69
- keys.push.apply(keys, symbols);
25
+ // Add FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN
26
+ const disableSnapshot = experiments?.optimization?.disableSnapshot ?? false;
27
+ definePluginOptions['FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN'] =
28
+ disableSnapshot;
29
+ // Determine ENV_TARGET: only if manually specified in experiments.optimization.target
30
+ if (experiments?.optimization &&
31
+ typeof experiments.optimization === 'object' &&
32
+ experiments.optimization !== null &&
33
+ 'target' in experiments.optimization) {
34
+ const manualTarget = experiments.optimization.target;
35
+ // Ensure the target is one of the expected values before setting
36
+ if (manualTarget === 'web' || manualTarget === 'node') {
37
+ definePluginOptions['ENV_TARGET'] = JSON.stringify(manualTarget);
38
+ }
39
+ }
40
+ // No inference for ENV_TARGET. If not manually set and valid, it's not defined.
41
+ new compiler.webpack.DefinePlugin(definePluginOptions).apply(compiler);
70
42
  }
71
- return keys;
72
- }
73
- function _object_spread_props(target, source) {
74
- source = source != null ? source : {};
75
- if (Object.getOwnPropertyDescriptors) {
76
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
77
- } else {
78
- ownKeys(Object(source)).forEach(function(key) {
79
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
43
+ _checkSingleton(compiler) {
44
+ let count = 0;
45
+ compiler.options.plugins.forEach((p) => {
46
+ if (typeof p !== 'object' || !p) {
47
+ return;
48
+ }
49
+ if (p['name'] === this.name) {
50
+ count++;
51
+ if (count > 1) {
52
+ throw new Error(`Detect duplicate register ${this.name},please ensure ${this.name} is singleton!`);
53
+ }
54
+ }
80
55
  });
81
56
  }
82
- return target;
83
- }
84
- function _type_of(obj) {
85
- "@swc/helpers - typeof";
86
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
87
- }
88
- var RuntimeToolsPath = require.resolve('@module-federation/runtime-tools');
89
- var PLUGIN_NAME = 'RspackModuleFederationPlugin';
90
- var ModuleFederationPlugin = /*#__PURE__*/ function() {
91
- function ModuleFederationPlugin(options) {
92
- _class_call_check(this, ModuleFederationPlugin);
93
- this.name = PLUGIN_NAME;
94
- this._options = options;
95
- }
96
- _create_class(ModuleFederationPlugin, [
97
- {
98
- key: "_patchBundlerConfig",
99
- value: function _patchBundlerConfig(compiler) {
100
- var _experiments_optimization;
101
- var _this__options = this._options, name = _this__options.name, experiments = _this__options.experiments;
102
- var definePluginOptions = {};
103
- if (name) {
104
- definePluginOptions['FEDERATION_BUILD_IDENTIFIER'] = JSON.stringify(sdk.composeKeyWithSeparator(name, managers.utils.getBuildVersion()));
105
- }
106
- var _experiments_optimization_disableSnapshot;
107
- // Add FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN
108
- var disableSnapshot = (_experiments_optimization_disableSnapshot = experiments === null || experiments === void 0 ? void 0 : (_experiments_optimization = experiments.optimization) === null || _experiments_optimization === void 0 ? void 0 : _experiments_optimization.disableSnapshot) !== null && _experiments_optimization_disableSnapshot !== void 0 ? _experiments_optimization_disableSnapshot : false;
109
- definePluginOptions['FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN'] = disableSnapshot;
110
- // Determine ENV_TARGET: only if manually specified in experiments.optimization.target
111
- if ((experiments === null || experiments === void 0 ? void 0 : experiments.optimization) && _type_of(experiments.optimization) === 'object' && experiments.optimization !== null && 'target' in experiments.optimization) {
112
- var manualTarget = experiments.optimization.target;
113
- // Ensure the target is one of the expected values before setting
114
- if (manualTarget === 'web' || manualTarget === 'node') {
115
- definePluginOptions['ENV_TARGET'] = JSON.stringify(manualTarget);
116
- }
57
+ apply(compiler) {
58
+ sdk.bindLoggerToCompiler(remoteEntryPlugin.logger, compiler, PLUGIN_NAME);
59
+ const { _options: options } = this;
60
+ if (!options.name) {
61
+ throw new Error('[ ModuleFederationPlugin ]: name is required');
62
+ }
63
+ this._checkSingleton(compiler);
64
+ this._patchBundlerConfig(compiler);
65
+ const containerManager = new managers.ContainerManager();
66
+ containerManager.init(options);
67
+ if (containerManager.enable) {
68
+ this._patchChunkSplit(compiler, options.name);
69
+ }
70
+ // must before ModuleFederationPlugin
71
+ new remoteEntryPlugin.RemoteEntryPlugin(options).apply(compiler);
72
+ if (options.experiments?.provideExternalRuntime) {
73
+ if (options.exposes) {
74
+ throw new Error('You can only set provideExternalRuntime: true in pure consumer which not expose modules.');
75
+ }
76
+ const runtimePlugins = options.runtimePlugins || [];
77
+ options.runtimePlugins = runtimePlugins.concat(require.resolve('@module-federation/inject-external-runtime-core-plugin'));
78
+ }
79
+ if (options.experiments?.externalRuntime === true) {
80
+ const Externals = compiler.webpack.ExternalsPlugin;
81
+ new Externals(compiler.options.externalsType || 'global', {
82
+ '@module-federation/runtime-core': '_FEDERATION_RUNTIME_CORE',
83
+ }).apply(compiler);
84
+ }
85
+ options.implementation = options.implementation || RuntimeToolsPath;
86
+ let disableManifest = options.manifest === false;
87
+ let disableDts = options.dts === false;
88
+ if (!disableDts) {
89
+ const dtsPlugin$1 = new dtsPlugin.DtsPlugin(options);
90
+ // @ts-ignore
91
+ dtsPlugin$1.apply(compiler);
92
+ dtsPlugin$1.addRuntimePlugins();
93
+ }
94
+ if (!disableManifest && options.exposes) {
95
+ try {
96
+ options.exposes = containerManager.containerPluginExposesOptions;
97
+ }
98
+ catch (err) {
99
+ if (err instanceof Error) {
100
+ err.message = `[ ModuleFederationPlugin ]: Manifest will not generate, because: ${err.message}`;
117
101
  }
118
- // No inference for ENV_TARGET. If not manually set and valid, it's not defined.
119
- new compiler.webpack.DefinePlugin(definePluginOptions).apply(compiler);
102
+ remoteEntryPlugin.logger.warn(err);
103
+ disableManifest = true;
120
104
  }
121
- },
122
- {
123
- key: "_checkSingleton",
124
- value: function _checkSingleton(compiler) {
125
- var _this = this;
126
- var count = 0;
127
- compiler.options.plugins.forEach(function(p) {
128
- if ((typeof p === "undefined" ? "undefined" : _type_of(p)) !== 'object' || !p) {
129
- return;
105
+ }
106
+ new compiler.webpack.container.ModuleFederationPlugin(options).apply(compiler);
107
+ const runtimeESMPath = require.resolve('@module-federation/runtime/dist/index.esm.js', { paths: [options.implementation] });
108
+ compiler.hooks.afterPlugins.tap('PatchAliasWebpackPlugin', () => {
109
+ compiler.options.resolve.alias = {
110
+ ...compiler.options.resolve.alias,
111
+ '@module-federation/runtime$': runtimeESMPath,
112
+ };
113
+ });
114
+ if (!disableManifest) {
115
+ this._statsPlugin = new manifest.StatsPlugin(options, {
116
+ pluginVersion: "0.20.0",
117
+ bundler: 'rspack',
118
+ });
119
+ // @ts-ignore
120
+ this._statsPlugin.apply(compiler);
121
+ }
122
+ // react bridge plugin
123
+ const nodeModulesPath = path.resolve(compiler.context, 'node_modules');
124
+ const reactPath = path.join(nodeModulesPath, '@module-federation/bridge-react');
125
+ // Check whether react exists
126
+ if (fs.existsSync(reactPath) &&
127
+ (!options?.bridge || !options.bridge.disableAlias)) {
128
+ new ReactBridgePlugin({
129
+ moduleFederationOptions: this._options,
130
+ }).apply(compiler);
131
+ }
132
+ }
133
+ _patchChunkSplit(compiler, name) {
134
+ const { splitChunks } = compiler.options.optimization;
135
+ const patchChunkSplit = (cacheGroup) => {
136
+ switch (typeof cacheGroup) {
137
+ case 'boolean':
138
+ case 'string':
139
+ case 'function':
140
+ break;
141
+ // cacheGroup.chunks will inherit splitChunks.chunks, so you only need to modify the chunks that are set separately
142
+ case 'object': {
143
+ if (cacheGroup instanceof RegExp) {
144
+ break;
130
145
  }
131
- if (p['name'] === _this.name) {
132
- count++;
133
- if (count > 1) {
134
- throw new Error("Detect duplicate register ".concat(_this.name, ",please ensure ").concat(_this.name, " is singleton!"));
135
- }
146
+ if (!cacheGroup.chunks) {
147
+ break;
136
148
  }
137
- });
138
- }
139
- },
140
- {
141
- key: "apply",
142
- value: function apply(compiler) {
143
- var _options_experiments, _options_experiments1;
144
- var _this = this, options = _this._options;
145
- if (!options.name) {
146
- throw new Error('[ ModuleFederationPlugin ]: name is required');
147
- }
148
- this._checkSingleton(compiler);
149
- this._patchBundlerConfig(compiler);
150
- var containerManager = new managers.ContainerManager();
151
- containerManager.init(options);
152
- if (containerManager.enable) {
153
- this._patchChunkSplit(compiler, options.name);
154
- }
155
- // must before ModuleFederationPlugin
156
- new remoteEntryPlugin.RemoteEntryPlugin(options).apply(compiler);
157
- if ((_options_experiments = options.experiments) === null || _options_experiments === void 0 ? void 0 : _options_experiments.provideExternalRuntime) {
158
- if (options.exposes) {
159
- throw new Error('You can only set provideExternalRuntime: true in pure consumer which not expose modules.');
149
+ if (typeof cacheGroup.chunks === 'function') {
150
+ const prevChunks = cacheGroup.chunks;
151
+ cacheGroup.chunks = (chunk) => {
152
+ if (chunk.name &&
153
+ (chunk.name === name || chunk.name === name + '_partial')) {
154
+ return false;
155
+ }
156
+ return prevChunks(chunk);
157
+ };
158
+ break;
160
159
  }
161
- var runtimePlugins = options.runtimePlugins || [];
162
- options.runtimePlugins = runtimePlugins.concat(require.resolve('@module-federation/inject-external-runtime-core-plugin'));
163
- }
164
- if (((_options_experiments1 = options.experiments) === null || _options_experiments1 === void 0 ? void 0 : _options_experiments1.externalRuntime) === true) {
165
- var Externals = compiler.webpack.ExternalsPlugin;
166
- new Externals(compiler.options.externalsType || 'global', {
167
- '@module-federation/runtime-core': '_FEDERATION_RUNTIME_CORE'
168
- }).apply(compiler);
169
- }
170
- options.implementation = options.implementation || RuntimeToolsPath;
171
- var disableManifest = options.manifest === false;
172
- var disableDts = options.dts === false;
173
- if (!disableDts) {
174
- var dtsPlugin$1 = new dtsPlugin.DtsPlugin(options);
175
- // @ts-ignore
176
- dtsPlugin$1.apply(compiler);
177
- dtsPlugin$1.addRuntimePlugins();
178
- }
179
- if (!disableManifest && options.exposes) {
180
- try {
181
- options.exposes = containerManager.containerPluginExposesOptions;
182
- } catch (err) {
183
- if (_instanceof(err, Error)) {
184
- err.message = "[ ModuleFederationPlugin ]: Manifest will not generate, because: ".concat(err.message);
185
- }
186
- console.warn(err);
187
- disableManifest = true;
160
+ if (cacheGroup.chunks === 'all') {
161
+ cacheGroup.chunks = (chunk) => {
162
+ if (chunk.name &&
163
+ (chunk.name === name || chunk.name === name + '_partial')) {
164
+ return false;
165
+ }
166
+ return true;
167
+ };
168
+ break;
188
169
  }
189
- }
190
- new compiler.webpack.container.ModuleFederationPlugin(options).apply(compiler);
191
- var runtimeESMPath = require.resolve('@module-federation/runtime/dist/index.esm.js', {
192
- paths: [
193
- options.implementation
194
- ]
195
- });
196
- compiler.hooks.afterPlugins.tap('PatchAliasWebpackPlugin', function() {
197
- compiler.options.resolve.alias = _object_spread_props(_object_spread({}, compiler.options.resolve.alias), {
198
- '@module-federation/runtime$': runtimeESMPath
199
- });
200
- });
201
- if (!disableManifest) {
202
- this._statsPlugin = new manifest.StatsPlugin(options, {
203
- pluginVersion: "0.19.0",
204
- bundler: 'rspack'
205
- });
206
- // @ts-ignore
207
- this._statsPlugin.apply(compiler);
208
- }
209
- // react bridge plugin
210
- var nodeModulesPath = path.resolve(compiler.context, 'node_modules');
211
- var reactPath = path.join(nodeModulesPath, '@module-federation/bridge-react');
212
- // Check whether react exists
213
- if (fs.existsSync(reactPath) && (!(options === null || options === void 0 ? void 0 : options.bridge) || !options.bridge.disableAlias)) {
214
- new ReactBridgePlugin({
215
- moduleFederationOptions: this._options
216
- }).apply(compiler);
217
- }
218
- }
219
- },
220
- {
221
- key: "_patchChunkSplit",
222
- value: function _patchChunkSplit(compiler, name) {
223
- var splitChunks = compiler.options.optimization.splitChunks;
224
- var patchChunkSplit = function(cacheGroup) {
225
- switch(typeof cacheGroup === "undefined" ? "undefined" : _type_of(cacheGroup)){
226
- case 'boolean':
227
- case 'string':
228
- case 'function':
229
- break;
230
- // cacheGroup.chunks will inherit splitChunks.chunks, so you only need to modify the chunks that are set separately
231
- case 'object':
232
- {
233
- if (_instanceof(cacheGroup, RegExp)) {
234
- break;
235
- }
236
- if (!cacheGroup.chunks) {
237
- break;
238
- }
239
- if (typeof cacheGroup.chunks === 'function') {
240
- var prevChunks = cacheGroup.chunks;
241
- cacheGroup.chunks = function(chunk) {
242
- if (chunk.name && (chunk.name === name || chunk.name === name + '_partial')) {
243
- return false;
244
- }
245
- return prevChunks(chunk);
246
- };
247
- break;
248
- }
249
- if (cacheGroup.chunks === 'all') {
250
- cacheGroup.chunks = function(chunk) {
251
- if (chunk.name && (chunk.name === name || chunk.name === name + '_partial')) {
252
- return false;
253
- }
254
- return true;
255
- };
256
- break;
257
- }
258
- if (cacheGroup.chunks === 'initial') {
259
- cacheGroup.chunks = function(chunk) {
260
- if (chunk.name && (chunk.name === name || chunk.name === name + '_partial')) {
261
- return false;
262
- }
263
- return chunk.isOnlyInitial();
264
- };
265
- break;
266
- }
267
- break;
170
+ if (cacheGroup.chunks === 'initial') {
171
+ cacheGroup.chunks = (chunk) => {
172
+ if (chunk.name &&
173
+ (chunk.name === name || chunk.name === name + '_partial')) {
174
+ return false;
268
175
  }
176
+ return chunk.isOnlyInitial();
177
+ };
178
+ break;
269
179
  }
270
- };
271
- if (!splitChunks) {
272
- return;
180
+ break;
273
181
  }
274
- // 修改 splitChunk.chunks
275
- patchChunkSplit(splitChunks);
276
- var cacheGroups = splitChunks.cacheGroups;
277
- if (!cacheGroups) {
278
- return;
279
- }
280
- // 修改 splitChunk.cacheGroups[key].chunks
281
- Object.keys(cacheGroups).forEach(function(cacheGroupKey) {
282
- patchChunkSplit(cacheGroups[cacheGroupKey]);
283
- });
284
- }
285
- },
286
- {
287
- key: "statsResourceInfo",
288
- get: function get() {
289
- var _this__statsPlugin;
290
- return (_this__statsPlugin = this._statsPlugin) === null || _this__statsPlugin === void 0 ? void 0 : _this__statsPlugin.resourceInfo;
291
182
  }
183
+ };
184
+ if (!splitChunks) {
185
+ return;
292
186
  }
293
- ]);
294
- return ModuleFederationPlugin;
295
- }();
296
- var GetPublicPathPlugin = remoteEntryPlugin.RemoteEntryPlugin;
187
+ // 修改 splitChunk.chunks
188
+ patchChunkSplit(splitChunks);
189
+ const { cacheGroups } = splitChunks;
190
+ if (!cacheGroups) {
191
+ return;
192
+ }
193
+ // 修改 splitChunk.cacheGroups[key].chunks
194
+ Object.keys(cacheGroups).forEach((cacheGroupKey) => {
195
+ patchChunkSplit(cacheGroups[cacheGroupKey]);
196
+ });
197
+ }
198
+ get statsResourceInfo() {
199
+ return this._statsPlugin?.resourceInfo;
200
+ }
201
+ }
202
+ const GetPublicPathPlugin = remoteEntryPlugin.RemoteEntryPlugin;
297
203
 
298
204
  exports.GetPublicPathPlugin = GetPublicPathPlugin;
299
205
  exports.ModuleFederationPlugin = ModuleFederationPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["../../src/ModuleFederationPlugin.ts"],"sourcesContent":[null],"names":["composeKeyWithSeparator","utils","bindLoggerToCompiler","logger","ContainerManager","RemoteEntryPlugin","dtsPlugin","DtsPlugin","StatsPlugin"],"mappings":";;;;;;;;;;;AA8BA,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,kCAAkC,CAAC;AAErE,MAAM,WAAW,GAAG;MACd,sBAAsB,CAAA;AAKjC,IAAA,WAAA,CAAY,OAA6D,EAAA;QAJhE,IAAI,CAAA,IAAA,GAAG,WAAW;AAKzB,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;;AAGjB,IAAA,mBAAmB,CAAC,QAAkB,EAAA;QAC5C,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,QAAQ;QAC3C,MAAM,mBAAmB,GAAqC,EAAE;QAChE,IAAI,IAAI,EAAE;AACR,YAAA,mBAAmB,CAAC,6BAA6B,CAAC,GAAG,IAAI,CAAC,SAAS,CACjEA,2BAAuB,CAAC,IAAI,EAAEC,cAAK,CAAC,eAAe,EAAE,CAAC,CACvD;;;QAGH,MAAM,eAAe,GAAG,WAAW,EAAE,YAAY,EAAE,eAAe,IAAI,KAAK;QAC3E,mBAAmB,CAAC,wCAAwC,CAAC;AAC3D,YAAA,eAAe;;QAGjB,IACE,WAAW,EAAE,YAAY;AACzB,YAAA,OAAO,WAAW,CAAC,YAAY,KAAK,QAAQ;YAC5C,WAAW,CAAC,YAAY,KAAK,IAAI;AACjC,YAAA,QAAQ,IAAI,WAAW,CAAC,YAAY,EACpC;AACA,YAAA,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,MAGjC;;YAEb,IAAI,YAAY,KAAK,KAAK,IAAI,YAAY,KAAK,MAAM,EAAE;gBACrD,mBAAmB,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;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