margelo / margelo/nitro

Remove redundant Nitro logs for better UX

Open
#883 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

nitro-core
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.

Image
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.