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

Collapse YellowBox/DevTools frames in Metro config #780

Merged
merged 2 commits into from
Oct 11, 2019

Conversation

motiz88
Copy link
Collaborator

@motiz88 motiz88 commented Oct 10, 2019

Summary:

React Native master (facebook/react-native@cf4d45e) is no longer stripping YellowBox and React DevTools stack frames from warnings with the framesToPop mechanism, which we will be deprecating and ultimately removing from the default error reporter too. The recommended approach going forward is to rely on Metro's customizeFrame for all postprocessing of stack traces.

This commit updates the default Metro config to skip stack frames in YellowBox and React DevTools code, thus preserving the old user-visible behaviour. As for compatibility and versioning: It is harmless to run this change against older RN versions, but the next RN release should include this CLI change. (cc @cpojer)

Test Plan:

We've made an identical change to our internal Metro config.

React Native master (note: commit not pushed to GitHub yet) is no longer stripping `YellowBox` and React DevTools stack frames from warnings with the `framesToPop` mechanism, which we will be deprecating and ultimately removing from the default error reporter too. The recommended approach going forward is to rely on Metro's `customizeFrame` for all postprocessing of stack traces.

This commit updates the default Metro config to skip stack frames in `YellowBox` and React DevTools code, thus preserving the old behaviour. As for compatibility and versioning: It is harmless to run this change against older RN versions, but the next RN release should include this CLI change. (cc @cpojer)
@thymikee
Copy link
Member

Mind fixing the linter? Looks like the regex could be simplified

@motiz88
Copy link
Collaborator Author

motiz88 commented Oct 10, 2019

Whoops, the regex actually needs an extra backslash to correctly escape the . character. I'll fix it when I'm back at a keyboard tomorrow morning.

@motiz88
Copy link
Collaborator Author

motiz88 commented Oct 11, 2019

The linter is happy now. Doesn't look like the e2e test failure is relevant.

@thymikee thymikee merged commit dd1fb89 into react-native-community:master Oct 11, 2019
@thymikee
Copy link
Member

Thank you!

facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Oct 22, 2019
Summary:
Removes support for the non-standard `framesToPop` error property from React Native. Redboxes will now ignore this field. The way to skip uninformative frames in stack traces going forward is to use Metro's `customizeFrame` config option, for which the React Native CLI ships useful defaults (see: react-native-community/cli#596, react-native-community/cli#780)

Changelog: [General] [Removed] - Remove support for framesToPop from ExceptionsManager

Reviewed By: rickhanlonii

Differential Revision: D17877444

fbshipit-source-id: 04aa332c45ad35a99ae20e05fb87b34c91a557ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants