Yarn-pnp: Attach to session and hoist filesystem overrides#5
Merged
Merged
Conversation
ebe9dc0 to
e916a45
Compare
GGomez99
reviewed
Apr 15, 2026
GGomez99
approved these changes
Apr 16, 2026
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.
Overview
This diff removes some of the intermediary filesystem overrides and hoists those to the Go entrypoints for simplicity. We still have to plumb the pnpApi down so that it can be reached during module resolution. This is now done by attaching pnpApi to "session" instead of arbitarily passing it as an argument in various places, except in the boundary cases where session is not passed further, where we then pass the pnpApi itself from the session.
In general this should simplify the amount of touch points yarn pnp has with typescript-go, reducing merge conflicts or breakages.
Additionally, the reuse of entrypoint pnpApi initializations and removal of extra calls to "pnp.InitPnpApi" fixes a panic with the following stack trace when running the typescript-go binary in --api mode:
Test Plan
Build binary locally and test in API mode as well as with the binary powering tsserver in VS Code.