Support for React-Native
Clear and concise description of the problem
Re.Pack supports MF V1, for V2 supports we need adjust how containers are loaded in React-Native environment.
Suggested solution
- create separate
loadScriptandcreateScripthandlers for React Native environment in@module-federation/sdk - disable auto preload since it only supports browser env atm - related PR: #2741
Alternative
- auto preload can be disabled through
loaded-firststrategy and that can come from Re.Pack's own runtime plugin
Additional context
Related Re.Pack issue: https://github.com/callstack/repack/issues/518 Related Re.Pack PR: https://github.com/callstack/repack/pull/674
Validations
- [X] Read the Contributing Guidelines.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
hey i don't sure why it depends on the disable autoPreload . And i support the shareStrategy option , which you can config in runtime/build configuration , maybe this can satisfy your need ?
hey i don't sure why it depends on the disable autoPreload . And i support the shareStrategy option , which you can config in runtime/build configuration , maybe this can satisfy your need ?
hey, shareStrategy is definitely sufficient for this exact purpose, I've been using it in the POC ever since it was implemented and it works as expected 👍
As to why it's necessary: RN startup is complicated - we need to have eager access to react and react-native packages there, but at the same time we want to share them with other federated modules. When it's set to version-first, I think both of these dependencies were set to Promises and this caused Errors in RN env since we need to have sync startup.
Stale issue message
@jbroma can you add some more flavor to this one since we had the week working on it.
Stale issue message
There is a lot being announced by the Callstack Repack team @jbroma team and our Zephyr Cloud team next week (the week of Jan 27. Will make sure examples are updated here after at least with references to that work.
Stale issue message
Stale issue message
Stale issue message