Skip to content

mikekoro/mother-octopus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it about?

This app is a wrapper that allows you to run other instances of Create React App inside (à la Micro Frontends).
The app supports bidirectional communitation between the Micro Frontends via Redux.

Getting started

This is the desired structure of your project:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

NB! Based on the blogpost from Jennifer Fu.

Concepts

  • Each Micro Frontend is represented by a component, eg.
<Route 
    path="/some/path" 
	render={(props) => <CreateReactApp {...props}/>} 
/>
....
const CreateReactApp = (props) => {
  return (
    <MicroFrontend
        history={props}
    ></MicroFrontend>
  )
};
  • You can pass any data/function to your Micro Frontends.
import store from './store'; // Redux store that you normally pass to <Provider store={store}>
const redux_actions = require('./store/actions/app'); // any Redux actions you might have
....
const CreateReactApp = (props) => {
  return (
    <MicroFrontend
        history={props}
		foo="bar"
		methods={redux_actions}
		store={store}
    ></MicroFrontend>
  )
};

About

Main Octopus app container. Very experimental.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published