Skip to content

Commit f52f6ad

Browse files
Merge pull request #23 from module-federation/drop_hot
remove hot experiment
2 parents b728b5b + 623c120 commit f52f6ad

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

README.md

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -329,38 +329,12 @@ Options:
329329
// these are the defaults
330330
revalidate({
331331
// revalidate remotes by polling
332-
poll: false,
332+
poll: false, // defualt false
333333
// how ofter should it poll
334334
pollFrequeny: 3000, // defaults to 3000ms
335335
});
336336
```
337337
338-
1. Enable the hot experiment via the plugin
339-
340-
```js
341-
withFederatedSidecar(
342-
// normal MF config
343-
{
344-
name: "next1",
345-
filename: "static/chunks/remoteEntry.js",
346-
exposes: {},
347-
remotes: {},
348-
shared: {
349-
react: {
350-
requiredVersion: false,
351-
singleton: true,
352-
},
353-
},
354-
},
355-
// sidecar specific options
356-
{
357-
experiments: {
358-
hot: true,
359-
},
360-
}
361-
);
362-
```
363-
364338
2. Inside `_document.js` (or `.tsx`) do the following:
365339
366340
```js
@@ -404,7 +378,7 @@ class MyDocument extends Document {
404378
<meta name="robots" content="noindex" />
405379
{Object.values(this.props.remoteChunks)}
406380
</ExtendedHead>
407-
<DevHotScript /> {/* adds a timeout for process.env.NODE_ENV !== "development" */}
381+
<DevHotScript /> {/* useful in development mode if you terminate processes on hot reload */}
408382
<body className="bg-background-grey">
409383
<Main />
410384
<NextScript />
@@ -561,7 +535,6 @@ withFederatedSidecar(
561535
{
562536
experiments: {
563537
flushChunks: true,
564-
hot: true,
565538
},
566539
}
567540
);

lib/with-federated-sidecar.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ const withModuleFederation =
179179
{
180180
experiments = {
181181
flushChunks: false,
182-
hot: false,
183182
},
184183
removePlugins = [
185184
"BuildManifestPlugin",
@@ -272,7 +271,7 @@ const withModuleFederation =
272271
chunkLoadingGlobal: undefined,
273272
devtoolNamespace: undefined,
274273
uniqueName: federationPluginOptions.name,
275-
hotUpdateGlobal: "webpackHotUpdate_" + federationPluginOptions.name,
274+
// hotUpdateGlobal: "webpackHotUpdate_" + federationPluginOptions.name,
276275
publicPath,
277276
},
278277
cache: false,

streaming/src/NodeModuleFederation/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,9 @@ class StreamingFederation {
147147
);
148148
const defs = {
149149
"process.env.REMOTES": runtime,
150+
"process.env.REMOTE_CONFIG": hot,
150151
};
151-
if (this.experiments.hot) {
152-
defs["process.env.REMOTE_CONFIG"] = hot;
153-
}
152+
154153
new ((webpack && webpack.DefinePlugin) || require("webpack").DefinePlugin)(
155154
defs
156155
).apply(compiler);

0 commit comments

Comments
 (0)