deepkit-framework
deepkit-framework copied to clipboard
type-compiler for SWC
Is there a plan for a SWC plugin?
We phased out tsc a long time ago and replaced it with babel. Now we toy with SWC and also migrate to next-12 using swc. Going back to tsc is not really an option nor favourable for large projects.
Cool approach though, reminds me of the good times creating RPCs with flow runtime
We use a few key methods of the TypeScript compiler API (for example to resolve types or module import expressions) to be able to correctly embed type informations as bytecode. I just saw that SWC supports plugins https://swc.rs/docs/usage/plugins, but I'm not sure if it provides all the necessary functions we need to have all type information available.
While I don't necessarily agree that tsc is not an option for large projects anymore (Deepkit is large as well and works well with tsc), I definitely see advantage of having a faster compiler. I guess if demand increases we should find out if we could build a SWC plugin for Deepkit and if its possible we should do it.
I would put esbuild in this same boat, especially since it has largely the same problem and is becoming increasing popular.
We have "loader" capability now in master since https://github.com/deepkit/deepkit-framework/commit/30939492b96fd90d027728fc7a3030e8d8d24bf3. We can try to test SWC/esbuild now using https://github.com/deepkit/deepkit-framework/blob/master/packages/type-compiler/src/loader.ts
We have "loader" capability now in master since 3093949. We can try to test SWC/esbuild now using https://github.com/deepkit/deepkit-framework/blob/master/packages/type-compiler/src/loader.ts
how do i use it in esbuild?