Skip to content

ragu-framework/ragu-react-server-adapter

Repository files navigation

Ragu

Ragu React Server Adapter

Testing Coverage Status License: MIT npm version PRs Welcome

A React adapter for Ragu Server - A micro-frontend framework.

Installation

yarn install ragu-cli
yarn install ragu-react-server-adapter

Exposing a Component

Create a file that exposes a single function that returns your component:

# my-mfe.jsx
export default () => <MyReactComponent />

After, start the ragu server using the cli:

yarn ragu-cli dev --file my-mfe.jsx

Open your browser at http://localhost:3100/preview to check your micro-frontend live!

That's all!

Build to production

yarn ragu-cli static --file my-mfe.jsx --baseurl https://mycdnhost/mymfe --output production

It will create a directory called production with a file called index.json.

Using your component

import {RaguComponent} from "ragu-client-react";


<RaguComponent src="https://mycdnhost/mymfe/index.json" />

Check The docs for More: https://ragu-framework.github.io/#!/ragu-react-server-adapter