Skip to content

Don't depend on vfstest for transpile - #64009

Open
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:transpile-production-vfs
Open

Don't depend on vfstest for transpile#64009
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:transpile-production-vfs

Conversation

@jakebailey

Copy link
Copy Markdown
Member

The transpile package used the test FS as a VFS, but this brings in all of the testing code.

Use a local FS for this instead, which saves something like 100KB of binary.

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.

Pull request overview

Replaces the test-only virtual filesystem dependency with a lightweight transpilation filesystem to reduce binary size.

Changes:

  • Removes the vfstest dependency.
  • Adds a map-backed filesystem for synthesized input and library files.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tsc/internal/transpile/transpile.go Uses the local transpilation filesystem.
tsc/internal/transpile/fs.go Implements required filesystem operations.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.


func (fs *transpileFS) DirectoryExists(path string) bool {
for file := range fs.files {
if tspath.ContainsPath(path, file, tspath.ComparePathsOptions{UseCaseSensitiveFileNames: true}) {
Comment on lines +17 to +19
func (fs *transpileFS) UseCaseSensitiveFileNames() bool {
return true
}
@andrewbranch

Copy link
Copy Markdown
Member

Ah, I had a fix for this locally, but mine is broader than it needs to be. I didn't think about how little of a FS surface transpile needs.

If you fix the Copilot comments, I'll see if I can make module resolution not occur at all in a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

3 participants