Catch up to the merged Content Mapper API (microsoft/typescript-go#4712) - #2
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upstream PR microsoft/typescript-go#4712 merged into
mainon 2026-08-19 (merge commit01b9e72). This PR updates the PoC to work against the merged upstream instead of the pre-mergecontent-mappersbranch ofandrewbranch/typescript-go(d07c1ff).Protocol change requiring a code fix
The merged host sends
openProjectto every mapper before its firsttransformin a project — pre-merge, onlydynamicConfigmappers received it — andtransformparams now carry aprojectHandle. Our server answeredopenProjectwith "method not found", which fails the transform under the merged protocol (and five failures disable the mapper).server.tsnow:openProjectwith{}— a non-dynamicConfigmapper must return noconfigIdentityand nowatchedFiles;closeProjectwithnull;(fileName, content), so project handles need no bookkeeping).Everything else is unchanged at merge: manifest format (
typescript.contentMapper), tsconfigcontentMappersentries, span-map tuple layout and kinds,--runExternalCodeflag, diagnostics shape, protocol version 1.Volta-shim hang: fixed upstream
The teardown hang diagnosed in
UPSTREAM-COMMENT.md(tsgo hanging forever whennodeis a resident launcher shim) was fixed in the merged version:childProcess.Closenow closes the mapper's stdin first (firing the protocol's exit-on-EOF path) and bounds the reap withcmd.WaitDelay = time.Second, with regression testTestChildProcessCloseDoesNotWaitForLauncherDescendants. 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:
tsgo -p demo --runExternalCode→ exit 0styles.buton→TS2551with spelling suggestion at the access site inapp.tscss-modules1001at the correct position after multibyte textTS100024at thecontentMapperskey.button(Verbatim) and.card-title(Atom) selectorsDocs (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