Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update README and add MODULE_FEDERATION/md #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README copy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# repack-examples

This is a repository with example applications for [Re.Pack](https://github.com/callstack/repack).

## Example Applications
- __ESBuild__: The application that uses __ESBuild Minify Plugin__ and `esbuild-loader` under the hood
- __Local Chuncks__: The application that uses Repack local chuncks feature
- [__Module Federation__](./module-federation/MODULE_FEDERATION.md): Huge yarn workspaces that consist of 3 application and 1 module, that could run as standalone applications or running host app with other applications modules usage inside it with __Webpack Module Federation__ feature configured
- __SWC__: The application using `swc-loader` inside webpack configuration
Comment on lines +6 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make those links to specific folders?


## Setup
1. Run `yarn` command inside root folder to install all dependencies in all the application
2. Run `yarn workspace <name> run bootstrap` command for every workspace to install yarn dependencies and pods

## Running
1. Run `yarn workspace <name> run start` commmand for any workspace you want to run dev server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be cool to list available workspaces :) otherwise you need to check package.json :P

2. Run `yarn workspace <name> run ios` commmand for any workspace you want to run ios app
3. Run `yarn workspace <name> run android` commmand for any workspace you want to run android app


26 changes: 26 additions & 0 deletions module-federation/MODULE_FEDERATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Module Federation Example Application

Module Federation functionality was introduced in Webpack 5. It helps to share the code between loosely coupled applications, sharing the same build system optimized for caching. It helps distributed teams to ship large applications faster. Re.Pack 3 ships with Module Federation support out-of-the-box.

Module federation is one of the approaches to create Micro-Frondends architecture for your application. There are the host app that runs firstly on the device and MFEs apps that are used by the host app. That means each container (MFE) that is used by host application could be deployed and maintained independently, so no need to re-deploy host app if any of the containers were changed and re-deployed. This is the key feature of Module Federation. Each team could independently work on any of the packages and deploy it anytime, so the host app will see the changes immediately.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MFE is Micro-Frontend? might using "create Micro-Frondends (MFEs) architecture"


## Application Structure
// TODO
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still has to be update

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not leave todos and create a ticket instead

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewworld are you able to finalise soon? If not I will do as @thymikee wrote


## Basic Setup
1. Go to `module-federation` folder `cd module-federation`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're already in module-federation folder

2. Run `yarn bootstrap`

## Basic Run
If we want to check Module Federation in action, we have to run `host` application first. Host application uses other remotes containers under the hood.

1. Run `yarn start`
2. Run `yarn run:host:ios`
3. Run `yarn run:host:android`

## Standalone Run
As was mentions before we could run any of containers as a standaline application (`app1` / `app2` / `module1`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As was mentions before we could run any of containers as a standaline application (`app1` / `app2` / `module1`).
You can run any of containers as a standalone application (`app1` / `app2` / `module1`):


1. Run `yarn start:standalone:<name>`
2. Run `yarn run:<name>:ios`
3. Run `yarn run:<name>:android`