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

Discussion: Rewrite and merge ttypescript and ts-patch #113

Closed
nonara opened this issue Feb 5, 2021 · 2 comments
Closed

Discussion: Rewrite and merge ttypescript and ts-patch #113

nonara opened this issue Feb 5, 2021 · 2 comments

Comments

@nonara
Copy link
Contributor

nonara commented Feb 5, 2021

Hi all!

I've been thinking about this for awhile, and I thought I'd go ahead and gauge interest.

ttypescript and to a lesser extent, ts-patch, have been filling a void for awhile now. I know that they have been very helpful for many of us who needed to do more with the TS compiler. With that said, in hindsight—gauging from personal use and feature requests—I believe that there is room for improvement in our overall design which could make for a much more powerful and perhaps more complete plugin architecture.

Update

Given the issues with ttypescript and its unmaintained status and the current limitation with ts-patch, I think it's time to do the rewrite.

I've sketched out the design. Here are the highlights:

  • Will not directly modify ts files (better for yarn)
  • Will allow persistent alias overwriting (ie. can name the compiler tsc or something else, default is tspc)
  • Supports custom patches which allow actual AST transformation of typescript libraries themselves, opening the door for packaged middleware
  • Uses smart caching for core patch and custom patches applied to typescript modules (improves speed)
  • Single plugin package can contain multiple before, after, afterDeclarations transformers + patches
  • Will maintain support for current ttypescript style transformer packages

I've decided to keep the name for simplicity and visibility. So the rewrite will be housed in ts-patch v2.

You can follow nonara/ts-patch#40 for updates

@cspotcode
Copy link

Definitely in favor of having one tool for adding additional, pluggable features to TS. I started brainstorming in https://github.com/cspotcode/hookable-typescript but never had time to go anywhere with it.

I'd also like the option to avoid modifying typescript/tsc/tsserver in situations where other tools in the dependency tree should get access to unmodified copies of tsc. Like how ttsc and tsc can live side-by-side.

I'm also not sure how writing to the filesystem works with yarn2's PnP cache. I believe those zip files are mounted read-only.

@nonara
Copy link
Contributor Author

nonara commented Jul 7, 2021

Development is underway!

Discussion: nonara/ts-patch#40
Dev Branch: https://github.com/nonara/ts-patch/tree/v2

@cevek cevek closed this as completed Nov 25, 2021
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

No branches or pull requests

3 participants