4 ms·
Call me incompetent, but I don't get it. > I switched the build to SWC, and server restarts dropped to under a second. What is SWC? The blog assumes I know it
by thunfischtoast 6mo ago
Call me incompetent, but I don't get it.
> I switched the build to SWC, and server restarts dropped to under a second.
What is SWC?
The blog assumes I know it. Is it https://swc.rs/ https://swc.rs/ ? or this https://docs.nestjs.com/recipes/swc https://docs.nestjs.com/recipes/swc ?
- just-tom 6mo agoIn the links you provided, swc is the same entity.
- TheRoque 6mo agoBoth links are the same, SWC in this context is probably Speedy Web Compiler. It transpiles really fast but doesn't do any type checks.
- maleldil 6mo ago> It transpiles really fast but doesn't do any type checks What's the point of using it during development, then?
- OscarDC 6mo agoTranspilation is here a necessary step to test the application because e.g. his browser won't be able to parse raw TypeScript code. Typechecking is not: the browser doesn't care about it, it's mainly to help the developer verify its code. So to speed-up the build during development (to have faster iterations) the idea is often to make the building process only about the build by removing "unnecessary" steps like type-checking from it, while having a separate linting / typechecking etc. process, which could even run in parallel - but not be necessary to be able to test the application. This is often done by using tools like a bundler (e.g. esbuild) or a transpiler (babel, swc) to erase the types without checking them in your bundling process.
- michaelsalim 6mo agoPretty sure they're the same thing. The second link is on how to use swc with nestjs.