Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: downgrade the next.js module federation plugin #98

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ updates:
directory: /
schedule:
interval: weekly
ignore:
# Pending complete resolution of https://github.com/module-federation/universe/issues/1102
# This exception should be removed as part of https://github.com/nearform/the-micro-frontends-workshop/issues/32
- dependency-name: "@module-federation/nextjs-mf"
versions: ["6.x", "7.x"]
Comment on lines +7 to +11
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be removed as part of #32

- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
7,238 changes: 4,314 additions & 2,924 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/solutions/step-02-setting-up-host/nextApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@module-federation/nextjs-mf": "7.0.6",
"next": "13.4.12",
"@module-federation/nextjs-mf": "5.2.1",
"next": "12.3.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
Expand Down
49 changes: 23 additions & 26 deletions src/solutions/step-03-bidirectional/nextApp/next.config.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
const NextFederationPlugin = require('@module-federation/nextjs-mf')

module.exports = {
webpack(config, options) {
if (!options.isServer) {
config.plugins.push(
new NextFederationPlugin({
name: 'nextApp',
remotes: {
remote: 'reactApp@http://localhost:8080/remoteEntry.js',
webpack(config) {
config.plugins.push(
new NextFederationPlugin({
name: 'nextApp',
remotes: {
remote: 'reactApp@http://localhost:8080/remoteEntry.js',
},
filename: 'static/chunks/remoteEntry.js',
exposes: {
'./nextjs-layout-box': './components/nextjs-layout-box.js',
'./nextjs-table': './components/nextjs-table.js',
},
shared: {
react: {
requiredVersion: false,
singleton: true,
},
filename: 'static/chunks/remoteEntry.js',
exposes: {
'./nextjs-layout-box':
'./components/nextjs-layout-box.js',
'./nextjs-table': './components/nextjs-table.js',
},
shared: {
react: {
requiredVersion: false,
singleton: true,
},
},
extraOptions: {
skipSharingNextInternals: true,
},
})
)
}
},
extraOptions: {
skipSharingNextInternals: true,
},
})
)

return config
},
// your original next.config.js export
reactStrictMode: true,
}
6 changes: 3 additions & 3 deletions src/solutions/step-03-bidirectional/nextApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"lint": "next lint"
},
"dependencies": {
"@module-federation/nextjs-mf": "7.0.2",
"next": "13.4.12",
"@module-federation/nextjs-mf": "5.2.1",
"next": "12.3.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"eslint": "8.14.0",
"eslint-config-next": "13.4.9"
"eslint-config-next": "12.3.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"lint": "next lint"
},
"dependencies": {
"@module-federation/nextjs-mf": "7.0.2",
"next": "13.4.12",
"@module-federation/nextjs-mf": "5.2.1",
"next": "12.3.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"eslint": "8.14.0",
"eslint-config-next": "13.4.9"
"eslint-config-next": "12.3.4"
}
}
6 changes: 3 additions & 3 deletions src/step-02-setting-up-host/nextApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"lint": "next lint"
},
"dependencies": {
"@module-federation/nextjs-mf": "7.0.6",
"next": "13.4.12",
"@module-federation/nextjs-mf": "5.2.1",
"next": "12.3.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"eslint": "8.14.0",
"eslint-config-next": "13.4.9"
"eslint-config-next": "12.3.4"
}
}
6 changes: 3 additions & 3 deletions src/step-04-shared-dependencies/nextApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"lint": "next lint"
},
"dependencies": {
"@module-federation/nextjs-mf": "7.0.2",
"next": "13.4.12",
"@module-federation/nextjs-mf": "5.2.1",
"next": "12.3.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"eslint": "8.14.0",
"eslint-config-next": "13.4.9"
"eslint-config-next": "12.3.4"
}
}