deepkit / deepkit-framework

A new full-featured and high-performance TypeScript framework
https://deepkit.io/
MIT License
3.15k stars 118 forks source link

[Doc] DeepkitLoader setup guide and examples? #593

Open kkimdev opened 2 weeks ago

kkimdev commented 2 weeks ago

(Please correct me if I'm wrong)

swc and esbundle are getting popular, it would be great to have a documentation on how to use DeepkitLoader with them in common environments.

We recently tried Deepkit RPC in our project. So far so good except our server restart became 2x slower, from switching swc to tsc. We're trying to figure out if we can use DeepkitLoader and keep swc.

This is how we run our server

node --enable-source-maps --loader ts-node/esm/transpile-only --inspect main.ts

and our tsconfig.json had

{
  ...
  "ts-node": {
    "swc": true
  }
}
marcj commented 2 weeks ago

I don't think SWC supports javascript plugins, so it's impossible to load any javascript loader with SWC

kkimdev commented 2 weeks ago

fwiw, if it works, we would also consider node+esbuild, since the speed is pretty similar on benchmarks.

marcj commented 2 weeks ago

with esbuild it works fine. maybe this helps https://github.com/gjsify/gjsify/tree/main/packages/infra/esbuild-plugin-deepkit