react-native-macos/React/Modules
Michał Pierzchała 49d26eb0c4 cleanup RedBox message and stack output (#24662)
Summary:
Cleanup RedBox messages and stack traces. This PR consists of 2 changes (I'm good with splitting them up if you'd like):

- [general] filter out some of the internal callsites from the symbolicated stack (I thought about using monospace font for title with code frame, but it looks weird)
- [ios][android] strip ANSI characters (coming from colored Babel code frame) from the error message

I think it's ok to strip it inside native handlers so we can still have a colorful code frame in the terminal output.

**JS Code frame:**

|before|after|
|--|--|
|<img width="400" alt="Screenshot 2019-04-30 at 12 32 05" src="https://user-images.githubusercontent.com/5106466/56956590-ef678d80-6b44-11e9-9019-6801f050ab0d.png">|<img width="400" alt="Screenshot 2019-04-30 at 12 52 43" src="https://user-images.githubusercontent.com/5106466/56957302-f42d4100-6b46-11e9-869b-ea9c7ce5b90f.png">|

|before|after|
|--|--|
|![image](https://user-images.githubusercontent.com/5106466/56959472-c8618980-6b4d-11e9-84be-6261d8375f4a.png)|![image](https://user-images.githubusercontent.com/5106466/56959463-bc75c780-6b4d-11e9-9d8b-25ffe46c87cf.png)|

**Filtered stack traces:**

|before|after|
|--|--|
|<img width="50%" alt="Screenshot 2019-04-30 at 12 27 21" src="https://user-images.githubusercontent.com/5106466/56956641-0908d500-6b45-11e9-8cdc-8c2a34a071e5.png"><img width="50%" alt="Screenshot 2019-04-30 at 12 27 28" src="https://user-images.githubusercontent.com/5106466/56956642-0908d500-6b45-11e9-921c-fabfb8515cc0.png">|<img width="100%" alt="Screenshot 2019-04-30 at 12 26 55" src="https://user-images.githubusercontent.com/5106466/56956650-0efeb600-6b45-11e9-9f5f-f10dd69580d1.png">|

There's still a lot of places that are hard to read, but I think this is a good start towards more readable errors.

cc cpojer

[General][Changed] - Cleanup RedBox message and stack output
Pull Request resolved: https://github.com/facebook/react-native/pull/24662

Differential Revision: D15147571

Pulled By: cpojer

fbshipit-source-id: 1de4e521af988fa7fc709b6accd0ddd984388e72
2019-04-30 07:35:14 -07:00
..
RCTAccessibilityManager.h - add more iOS flags into AccessibilityInfo (#23913) 2019-03-15 11:34:20 -07:00
RCTAccessibilityManager.m - add more iOS flags into AccessibilityInfo (#23913) 2019-03-15 11:34:20 -07:00
RCTAlertManager.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTAlertManager.m Fixes alert view block first responder (#23240) 2019-02-01 03:51:24 -08:00
RCTAppState.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTAppState.m Remove android initialAppState fallback check (#23487) 2019-02-17 15:32:13 -08:00
RCTAsyncLocalStorage.h Expose AsyncLocalStorage get/set methods (#18454) 2019-01-29 08:54:16 -08:00
RCTAsyncLocalStorage.m Always write the manifest in multiRemove (#18613) 2019-01-29 09:15:30 -08:00
RCTClipboard.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTClipboard.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTDevSettings.h iOS changes to switch to JSI 2018-10-18 01:06:24 -07:00
RCTDevSettings.mm TM iOS: disable remote debugging toggle when TurboModule is active 2019-03-01 14:30:35 -08:00
RCTDeviceInfo.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTDeviceInfo.m Calculate Correct Window Dimensions for iOS (#19932) 2019-04-10 14:25:14 -07:00
RCTEventEmitter.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTEventEmitter.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTExceptionsManager.h Fix nullability warnings in RCTExceptionsManager (#24467) 2019-04-17 08:36:14 -07:00
RCTExceptionsManager.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTI18nManager.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTI18nManager.m Start using getConstants 2019-02-04 17:46:56 -08:00
RCTI18nUtil.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTI18nUtil.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTKeyboardObserver.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTKeyboardObserver.m Expose isLocalUserInfoKey to keyboard event notifications (#23245) 2019-02-01 14:32:19 -08:00
RCTLayoutAnimation.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTLayoutAnimation.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTLayoutAnimationGroup.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTLayoutAnimationGroup.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTRedBox.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTRedBox.m cleanup RedBox message and stack output (#24662) 2019-04-30 07:35:14 -07:00
RCTRedBoxExtraDataViewController.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTRedBoxExtraDataViewController.m Fix xcode warnings (#23565) 2019-02-20 18:46:23 -08:00
RCTSourceCode.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTSourceCode.m Start using getConstants 2019-02-04 17:46:56 -08:00
RCTStatusBarManager.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTStatusBarManager.m Fixed deprecated declarations warning (#23625) 2019-02-24 19:38:58 -08:00
RCTSurfacePresenterStub.h Move Bridge RCTSurfacePresenterStub category implementation to .m file (#23888) 2019-03-15 11:22:53 -07:00
RCTSurfacePresenterStub.m Move Bridge RCTSurfacePresenterStub category implementation to .m file (#23888) 2019-03-15 11:22:53 -07:00
RCTTVNavigationEventEmitter.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTVNavigationEventEmitter.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTiming.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTiming.m Fire timers in the background via NSTimer (#23674) 2019-03-26 12:24:37 -07:00
RCTUIManager.h Implement the nativeID functionality in a more efficient way (#23662) 2019-03-05 09:41:19 -08:00
RCTUIManager.m avoid startup deadlock with dispatch_async's 2019-04-12 12:25:10 -07:00
RCTUIManagerObserverCoordinator.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTUIManagerObserverCoordinator.mm Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTUIManagerUtils.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTUIManagerUtils.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00