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

Restore cache functionality (default to off) #951

Closed
andrewmackrodt opened this issue Jan 28, 2020 · 5 comments · May be fixed by #1364
Closed

Restore cache functionality (default to off) #951

andrewmackrodt opened this issue Jan 28, 2020 · 5 comments · May be fixed by #1364

Comments

@andrewmackrodt
Copy link

#701 removed caching and I find performance of using ts-node unbelievably slow in any version beyond v7.0.1. The commit which removes caching behavior is in response to #672 (Cache doesn't take modified dependencies into account). I use ts-node in combination with TS_NODE_FILES=true and have never hit this problem nor was I able to reproduce the issue.

It seems that the maintainer is willing to accept a PR to add caching behavior in #920. Before I submit a PR, I'd like to confirm if it will be acceptable to restore the previous behavior, but have caching disabled by default and update the README to state that this is discouraged and link th #672 as to the reason why?

@cspotcode
Copy link
Collaborator

@andrewmackrodt

Discussion about how to re-add caching is over here: #908

That thread has my thoughts on how to implement disk caching. For my use-cases, I'm focused on using it with transpile-only mode, since my projects perform typechecking as a separate step. It should be safe to enable automatically with transpile-only when we're not using transformers. For your case it would still need to be behind an opt-in flag, as you say. Even then, maintainers might be against it if it causes an influx of false bug reports. But I can't speak for anyone else.

@blakeembrey
Copy link
Member

SGTM behind a flag 👍

@ecraig12345
Copy link

Do you know when you'll be able to get to this? My team would like to use ts-node but the performance without caching is a huge blocker.

@cspotcode
Copy link
Collaborator

@ecraig12345 not sure, pull requests are welcome. In the meantime you can use typescript-cached-transpile, linked over here: #908

Turning on --transpile-only mode should make a big difference, too, maybe enough that you don't need caching.

@cspotcode
Copy link
Collaborator

cspotcode commented Jul 22, 2022

Closing since I doubt we'll get a PR for this, and ts-node --swc gives as much speed as you'd get with caching, but without the complexity of caching.

If any sort of caching does get implemented, it'll probably be related to TS's incremental builds.

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 a pull request may close this issue.

4 participants