rslib icon indicating copy to clipboard operation
rslib copied to clipboard

feat: support Module Federation format

Open nyqykk opened this issue 1 year ago β€’ 4 comments

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).

nyqykk avatar Sep 27 '24 03:09 nyqykk

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Sep 27 '24 03:09 netlify[bot]

@nyqykk Let’s keep pushing this PR.

fi3ework avatar Oct 10 '24 03:10 fi3ework

@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

nyqykk avatar Oct 10 '24 03:10 nyqykk

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%

codspeed-hq[bot] avatar Oct 11 '24 08:10 codspeed-hq[bot]

Generally LGTM. πŸ‘

fi3ework avatar Oct 18 '24 08:10 fi3ework

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.

fi3ework avatar Oct 18 '24 08:10 fi3ework

The benchmark shows examples/react-component-bundle-false got improved, but it should be irrelevant. cc @SoonIter any idea? image

fi3ework avatar Oct 18 '24 09:10 fi3ework

Great work!

fi3ework avatar Oct 18 '24 09:10 fi3ework