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

[MF]: plugin for module federation #1234

Closed
douglaszaltron opened this issue Jan 10, 2024 · 6 comments · Fixed by #1516
Closed

[MF]: plugin for module federation #1234

douglaszaltron opened this issue Jan 10, 2024 · 6 comments · Fixed by #1516

Comments

@douglaszaltron
Copy link

douglaszaltron commented Jan 10, 2024

What problem does this feature solve?

The feature addresses the need for a streamlined and efficient way to manage module federation configurations in ReactJS-based or other development environments. Specifically, the plugin for module federation would allow developers to:

  • Automatically set up configurations related to module federation, enhancing the efficiency of the development process.
  • Read a default configuration file named modulefederation.config.js, simplifying the initial setup.
  • Provide flexibility by allowing developers to change the name of this default configuration file.

This feature solves the problem of manually configuring module federation settings, which can be time-consuming and prone to errors. By automating these processes and offering customization options, the plugin aims to improve the development workflow, maintainability, and scalability of applications using module federation in the rsbuild environment.

What does the proposed API look like?

It would be interesting to have a plugin for module federation.

import { pluginModuleFederation } from '@rsbuild/plugin-module-federation';
It already sets up the configurations and is able to read a file as the default modulefederation.config.js, and we can change this name.

@chenjiahan Is it feasible and does it make sense for rsbuild?"

@chenjiahan
Copy link
Member

Thanks for your suggestion! We do plan to provide better support for module federation in Rsbuild, maybe even in Rsbuild core.

The design of the relevant API has not yet been determined. @ScriptedAlchemy and @2heal1 may be able to provide more input for this ❤️

@ScriptedAlchemy
Copy link
Contributor

Yes. I also wanted to add http endpoint support to allow for APIs to configure the plugin. We need to have a larger discussion about what and how it should look.

File based was another possibility. Also reading exports field and mirroring it in MFP like a package would

@douglaszaltron
Copy link
Author

douglaszaltron commented Jan 26, 2024

@chenjiahan I'm testing with module federation, but with the new version (v0.3.8), it has stopped working. It halts at 70% sealing plugins. Do you know what could be the issue? Here's an example of my configuration.

image

It's related to the shared configurations in the module federation setup because when I remove that part, it can compile successfully.

image

@chenjiahan
Copy link
Member

@douglaszaltron Can you provide a repro that can help us troubleshoot? ❤️

@chenjiahan
Copy link
Member

chenjiahan commented Jan 26, 2024

@ahabhgk It seems rspack 0.5.2 broke Rsbuild + module federation example, can you help check it. ❤️

Steps:

@chenjiahan
Copy link
Member

I wrote an RFC for MF, see: #1461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants