micro-zoe/micro-app
Fork: 570 Star: 5607 (更新于 2024-11-08 16:45:03)
license: MIT
Language: CSS .
A simple, efficient and powerful micro front-end framework. 一款简约、高效、功能强大的微前端框架
最后发布版本: v1.0.0-rc.13 ( 2024-10-16 21:29:38)
English|简体中文|Documentation|Discussions|WeChat
📖Introduction
micro-app is a micro front-end framework launched by JD Retail. It renders based on webcomponent-like and realizes the micro front-end from component thinking, it aiming to reduce the difficulty of getting started and improve work efficiency.
It is the lowest cost framework for accessing micro front-end, and provides a series of perfect functions such as JS sandbox, style isolation, element isolation, preloading, resource address completion, plugin system, data communication and so on.
micro-app has no restrictions on the front-end framework, and any framework can be used as a base application to embed any type of micro application of the framework.
How to use
Base application
1、Install
yarn add @micro-zoe/micro-app
2、import at the entrance
// main.js
import microApp from '@micro-zoe/micro-app'
microApp.start()
3、Use components in page
<!-- my-page.vue -->
<template>
<!-- 👇 name is the app name, url is the app address -->
<micro-app name='my-app' url='http://localhost:3000/'></micro-app>
</template>
Sub application
Set cross-domain support in the headers of webpack-dev-server
devServer: {
headers: {
'Access-Control-Allow-Origin': '*',
},
},
The above micro front-end rendering is completed, and the effect is as follows:
More detailed configuration can be viewed Documentation.
🤝 Contribution
If you're interested in this project, you're welcome to mention pull request, and also welcome your "Star" ^_^
development
1、Clone
git clone https://github.com/micro-zoe/micro-app.git
2、Install dependencies
yarn bootstrap
3、Run project
yarn start
For more commands, see DEVELOP
FAQ
What are the advantages of micro-app?
It is easy to use and low invasive. It only needs to change a small amount of code to access the micro front-end, and provides rich functions at the same time.How compatible?
The micro-app relies on two newer APIs, CustomElements and Proxy.For browsers that do not support CustomElements, they can be compatible by introducing polyfills. For details, please refer to: webcomponents/polyfills。
However, Proxy is not compatible for the time being, so the micro-app cannot be run on browsers that do not support Proxy.
Browser compatibility can be viewed: Can I Use
The general is as follows:
- desktop: Except IE browser, other browsers are basically compatible.
- mobile: ios10+、android5+
Must micro applications support cross-domain?
yes!If it is a development environment, you can set headers in webpack-dev-server to support cross-domain.
devServer: {
headers: {
'Access-Control-Allow-Origin': '*',
},
}
If it is a production environment, you can support cross-domain through Configuration nginx.
Does it support vite?
Yes, please see adapt vite for details.
Contributors
License
最近版本更新:(数据更新于 2024-11-20 22:40:19)
2024-10-16 21:29:38 v1.0.0-rc.13
2024-09-30 18:53:50 v1.0.0-rc.12
2024-09-29 10:22:45 v1.0.0-rc.11
2024-09-25 10:24:15 v1.0.0-rc.10
2024-09-10 18:29:59 v1.0.0-rc.9
2024-08-20 18:10:32 v1.0.0-rc.8
2024-08-20 17:44:35 v1.0.0-rc.7
2024-07-29 20:32:57 v1.0.0-rc.6
2024-04-29 16:49:47 v1.0.0-rc.5
2024-02-01 02:27:56 v1.0.0-rc.4
主题(topics):
javascript, micro-frontend, microapp, webcomponents
micro-zoe/micro-app同语言 CSS最近更新仓库
2024-11-14 08:39:22 primefaces/primeng
2024-10-08 06:03:05 ParisNeo/lollms-webui
2024-09-11 20:01:02 Achuan-2/siyuan-themes-tsundoku
2024-09-03 23:15:18 Zuoqiu-Yingyi/siyuan-theme-dark-plus
2024-07-25 23:02:20 jgthms/bulma
2024-05-31 23:14:02 timpaul/form-extractor-prototype