Unverified Commit 39833fdf authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

[Turbopack] formatIssue is expensive, so avoid it if possible (#71117)

### What?

formatIssue takes 300-400ms (probably due to babel-codeframe), so we
want to avoid it for issues that are not reported
parent d974000d
...@@ -240,14 +240,16 @@ export function processIssues( ...@@ -240,14 +240,16 @@ export function processIssues(
continue continue
const issueKey = getIssueKey(issue) const issueKey = getIssueKey(issue)
const formatted = formatIssue(issue)
newIssues.set(issueKey, issue) newIssues.set(issueKey, issue)
if (issue.severity !== 'warning') { if (issue.severity !== 'warning') {
relevantIssues.add(formatted) if (throwIssue) {
const formatted = formatIssue(issue)
relevantIssues.add(formatted)
}
// if we throw the issue it will most likely get handed and logged elsewhere // if we throw the issue it will most likely get handed and logged elsewhere
if (logErrors && !throwIssue && isWellKnownError(issue)) { else if (logErrors && isWellKnownError(issue)) {
const formatted = formatIssue(issue)
Log.error(formatted) Log.error(formatted)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment