
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@micro-zoe/micro-app
Advanced tools
A lightweight, efficient and powerful micro front-end framework
English|简体中文|Documentation|Discussions|WeChat
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.
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>
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.
If you're interested in this project, you're welcome to mention pull request, and also welcome your "Star" ^_^
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
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:
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.
Yes, please see adapt vite for details.
FAQs
A lightweight, efficient and powerful micro front-end framework
The npm package @micro-zoe/micro-app receives a total of 1,562 weekly downloads. As such, @micro-zoe/micro-app popularity was classified as popular.
We found that @micro-zoe/micro-app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.