GithubHelp home page GithubHelp logo

tuya / medusa Goto Github PK

View Code? Open in Web Editor NEW
106.0 18.0 18.0 4.05 MB

Micro Frontends All-in-one Integrated Solution.

License: MIT License

TypeScript 5.51% JavaScript 94.49%
spa micro-frontend micro-frontends medusa qiankun tuya

medusa's Introduction

Medusa

(M)ircrofront(E)n(D) (U)niversal (S)inglepage (A)pplication. Chinese Docs

English | 简体中文

Medusa is a micro frontend framework based on various frameworks. With extremely high framework compatibility, Medusa can run on several popular micro front-end frameworks. It enables Qiankun, Icestark, micro-zoe/micro-app, and Next.js to run in one environment simultaneously. The proxy sandbox solution is used to solve compatibility problems of old browsers. The main application and the micro-application are completed isolated.

Features

  • Unrestricted frontend framework.

  • Compatible with Qiankun, Icestark, micro-zoe/micro-app, and other micro frontend frameworks. It can be loaded directly without any changes.

  • Directly use the server-side rendering mode.

  • Load the popular server-side rendering framework Next.js.

  • Be used as an independent micro frontend framework.

  • Take the life cycle of React components as the life cycle of micro-applications.

Get started

For more information, see Examples.

Main application

The main application is React.

  1. Install dependency

    $ yarn add mmed
  2. Import the main application

    import {Router, Route} from 'mmed'
    
    const App = () => {
      return <Router loading={<div>loading...</div>}>
        <Route html="http://localhost:7100" appId="reactApp" />
      </Router>
    }
    
    ReactDOM.render(<App />, document.getElementById('app'))

Micro-applications

Take the development mode as an example. Set the cross-origin parameter of the page.

devServer: {
  headers: {
    'Access-Control-Allow-Origin': '*'
  }
}

Example

In the examples directory, there are examples of the main application and three sub-applications. It also shows how to load the micro frontend in 8 ways in the main application.

git clone https://github.com/tuya/medusa.git
cd medusa
yarn demo

License

For more information about licenses, see MIT.

medusa's People

Contributors

djwxfdt avatar zlinoliver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.