All Projects → bytedance → magic-portal

bytedance / magic-portal

Licence: MIT license
⚡ A blazing fast micro-component and micro-frontend solution uses web-components under the hood.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to magic-portal

postchildren-desktop
👨‍👦‍👦 A E2E test visualization tool (get along with postman and postwoman)
Stars: ✭ 23 (-73.26%)
Mutual labels:  micro-frontend
qw-sdk-demo
将 react 业务组件打包成 umd
Stars: ✭ 15 (-82.56%)
Mutual labels:  micro-frontend
postmessagejs
postmessage-promise is a client-server like, WebSocket like, full Promise syntax (postMessage.then etc.) supported postMessage library. 一个类 client-server 模式、类 WebSocket 模式、全 Promise 语法支持的 postMessage 库
Stars: ✭ 33 (-61.63%)
Mutual labels:  micro-frontend
ragu
🔪 A micro-frontend framework with Server Side Rendering.
Stars: ✭ 85 (-1.16%)
Mutual labels:  micro-frontend
rallie
a library that helps users implement decentralized front-end micro service architecture
Stars: ✭ 285 (+231.4%)
Mutual labels:  micro-frontend
showcase
A Full Stack Journey with Micro Services and Micro Front Ends. Using dapr, kubernetes, react module federation and web assembly,
Stars: ✭ 45 (-47.67%)
Mutual labels:  micro-frontend
angular-react-microfrontend
🚧 React vs Angular ? Why not both ! Micro frontend demo using Angular and React alongs with a NodeJS API
Stars: ✭ 17 (-80.23%)
Mutual labels:  micro-frontend
scion-microfrontend-platform
SCION Microfrontend Platform is a TypeScript-based open-source library that helps to implement a microfrontend architecture using iframes.
Stars: ✭ 51 (-40.7%)
Mutual labels:  micro-frontend
Microfrontends
Micro-frontend Architecture in Action-微前端的那些事儿
Stars: ✭ 2,696 (+3034.88%)
Mutual labels:  micro-frontend
Qiankun
📦 🚀 Blazing fast, simple and complete solution for micro frontends.
Stars: ✭ 11,497 (+13268.6%)
Mutual labels:  micro-frontend
react-micro-frontend-example
One approach for a micro frontend in React.
Stars: ✭ 51 (-40.7%)
Mutual labels:  micro-frontend
vue-mfe
✨ The easiest way to build a Vue.js micro front-end App.
Stars: ✭ 38 (-55.81%)
Mutual labels:  micro-frontend

Magic Portal

Make micro-components and micro-frontends never that easy again.

GitHub

Overview

A lightweight micro-frontend / micro-component solution inspired by Portals proposal

Feature

  • Blazing fast, based on magic
  • 🚀 Portability: write your code and use it with any frameworks.
  • 🔨 Adaptable: an adapter for any JS module, friendly to existing code.
  • 💪 Web Components driven design

Quick Start

Installation

$ npm install @magic-microservices/portal
# or
$ yarn add @magic-microservices/portal

Register portal component

import portal, { PortalHtmlEntryPlugin } from '@magic-microservices/portal'

await portal({
  plugins: [new PortalHtmlEntryPlugin()], // fetch and parse html
})

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.

<magic-portal src='//some-where-you-want-to-go' />

Advanced usage

Manifest and extremely fast rendering experience

You may found the example above used PortalHtmlEntryPlugin to 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.scripts and styles), and we could use PortalManifestWebpackPlugin to generate that in compilation stage.

import PortalManifestWebpackPlugin from '@magic-microservices/portal-manifest-webpack-plugin'

// webpack.config.js
plugins: [
  ...,
  new PortalManifestWebpackPlugin()
]

PortalManifestWebpackPlugin takes advantage of html-webpack-plugin under the hood. To use this plugin, make sure Webpack is using that.

After that, each Webpack build would generate a manifest.json which corresponding to your HTML and you could use this file directly in magic-portal just like this:

<magic-portal manifest='//some-where/manifest.json' />

Inspired by

Magic-portal is inspired by Portals proposal, thanks!

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].