feat: support Module Federation format
Summary
Add format called 'mf' to build Module Federation assets and add example for both host and remote scene in rslib
closes: #212
Related Links
Checklist
- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).
Deploy Preview for rslib ready!
| Name | Link |
|---|---|
| Latest commit | f28da36190caf27d0446b9c599d76ccb617712f5 |
| Latest deploy log | https://app.netlify.com/sites/rslib/deploys/6712286d6227610008f8aa00 |
| Deploy Preview | https://deploy-preview-240--rslib.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
@nyqykk Letβs keep pushing this PR.
@nyqykk Letβs keep pushing this PR.
i write a rsbuild plugin in mf repo, for both app project and rslib which is build by rsbuild, so this branch will be changed https://github.com/module-federation/core/pull/3062
CodSpeed Performance Report
Merging #240 will improve performances by 69.49%
Comparing feat/support-mf (f28da36) with main (760968b)
Summary
β‘ 1 improvements
β
3 untouched benchmarks
π 1 new benchmarks
Benchmarks breakdown
| Benchmark | main |
feat/support-mf |
Change | |
|---|---|---|---|---|
| π | examples/module-federation/mf-react-component |
N/A | 356 ms | N/A |
| β‘ | examples/react-component-bundle-false |
298.2 ms | 176 ms | +69.49% |
Generally LGTM. π
Append examples/module-fedration/mf-react-component to https://github.com/web-infra-dev/rslib/blob/main/tests/benchmark/index.bench.ts then we're good to merge.
You could remove the 'esm' and 'cjs' lib from the config like what disableDts does. This could help us only foucs on measure the benchmark of MF bundling. disableDts should also be applied as well.
The benchmark shows examples/react-component-bundle-false got improved, but it should be irrelevant. cc @SoonIter any idea?
Great work!