chore(release): publish
- @magic-microservices/portal-dev-webpack-plugin@0.1.1
- @magic-microservices/portal-manifest-webpack-plugin@0.1.1
- @magic-microservices/portal-utils@0.1.1
- @magic-microservices/portal@0.1.2
- @magic-microservices/puzzle@0.1.1
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Magic Portal
Make micro-components and micro-frontends never that easy again.
Overview
A lightweight micro-frontend / micro-component solution inspired by Portals proposal
Feature
Quick Start
Installation
Register portal component
Use built-in portal component 🎉
Registration should be placed before instantiation. Portal html entry plugin uses fetch under the hood, make sure the corresponding website’s CORS has configured.
Advanced usage
Manifest and extremely fast rendering experience
You may found the example above used
PortalHtmlEntryPluginto achieve HTML fetching and parsing at runtime, however in the best practice, this step should be avoided and moved to AOT(Ahead of Time) compilation. Manifest is a file that describes how HTML looks like (ie.scriptsandstyles), and we could usePortalManifestWebpackPluginto generate that in compilation stage.PortalManifestWebpackPlugintakes advantage ofhtml-webpack-pluginunder the hood. To use this plugin, make sure Webpack is using that.After that, each Webpack build would generate a
manifest.jsonwhich corresponding to your HTML and you could use this file directly inmagic-portaljust like this:Inspired by
Magic-portal is inspired by Portals proposal, thanks!
License
MIT