Skip to content

Catch up to the merged Content Mapper API (microsoft/typescript-go#4712) - #2

Merged
uhyo merged 2 commits into
masterfrom
claude/poc-upstream-pr-sync-lhcqip
Aug 20, 2026
Merged

Catch up to the merged Content Mapper API (microsoft/typescript-go#4712)#2
uhyo merged 2 commits into
masterfrom
claude/poc-upstream-pr-sync-lhcqip

Conversation

@uhyo

@uhyo uhyo commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Upstream PR microsoft/typescript-go#4712 merged into main on 2026-08-19 (merge commit 01b9e72). This PR updates the PoC to work against the merged upstream instead of the pre-merge content-mappers branch of andrewbranch/typescript-go (d07c1ff).

Protocol change requiring a code fix

The merged host sends openProject to every mapper before its first transform in a project — pre-merge, only dynamicConfig mappers received it — and transform params now carry a projectHandle. Our server answered openProject with "method not found", which fails the transform under the merged protocol (and five failures disable the mapper).

server.ts now:

  • acknowledges openProject with {} — a non-dynamicConfig mapper must return no configIdentity and no watchedFiles;
  • acknowledges closeProject with null;
  • remains stateless (transforms are still a pure function of (fileName, content), so project handles need no bookkeeping).

Everything else is unchanged at merge: manifest format (typescript.contentMapper), tsconfig contentMappers entries, span-map tuple layout and kinds, --runExternalCode flag, diagnostics shape, protocol version 1.

Volta-shim hang: fixed upstream

The teardown hang diagnosed in UPSTREAM-COMMENT.md (tsgo hanging forever when node is a resident launcher shim) was fixed in the merged version: childProcess.Close now closes the mapper's stdin first (firing the protocol's exit-on-EOF path) and bounds the reap with cmd.WaitDelay = time.Second, with regression test TestChildProcessCloseDoesNotWaitForLauncherDescendants. The README's PATH-workaround warning is replaced with a resolution note.

Verification (against post-merge main @ 16c25522)

All acceptance results are byte-identical to the original run:

  • ✅ Clean type-check: tsgo -p demo --runExternalCode → exit 0
  • styles.butonTS2551 with spelling suggestion at the access site in app.ts
  • ✅ CSS syntax error → css-modules1001 at the correct position after multibyte text
  • ✅ Missing flag → TS100024 at the contentMappers key
  • ✅ Go-to-definition through the span map lands in the .button (Verbatim) and .card-title (Atom) selectors
  • ✅ Unit tests: 11/11 pass

Docs (README, RESULTS, NOTES, UPSTREAM-COMMENT) now reference the merged upstream, with post-merge protocol changes called out in NOTES §5.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GAsGP2XP8fWAN1PtaTRGDS


Generated by Claude Code

claude added 2 commits August 20, 2026 00:08
The upstream PR merged into microsoft/typescript-go main on 2026-08-19
(01b9e72). Two things changed for this PoC:

- The host now sends openProject/closeProject to every mapper, not just
  dynamicConfig ones, and transform params carry a projectHandle. The
  server previously answered openProject with 'method not found', which
  fails the transform under the merged protocol; it now acknowledges
  openProject with an empty result (required for a static mapper) and
  closeProject with null, staying stateless.

- The Volta-shim teardown hang reported in UPSTREAM-COMMENT.md was fixed
  upstream (stdin close + WaitDelay in childProcess.Close, with a
  regression test), so the PATH workaround warning is replaced with a
  resolution note.

Docs now point at microsoft/typescript-go main instead of the
andrewbranch/typescript-go content-mappers branch. All acceptance
results re-verified against post-merge commit 16c25522 with identical
output: clean check, unknown-class error, CSS-syntax diagnostic,
missing-flag behavior, go-to-definition through Verbatim and Atom
segments, and 11/11 unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAsGP2XP8fWAN1PtaTRGDS
The hang is fixed upstream, so it's history rather than setup guidance;
the record lives in NOTES.md and UPSTREAM-COMMENT.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAsGP2XP8fWAN1PtaTRGDS
@uhyo
uhyo merged commit be19ef5 into master Aug 20, 2026
@uhyo
uhyo deleted the claude/poc-upstream-pr-sync-lhcqip branch August 20, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants