Skip to content

Latest commit

 

History

History
45 lines (25 loc) · 2.78 KB

MSW_EXAMPLE.md

File metadata and controls

45 lines (25 loc) · 2.78 KB

MSW example

This repository include samples using a Module Federation setup. Those samples could be of help to the MSW maintainers to troubleshoot issues that are specific to federated applications.

Note for Squide maintainers: This file is referenced in the MSW example repository here.

Installation

To install the sample and start the application with a developer server, follow these steps.

  • Clone the repository locally: git clone https://github.com/gsoft-inc/wl-squide.git.

  • Install the codebase with PNPM, execute the following command at the root of the monorepo: pnpm install.

  • Start the sample application by executing the following command at the root of the monorepo: pnpm dev-endpoints.

  • Once the sample application is started, open a browser and navigate to http://localhost:8080.

  • The application should render a login page. Use temp as the username and temp as the password.

Sample application topology

host

This is the HOST application that instanciate a registry (through a FireflyRuntime class), provides the registry to the modules and then start the MSW service. The parts that should be of interest are:

remote-module

This is the REMOTE app using Module Federation. It registers it's request handlers in the src/register.tsx file.

local-module

This is more like a LIBRARY project that register pages and request handlers than an actual app. It's loaded at build time rather than at RUNTIME like a REMOTE app. I don't think this project is of interest to you.