core icon indicating copy to clipboard operation
core copied to clipboard

Support for React-Native

Open jbroma opened this issue 1 year ago • 7 comments

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 loadScript and createScript handlers 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-first strategy 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.

jbroma avatar Jul 30 '24 14:07 jbroma

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 ?

2heal1 avatar Sep 20 '24 03:09 2heal1

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.

jbroma avatar Sep 23 '24 12:09 jbroma

Stale issue message

github-actions[bot] avatar Nov 22 '24 15:11 github-actions[bot]

@jbroma can you add some more flavor to this one since we had the week working on it.

zackarychapple avatar Nov 24 '24 19:11 zackarychapple

Stale issue message

github-actions[bot] avatar Jan 24 '25 15:01 github-actions[bot]

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.

zackarychapple avatar Jan 24 '25 15:01 zackarychapple

Stale issue message

github-actions[bot] avatar Mar 26 '25 15:03 github-actions[bot]

Stale issue message

github-actions[bot] avatar May 26 '25 15:05 github-actions[bot]

Stale issue message

github-actions[bot] avatar Jul 26 '25 15:07 github-actions[bot]