Remove redundant Nitro logs for better UX
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 117
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 44
Description
What's happening?
I think it would be great to remove these logs, since developers won’t know what they’re about. They could be behind an extra flag for debugging purposes or something similar. I was also approached by Kadi from Expo, who raised the same concern.
Reproduceable Code
Register any Hybrid on native side and check your JS logs.
Relevant log output
[expoexample.debug.dylib] [INFO] [Nitro.JSICache] Destroying JSICache...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Unregistering HybridObject "UnistylesRuntime"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Unregistering HybridObject "UnistylesStyleSheet"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Unregistering HybridObject "UnistylesShadowRegistry"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Registering HybridObject "UnistylesRuntime"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Successfully registered HybridObject "UnistylesRuntime"!
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Registering HybridObject "UnistylesStyleSheet"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Successfully registered HybridObject "UnistylesStyleSheet"!
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Registering HybridObject "UnistylesShadowRegistry"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectRegistry] Successfully registered HybridObject "UnistylesShadowRegistry"!
[expoexample.debug.dylib] [INFO] [Nitro.Dispatcher] Installing global Dispatcher Holder into Runtime "HermesRuntime[RNBridgeless] (com.facebook.react.runtime.JavaScript)"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridNitroModulesProxy"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridObject"...
[expoexample.debug.dylib] [INFO] [Nitro.JSICache] Creating new JSICache<T> for runtime HermesRuntime[RNBridgeless] (com.facebook.react.runtime.JavaScript)..
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridShadowRegistry"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridUnistylesShadowRegistrySpec"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridStyleSheet"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridUnistylesStyleSheetSpec"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridUnistylesRuntime"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridUnistylesRuntimeSpec"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridUnistylesStatusBarSpec"...
[expoexample.debug.dylib] [INFO] [Nitro.HybridObjectPrototype] Creating new JS prototype for C++ instance type "HybridUnistylesNavigationBarSpec"...
Device
iPhone 16 Pro Max
Nitro Modules Version
0.29.6
Nitrogen Version
0.29.6
Can you reproduce this issue in the Nitro Example app here?
Yes, I can reproduce the same issue in the Example app here
Additional information
- I am using Expo
- I am using nitrogen
- I have read and followed the Troubleshooting Guide.
- I created a reproduction PR to reproduce this issue here in the nitro repo. (See Contributing for more information)
- I searched for similar issues in this repository and found none.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the messages in the Nitro Example app using the reported Hybrid registration scenario, then search the Nitro sources for the listed Nitro.JSICache, HybridObjectRegistry, Dispatcher, and HybridObjectPrototype log text. Determine which logs should be silent by default and whether an existing debug option can cover them; done means the redundant logs no longer appear during normal use and the reproduction still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, react-native
- Domain
- developer-experience, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100