Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] support for project references in languageService codepath #1111

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cspotcode
Copy link
Collaborator

@cspotcode cspotcode commented Aug 12, 2020

blocked by merge of #970

Project references are basically an extension to TypeScript's resolver. It will intelligently figure out when you're importing the output of a referenced project, and will internally map to the source .ts file for typechecking. I think if we pair this with the isExternalLibraryImport override in #970, then we can reliably transpile these files.

Internally the compiler monkey-patches CompilerHost so that it "lies" about the filesystem. I'm pretty sure it pretends that the emitted output of project references exists on disk, because this allows the resolver to resolve before compilation is complete. It has an @internal API it uses to expose a reference to this monkey-patched CompilerHost.

Missing is a runtime resolver. If someone imports from a project reference, typechecking might be happy, but node will still complain the file doesn't exist. Should this happen in tsconfig-paths? Should ts-node get into the business of hooking node's resolvers itself? We already rewrite .js to .ts in the ESM resolver.

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.

1 participant