Conversation
|
RN 0.80 released: https://reactnative.dev/blog/2025/06/12/react-native-0.80 |
|
Just to confirm, facebook/metro#1516 still happens on 0.80 |
|
As temporal solution, I created release This build disables RUM, but at least unblocks customers that want to use react-native 0.79+. |
|
@miquelbeltran just a thought if you need to support older Metro versions - the bug occurred when using multiple optional dependencies in the same file or other dependencies after unresolvable optional dependencies. You could workaround that by splitting out the optional dependencies into their own files: // MaybeNewXHRInterceptorModule.ts
let XHRInterceptorModule = null;
try {
XHRInterceptorModule = require('react-native/src/private/inspector/XHRInterceptor');
} catch {}
module.exports = XHRInterceptorModule;// MaybeOldXHRInterceptorModule.ts
let XHRInterceptorModule = null;
try {
XHRInterceptorModule = require('react-native/Libraries/Network/XHRInterceptor');
} catch {}
module.exports = XHRInterceptorModule;// RealUserMonitor.ts
import MaybeOldXHRInterceptorModule from './MaybeOldXHRInterceptorModule';
import MaybeNewXHRInterceptorModule from './MaybeNewXHRInterceptorModule';
const XHRInterceptorModule = MaybeNewXHRInterceptorModule ?? MaybeOldXHRInterceptorModule;That should work with all RN/Metro versions. Heads up though that the JS Stable API project will hide this module in future versions, so I'd recommend raising your use case here to create the public APIs you'll need. |
|
Thanks for the tip @robhogan I will check the discussion as well |
There was a problem hiding this comment.
CI script changed to use the build scripts in the package.json
There was a problem hiding this comment.
Removed unused test file
There was a problem hiding this comment.
Required for Android SDK updates
There was a problem hiding this comment.
Automatically changed by build process
There was a problem hiding this comment.
demo package updates, the use of the tgz is due to using the build scripts in the package.json. Since this is a demo project, that's no problem
There was a problem hiding this comment.
SDK updates are mostly on dev-dependencies that don't affect customers. async-storage update is required for RN 0.79+
There was a problem hiding this comment.
The code added in this module ensures that the SDK doesn't break if XHRInterceptorModule is not available, still a warning error will be displayed to developers
Olwiba
left a comment
There was a problem hiding this comment.
Yep, reads all good to me - nice work 🚀
fix: Support React-Native 0.80
Description 📝
Closes: #169
Type of change
Updates
XHRInterceptorto support the 0.79 API changesTest plan 🧪
Author to check 👓
Reviewer to check ✔️