Saturday, 5 September 2020

Running your tests faster with zero overhead!

swc-node is a TypeScript/JavaScript compiler which is a NodeJS native addon for swc.Swc compiler is 7~40x faster than babel, swc-node implement @swc-node/jest and @swc-node/register top on it.swc-node is also built on top of napi-rs , which has some killer features rather than the other packages which built from native code:Minimal third part dependencies, no need for node-gyp rust/C++ toolchains. You can just install it in your Docker environment and use it.No additional binary files need to download in postinstall scripts. Everything is available on npm.Compatible to all NodeJS versions after v8.9.0, No need to reinstall after NodeJS upgraded.And thanks to deno ecosystem(swc is heavily used by deno ecosystem), swc is stable and support latest TypeScript/JavaScript feature now:TypeScript experimentalDecoratorsTypeScript emitDecoratorMetadatajsx pargmaES5 ~ ES2020 language featuresMore over the swc featues, I implement jest-hoist-transformer in @swc-node/jest, which would help you migrate from ts-jest smoothly.Many projects in Bytedance has running with @swc-node/jest (jest tests) and @swc-node/register (ava tests).​https://preview.redd.it/j21djlpfrgl51.png?width=1778&format=png&auto=webp&s=a3b3d4a1f3273024a4cfb376cd8d95ce7af67bc3So try it and enjoy the zero overhead performance improvement!

Submitted September 06, 2020 at 06:31AM by LongYinan

No comments:

Post a Comment