Description
Hey,
when profiling a react native app using the react devtools (as integrated in the new dev tools), its desirable to have react run as close as to release version as possible.
For that reason we have the ReactFabric-profiling implementation.
In the past when wanting to profile with the react devtools i would:
- Disable dev mode in the bundling setting, so that it creates release optimized builds
- In
node_modules/react-native/Libraries/Renderer/shims/ReactFabric.js i would change ReactFabric-prod to ReactFabric-profiling
- Then i would make some changes in the following files to replace the
__DEV__ check with true:
node_modules/react-native/Libraries/Core/setUpReactDevTools.js
node_modules/react-native/Libraries/Core/setUpDeveloperTools.js
node_modules/react-native/Libraries/Core/InitializeCore.js
This doesn't work anymore, and i get an error during runtime:
TypeError: _jsxDEV is not a function (it is undefined)
Now i understand that i can profile in dev mode, but to have more realistic results and avoid false positives I think its very beneficial to switch to the profiling build.
I would either appreciate clear guides on how to turn those on, or discuss if something like adding to the rn dev settings an option to toggle a profiling build (I can make a PR for that, just wanted to discuss first).
Steps to reproduce
See the steps listed above in a react native app to try to turn on profiling mode
React Native Version
0.79.5
Output of npx @react-native-community/cli info
System:
OS: macOS 15.5
CPU: (14) arm64 Apple M4 Pro
Memory: 119.45 MB / 48.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.14.0
path: /nix/store/2yk2lr8y92mmkr4kcwwdlnr4hscvnps2-nodejs-22.14.0/bin/node
Yarn:
version: 1.22.19
path: ~/.nix-profile/bin/yarn
npm:
version: 10.9.2
path: /nix/store/2yk2lr8y92mmkr4kcwwdlnr4hscvnps2-nodejs-22.14.0/bin/npm
Watchman:
version: 2024.03.11.00
path: /Users/hannogodecke/Documents/rn/.local/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /Users/hannogodecke/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.2
- iOS 18.2
- macOS 15.2
- tvOS 18.2
- visionOS 2.2
- watchOS 11.2
Android SDK:
API Levels:
- "35"
Build Tools:
- 34.0.0
- 35.0.0
- 35.0.1
- 36.0.0
System Images:
- android-36 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.25410.109.2511.13752376
Xcode:
version: 16.2/16C5032a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.15
path: /usr/bin/javac
Ruby:
version: 3.3.4
path: /Users/hannogodecke/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.0.0
wanted: 15.0.0
react:
installed: 19.1.0
wanted: catalog:react
react-native:
installed: 0.79.5
wanted: "*"
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Screenshots and Videos
No response
Description
Hey,
when profiling a react native app using the react devtools (as integrated in the new dev tools), its desirable to have react run as close as to release version as possible.
For that reason we have the
ReactFabric-profilingimplementation.In the past when wanting to profile with the react devtools i would:
node_modules/react-native/Libraries/Renderer/shims/ReactFabric.jsi would changeReactFabric-prodtoReactFabric-profiling__DEV__check with true:node_modules/react-native/Libraries/Core/setUpReactDevTools.jsnode_modules/react-native/Libraries/Core/setUpDeveloperTools.jsnode_modules/react-native/Libraries/Core/InitializeCore.jsThis doesn't work anymore, and i get an error during runtime:
Now i understand that i can profile in dev mode, but to have more realistic results and avoid false positives I think its very beneficial to switch to the profiling build.
I would either appreciate clear guides on how to turn those on, or discuss if something like adding to the rn dev settings an option to toggle a profiling build (I can make a PR for that, just wanted to discuss first).
Steps to reproduce
See the steps listed above in a react native app to try to turn on profiling mode
React Native Version
0.79.5
Output of
npx @react-native-community/cli infoScreenshots and Videos
No response