标签:HERE tip com pattern work cdb pac rom lock
参考资料:https://medium.com/swlh/rules-of-micro-frontends-7b96c10dde9
This is an opinionated list of best practices when designing applications that follow the Micro-frontend pattern. Each “rule” should be examined and its benefits/downsides evaluated against your specific use case.
To achieve the benefits of this architecture, accidental coupling should be avoided as much as possible; this will unlock the flexibility and scalability that the Micro-Frontend pattern has to offer as well as future-proofing your applications by allowing incremental upgrades or future complete rewrites of parts of your application.
Each Micro-frontend should be able to render in isolation or inside a container application. The data required should be loaded by each Micro-Frontend and avoid data waterfalls.
Do:
Do Not:
Each Micro-Frontend should have its own codebase and the version control of choice shouldn’t have any impact on the way the project is developed or deployed. Having all projects under a single monorepo or individual repositories is fine.
Do:
Each Micro-Frontend should have it’s own CI/CD pipeline and be able to deploy to production on demand without any dependencies on other Micro-frontends. A common antipattern that should be avoided is “The deployment queue of hell” where different Micro-frontends are so tightly coupled that they need to be deployed in a specific order to avoid breaking the application.
Do:
Do Not:
Because Micro-Frontends are required to render independently as well as inside a container application, it makes sense to also test them independently using unit and integration tests for both scenarios.
Do:
When a new Micro-Fronted is deployed to production, the previous version should not be deleted and the new version should be tagged with a version number using semantic versioning or similar. It is up to the container applications to decide what specific version of a particular Micro-Frontend to use (Managed
) or always use the latest version instead (Evergreen
).
Do:
Do Not:
Communication between Micro-Frontends should be minimal and simple, avoiding global state and framework-specific solutions as much as possible.
If two or more Micro-Frontends are sharing a lot of messages to provide their minimal functionality, they might be too tightly coupled and they could share a similar enough purpose that they should be considered to be integrated into one.
Do:
Do Not:
CSS from loaded from one Micro-fronted should not affect others.
Do:
Do Not:
标签:HERE tip com pattern work cdb pac rom lock
原文地址:https://www.cnblogs.com/rongfengliang/p/14224447.html