-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
feat: add storybook addon that supports Module Federation remote containers #598
feat: add storybook addon that supports Module Federation remote containers #598
Conversation
996dcbd
to
87c8eb4
Compare
…drei/universe into features/add-storybook-plugin # Conflicts: # packages/storybook-plugin/src/lib/storybook-plugin.ts
…bpack config with another configuration to bootstrap entry file
…drei/universe into features/add-storybook-plugin
Are you planning to publish this package to npm? |
@ScriptedAlchemy Yes |
…rtualModulePlugin
… refactor webpack fn
Co-authored-by: Robert Donnelly <[email protected]>
…into features/add-storybook-plugin # Conflicts: # package.json
I'm blocked by a bug. I sent a message in the Storybook Discord channel. I would really appreciate if you can someone help me. |
…into features/add-storybook-plugin # Conflicts: # .github/workflows/release.yml # nx.json # package.json # yarn.lock
…for nx Module Federation
…into features/add-storybook-plugin # Conflicts: # package.json
Surely I was wrong with NX something to configure, but it's ready for review @ScriptedAlchemy |
…into features/add-storybook-plugin # Conflicts: # packages/utilities/package.json
…into features/add-storybook-plugin # Conflicts: # package.json
…into features/add-storybook-plugin # Conflicts: # package.json
@@ -136,4 +152,3 @@ | |||
] | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Code review:
-
The patch introduces a number of new dependencies, such as "@nrwl/storybook", "@pmmmwh/react-refresh-webpack-plugin", "@storybook/addon-essentials", "@svgr/webpack", "babel-jest", "babel-loader", "html-webpack-plugin", "react-refresh", "url-loader" and "webpack-virtual-modules". It is necessary to check if these new dependencies are properly added and do not introduce any security risks.
-
The patch also updates some existing dependencies, such as "@nrwl/linter", "@nrwl/next", "@swc/cli" and "typescript". It is necessary to ensure that these updated dependencies are compatible with the application and do not break any of its functionality.
-
It is important to check if the patch does not introduce any syntax errors and that all the changes are properly tested.
-
It is also necessary to make sure that the patch does not introduce any performance issues or memory leaks.
|
||
const { ModuleFederationPlugin } = container; | ||
|
||
function determineRemoteUrl(remote: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we export these functions to be reused lately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I open a PR to refactor getModuleFederationConfig
util. It will no longer be necessary to pass the function determineRemoteUrl
. When will it be merged I will create a PR to remove the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fyodorovandrei love that <3 Thanks 🙏
…ainers (module-federation#598) * feat: add package storybook-plugin * feat(storybook-plugin): add test for webpack fn * feat: add package storybook-plugin * feat(storybook-plugin): add test for webpack fn * feat(storybook-plugin): remove storybook config overwrite * feat(storybook-plugin): replace VirtualModulePlugin from storybook webpack config with another configuration to bootstrap entry file * fix(storybook-plugin): update todo comment * fix(storybook-plugin): remove preview file * feat(storybook-plugin): move utils in own folder * feat(storybook-plugin): update logic to replace or push the plugin VirtualModulePlugin * feat(storybook-plugin): fix package description * feat(storybook-plugin): update README.md * feat(storybook-addon): rename from plugin to addon * chore: add package storybook-addon in release action * fix(storybook-addon): update package repository url * fix(storybook-addon): update mock and add virtual module plugin after refactor webpack fn * feat(storybook-addon): add tests for correctImportPath util Co-authored-by: Robert Donnelly <[email protected]> * feat(storybook-addon): refactor webpack fn * feat(storybook-addon): write all webpack virtual modules in node_modules directory and fix some imports * fix(storybook-addon): update test * fix(storybook-addon): rollback yarn.lock * feature(storybook-addon): write files recursive when move from virtual modules * feat(storybook-addon): move util `correctImportPath` in common utils package * feat(storybook-addon): add 2 mf apps and add support for nx mf config * fix(storybook-addon): pass webpack config * fix(storybook-addon): rollback util call * feat(storybook-addon): implement custom utils `withModuleFederation` for nx Module Federation * feat(storybook-addon): update package versions * feat(storybook-addon): update README.md --------- Co-authored-by: Zack Jackson <[email protected]> Co-authored-by: Robert Donnelly <[email protected]>
🎉 This PR is included in version 1.0.0-canary.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fix for issue #532