Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress LogBox for low-severity errors and warnings if Fusebox console is available #44648

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

motiz88
Copy link
Contributor

@motiz88 motiz88 commented May 22, 2024

Summary:
Changelog: [Internal]

Showing warnings and low-severity errors in LogBox is noisy, confusing for web developers, and not the best use of screen real estate on mobile platforms. Since the Fusebox console offers a superior experience, as of this diff we'll suppress warnings and low-severity errors in LogBox if we detect that Fusebox is available.

The first time a warning or error is suppressed (i.e. at most once per app launch), we'll show a "log" level notification pointing the user towards Fusebox. When the notification is clicked, we call the DevSettings.openDebugger method and dismiss it.

The wording of the notification ("Open debugger to view logs") is intentional:

  1. It's short enough to fit on small screens in its entirety.
  2. It doesn't actually say "click here to open the debugger". This is for the best because DevSettings.openDebugger is a best-effort method that might fail, and in the current implementation there's no reliable feedback to the user about the success/failure of the launch.

Differential Revision: D57681446

Summary:
Changelog: [Internal]

Adds a private API that gives JS the ability to trigger the same "open debugger" action as in the Dev Menu. This is in preparation for changes to LogBox.

For simplicity, this method operates on a best-effort basis - i.e. it doesn't report the success or failure (or failure reason) of the launch.

Differential Revision: D57681447
…le is available

Summary:
Changelog: [Internal]

Showing warnings and low-severity errors in LogBox is noisy, confusing for web developers, and not the best use of screen real estate on mobile platforms. Since the Fusebox console offers a superior experience, as of this diff we'll suppress warnings and low-severity errors in LogBox if we detect that Fusebox is available.

*The first time* a warning or error is suppressed (i.e. at most once per app launch), we'll show a "log" level notification pointing the user towards Fusebox. When the notification is clicked, we call the `DevSettings.openDebugger` method and dismiss it.

The wording of the notification ("Open debugger to view logs") is intentional:

1. It's short enough to fit on small screens in its entirety.
2. It doesn't actually say "*click here* to open the debugger". This is for the best because `DevSettings.openDebugger` is a best-effort method that might fail, and in the current implementation there's no reliable feedback to the user about the success/failure of the launch.

Differential Revision: D57681446
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 22, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57681446

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,575,460 +16,380
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,929,180 +16,368
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: b8f3478
Branch: main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants