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

Improve display of filenames in component stack #12059

Merged
merged 7 commits into from
Aug 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add explanatory comment
  • Loading branch information
billyjanitsch authored and gaearon committed Aug 9, 2018
commit 1add3631bd2acdc13203b44eff8ad17cf0718b35
2 changes: 2 additions & 0 deletions packages/shared/describeComponentFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default function(
(name || 'Unknown') +
(source
? ' (at ' +
// Extract filename, or folder/filename in the case of an
// index file, e.g. "Foo.js", or "Bar/index.js"
source.fileName.match(/[^\\\/]*([\\\/]index\.[^\\\/]+)?$/)[0] +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment with different things it’s supposed to match?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

':' +
source.lineNumber +
Expand Down