Caching for ts-node
(deprecation of typescript-cached-transpile
and usage of swc
)
#61
Labels
ts-node
(deprecation of typescript-cached-transpile
and usage of swc
)
#61
Specification
Currently we use a third party package https://www.npmjs.com/package/typescript-cached-transpile to do caching for our
ts-node
. This is important in PK tests because we test alot of program executions of polykey and without caching the compilation, the test times blow out.However this third party package isn't very stable and it has become out of date with respect to the new ts-node release. This caused some timeout problems in MatrixAI/Polykey#379. For now we had to fix our ts-node version to exactly
10.7.0
.Upstream ts-node has an official caching solution TypeStrong/ts-node#1364, that we should switch to when it is available as that will be more stable.
At the same time, we should explore the usage of
swc
instead oftsc
. Note thatswc
is only transpilation, not type checking. Thetsc
is still needed when checking types. However our current usage oftsc
ints-node
is to ignore type checking and only do transpilation anyway, so it should be fine for this usecase. The only issue would be automatic conversion fromtsconfig
toswcrc
... It could also be used for jest tests itself, however I think jest testing is fine to keep using tsc.Either way, it's not maintainable to keep using
typescript-cached-transpile
.Additional context
Tasks
swc
and see how fast it isswc
can be integratedswc
is only used byts-node
, we don't want to maintain another.swcrc
@emmacasolin
The text was updated successfully, but these errors were encountered: