Skip to content

upgrade ts-node to the latest version #4253

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

Closed
williamstein opened this issue Nov 25, 2019 · 0 comments
Closed

upgrade ts-node to the latest version #4253

williamstein opened this issue Nov 25, 2019 · 0 comments

Comments

@williamstein
Copy link
Contributor

williamstein commented Nov 25, 2019

See #4237

We use ts-node caching VERY heavily, and I would say CoCalc massively uses it for halfway descent performance. Without caching every single project startup (in cc-in-cc dev mode) requires compiling every single ts file and will take about one minute (every single time!). Probably a lot of other things we build are much slower. Also, all kucalc manage, hub, etc., services will start up MUCH more slowly.

ts-node completely eliminated caching support, due to a problem with how hashes are computed for dependent files, which isn't an issue for our Docker images (I hope): TypeStrong/ts-node#672

The current behavior of ts-node is just to silently ignore requesting to use caching, e.g., where we write

require('ts-node').register({ cacheDirectory:... })

with current ts-node it just doesn't work at all. So that's not so good.

Probably the right solution is to set this TS_NODE_TRANSPILE_ONLY environment variable for all containers where we run typescript code in production. For development, I don't know what we should do for projects when doing cc-in-cc dev -- do we want to have a special way to run them that doesn't just strip the typescript, but by default we do strip the typescript (so startup time is a second or two instead of a minute or two?).

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

No branches or pull requests

1 participant