turborepo
3d44253b - Turbopack: Defer calculating source positions until needed (#6359)

Commit
2 years ago
Turbopack: Defer calculating source positions until needed (#6359) Previously, many references would eagerly calculate their row/column in the source code even if they did not cause an `Issue` to occur. This requires reading the source code and calculating this information from byte offsets from the swc node's `Span`. This introduces `LazyIssueSource`, which simply wraps the `Source` and the start/end byte offsets from the swc span. This is only converted to an `IssueSource` when the issue's source location is accessed.
Author
Parents
Loading