Skip to content

Route typed emit paths to per-file trace threads - #65468

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/emit-trace-threads
Nov 14, 2026
Merged

Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/emit-trace-threads

Conversation

@jakebailey

Copy link
Copy Markdown
Member

I broke this in my typed paths PR. Oops. Yay any.

Emit events carry rooted file paths, so the string-only router placed
unrelated output files on Main. Recognize rooted file paths in the
shared routing logic while keeping serialized trace arguments intact.

Exercise JavaScript and declaration paths through trace.json, including
overlapping file events, string-path thread identity, and empty-path
fallback. Update the existing declaration trace baselines accordingly.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 04:43
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 13, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the typed-path trace-thread routing fix.

No open issues 🎉

What changed in this PR

Fixes a tracing regression introduced by typed paths in the native TypeScript compiler. Emit events with RootedFilePath arguments now use per-file trace threads instead of falling back to the main thread.

Changes:

  • Recognizes typed paths alongside strings when selecting trace threads.
  • Adds regression tests for JavaScript and declaration emit routing, empty-path fallback, and duration nesting.
  • Updates three trace baselines to reflect declaration output threads.
File Description
tsc/​testdata/​baselines/​reference/​tsc/​generateTrace/​generateTrace-creates-types-in-a-stable-order.js Records declaration emit on its output-file thread.
tsc/​testdata/​baselines/​reference/​tsc/​generateTrace/​generateTrace-creates-static-index-signature-sibling-types-in-a-stable-order.js Updates static index-signature tracing expectations.
tsc/​testdata/​baselines/​reference/​tsc/​generateTrace/​generateTrace-creates-index-signature-sibling-types-in-a-stable-order.js Updates index-signature tracing expectations.
tsc/​internal/​tracing/​tracing.go Handles RootedFilePath values in thread selection.
tsc/​internal/​tracing/​tracing_test.go Verifies typed emit paths use stable, distinct file threads.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 13, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 13, 2026
Merged via the queue into microsoft:main with commit 2244019 Nov 14, 2026
34 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the compiler-fixes/emit-trace-threads branch November 14, 2026 00:03
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants