File tree Expand file tree Collapse file tree 3 files changed +5
-34
lines changed
streaming/src/NodeModuleFederation Expand file tree Collapse file tree 3 files changed +5
-34
lines changed Original file line number Diff line number Diff line change @@ -329,38 +329,12 @@ Options:
329329// these are the defaults
330330revalidate ({
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-
3643382. 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);
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments