GithubHelp home page GithubHelp logo

eternalmatt / root-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from polyglot-microfrontends/root-config

0.0 0.0 0.0 1.17 MB

The root config for polyglot microfrontends

License: MIT License

JavaScript 62.29% HTML 37.71%

root-config's Introduction

root-config

CircleCI

What is this?

This is an example microfrontend repo demonstrating how to use single-spa. You can see the code running at https://polyglot.microfrontends.app.

How does it work?

Full article

This repository is a javascript project that creates a javascript bundle that is an in-browser javascript module (explanation on youtube / bilibili). The currently deployed version of the in-browser module can be seen at https://polyglot.microfrontends.app/importmap.json.

This project uses webpack and babel.

Whenever a pull request is merged to master, CircleCI builds and deploys the project. The "workflows" view (pictured below) can be seen if you are logged into CircleCI. Deployments for this in-browser module are completely independent of deployments for any other module.

image

Local development

Full documentation

Tutorial video: youtube / bilibili

There are two ways to do local development. It is preferred to do one module at a time, whenever possible.

One module at a time

cd root-config
yarn install
yarn start

Go to https://localhost:9000/polyglot-mf-root-config.js and verify that you are able to load the file without any SSL problems. To solve SSL problems, see these instructions.

Now, go to https://polyglot.microfrontends.app. In the browser console, run the following:

localStorage.setItem("devtools", true);

Refresh the page. Click on the tan / beige rectangle:

image

Set an import map override to 9000.

image

Refresh the page. Your local code for this module will now be running on https://polyglot.microfrontends.app. You may make changes locally and refresh the page to see them.

All modules together

Run the root-config project locally:

cd root-config
yarn install
yarn start

Now follow the steps above for "One module at a time" for each of the modules you wish to work on.

Adapting for your organization

Feel free to fork and modify any files you would like when doing a proof of concept for your organization. When it's time to actually create / adapt your organization's projects, consider using create-single-spa instead of forking this repository.

root-config's People

Contributors

dependabot[bot] avatar joeldenning 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.