fix: snapshot handling in react-native#3605
Conversation
🦋 Changeset detectedLatest commit: c529386 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Is there not a way to detect the env better? is it still a browser? or is there some global that we can use to say detect isReactNative? |
yes, exactly like Boris mention we could go with explicit check for React-Native like it was done in #2812 function isReactNativeEnv(): boolean {
return (
typeof navigator !== 'undefined' && navigator?.product === 'ReactNative'
);
} |
|
@ScriptedAlchemy I've updated the PR with explicit RN env check 👍 |
|
perfect, ill run it past team - but looks good to me. Do you need a canary release in the meantime? |
Thanks! No need for the canary, I've tested the changes locally and it's all good 👍 |


Description
#3587 introduced a change which breaks loading remotes in React Native. The root cause of this is that the
isBrowserEnvcheck isn't strict enough, and RN is getting recognized as browser env. Stricter version is based on implementation from popular (+1M weekly downloads) npm packagebrowser-or-nodeIn addition to that change, snapshot handling in RN needs a slight adjustments in
runtime-core- we need to check forremoteEntryoutside browser env too to ensure the remotes load properly.Thanks @borisyankov for spotting this issue!
Related Issue
Types of changes
Checklist