Issue
I want to develop a react native app where I should be able to make features available based on user requirement, like a plugin.
So I want to develop separate react native SDKs for each feature and will provide install buttons for each feature in the app. If user installs any feature then it will be available inside the app for that particular user only .
So as of now I am not sure if it is possible or not using react native. Any pointer would be really helpful.
Solution
Yes this can be done using repack and Module federations . And it is provided by callstack
Introduction
This feature can be a powerful ally for development departments, especially when it comes to building complex apps with Micro-Frontend architecture, requiring multiple teams to deliver the whole thing.
The idea behind Module Federation
Module Federation was first introduced in Webpack 5. It’s a functionality that allows code-splitting and sharing the split code parts (chunks) between loosely coupled applications. It also helps distributed teams to ship large applications faster. And, along with its latest update, Re.Pack 3 supports this functionality out of the box. Module Federation is one of the approaches to creating Micro-frontends architecture for your application which makes the functionality a great ally for creating features on demand.
Micro-frontends
Going briefly through the Micro-Frontends working scheme, there are: the host app that runs firstly on the device, and Micro-frontend (MFE) apps that are used by the host app.
That means each container (MFE) used by the host application could be deployed and maintained independently. The host apps are able to reflect changes in Micro-frontend immediately with no need for redeploy until the changes are connected to the JS only. Accessing remote JS code exposed by MFE is the key feature of Module Federation and the process is called Runtime Deployment.
Answered By - Avinash
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.