Skip to content

Commit

Permalink
Ignore more files/packages by default in LogBox (#38217)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38217

Marks more filename patterns as "internal call sites" which has the effect of collapsing them by default in LogBox (and skipping them for the purpose of providing a code frame).

Changelog: [General][Fixed] Hide Babel helpers and other core files from LogBox stack traces by default

Reviewed By: cortinico, huntie

Differential Revision: D47230876

fbshipit-source-id: fe2d59d975c61cbdfd7b8da42288e284f3ab0739
  • Loading branch information
motiz88 authored and facebook-github-bot committed Jul 6, 2023
1 parent ff40138 commit af73a75
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/metro-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ const {getDefaultConfig: getBaseConfig, mergeConfig} = require('metro-config');

const INTERNAL_CALLSITES_REGEX = new RegExp(
[
'/Libraries/Renderer/implementations/.+\\.js$',
'/Libraries/BatchedBridge/MessageQueue\\.js$',
'/Libraries/YellowBox/.+\\.js$',
'/Libraries/Core/.+\\.js$',
'/Libraries/LogBox/.+\\.js$',
'/Libraries/Core/Timers/.+\\.js$',
'/Libraries/WebSocket/.+\\.js$',
'/Libraries/Network/.+\\.js$',
'/Libraries/Pressability/.+\\.js$',
'/Libraries/Renderer/implementations/.+\\.js$',
'/Libraries/Utilities/.+\\.js$',
'/Libraries/vendor/.+\\.js$',
'/node_modules/react-devtools-core/.+\\.js$',
'/node_modules/react-refresh/.+\\.js$',
'/node_modules/scheduler/.+\\.js$',
'/Libraries/WebSocket/.+\\.js$',
'/Libraries/YellowBox/.+\\.js$',
'/metro-runtime/.+\\.js$',
'/node_modules/@babel/runtime/.+\\.js$',
'/node_modules/event-target-shim/.+\\.js$',
'/node_modules/invariant/.+\\.js$',
'/node_modules/react-devtools-core/.+\\.js$',
'/node_modules/react-native/index.js$',
'/metro-runtime/.+\\.js$',
'/node_modules/react-refresh/.+\\.js$',
'/node_modules/scheduler/.+\\.js$',
'^\\[native code\\]$',
].join('|'),
);
Expand Down

0 comments on commit af73a75

Please sign in to comment.