-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
||
## 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
||
|
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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still has to be update There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's not leave todos and create a ticket instead There was a problem hiding this comment. Choose a reason for hiding this commentThe 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` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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`). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
1. Run `yarn start:standalone:<name>` | ||||||
2. Run `yarn run:<name>:ios` | ||||||
3. Run `yarn run:<name>:android` |
There was a problem hiding this comment.
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?