Skip to content

Comments

Update react-native deep imports for 0.79 compatibility#3498

Merged
krispya merged 1 commit intopmndrs:masterfrom
huntie:update-react-native-imports
Jul 10, 2025
Merged

Update react-native deep imports for 0.79 compatibility#3498
krispya merged 1 commit intopmndrs:masterfrom
huntie:update-react-native-imports

Conversation

@huntie
Copy link
Contributor

@huntie huntie commented Mar 14, 2025

Summary

In the incoming React Native 0.79 release, we've converted a number of internal modules to export syntax — affecting usages with require(). This PR attempts to update these imports ahead of time, to work with both versions.

💡 Secondary note: In a future release, we are intending to omit each of these deep-imported modules from the public API of React Native. There will be a consultation period on opening up new APIs via the root 'react-native' exports — e.g. BlobManager here.

Test plan

Needs testing. CI should pass for integration with current RN versions.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6edd7b0:

Sandbox Source
example Configuration

@krispya
Copy link
Member

krispya commented Jul 9, 2025

Hi huntie, I'm putting attention back on R3F after a break. Sorry for the delay. I'm not familiar with React Native, but I'll see if I can get a colleague to take a look for me.

@thejustinwalsh
Copy link

LGTM! Expo 53 is out and on react-native 0.79.

Expo 52 is on react-native 0.76 so I did not explicitly test with react-native 0.78, however following the change through git blame (facebook/react-native@9a70bc0) shows the same solution used to resolve.

Two additional notes:

  • In the dist react-three-fiber-native esm module require is still used to load the polyfills, so even with metro configured to resolve esm via unstable_enablePackageExports, this updated logic with fallback is still needed.
  • With unstable_enablePackageExports enabled, metro is still loading the cjs, this is likely due to the package.json not using the exports field, though I do not know for certain how metro is determing when it will import esm from a package.

@krispya
Copy link
Member

krispya commented Jul 10, 2025

Thanks Justin! That's the green flag I was looking for.

@krispya krispya merged commit 62b6ccc into pmndrs:master Jul 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants