idrakimuhamad / react-native-repack

A sample test for Re.Pack and module federation with React-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module-Federation on React-Native with Re.Pack

Get started

Install deps of the workspaces

yarn

Start all of the bundler in workspaces

yarn concurrent

Run the host (iOS) app

yarn host:ios

Release build

To test release build, run the express server which will host the micro app bundle

yarn workspace express-bundle-host run start

Open the host app xcworkspace in Xcode and change the build type as Release. Then build the app to any simulator.

The micro app bundle already exists inside the public folder.

To generate new bundle for the micro app, run below:

yarn workspace products run bundle

Copy the generated bundle from the build folder and paste inside the express-bundle-host app public folder, under the latest version. Create new version folder if you wish to simulate updating the API version.

Kill the app, and re-open. It should fetch the new bundle. It might take few attempt as the bundle will be cache before, so up to Re.Pack to invalidate the new bundle.

Re.Pack is not a OTA solution, as such it doesn't provide any bundle or hash management or anyway to manage the update. It will just, download the remote if the URL, body or header changed.

About

A sample test for Re.Pack and module federation with React-native


Languages

Language:Java 32.6%Language:JavaScript 20.9%Language:C++ 15.3%Language:TypeScript 11.0%Language:Objective-C++ 9.3%Language:Objective-C 5.0%Language:Ruby 3.4%Language:Starlark 1.3%Language:Shell 1.0%Language:CMake 0.4%