by _7bxa · 4y ago · 0 comments
First, I really like that this leverages Typescript to its fullest. I'm a big fan of doing things like runtime reflection of compile time types.
However:
``` id: number & PrimaryKey & AutoIncrement = 0; ```
One thing that seems confusing is, (presumably) -- these compile time types are being translated into runtime type behavior. (I'm guessing by your Typescript transformer?). While this is very cool and concise, I suspect it could be super "magical".
In your case, has Deepkit felt too magical?
The places where I consider to use TypeScript are UI/CRUD/frontend centric, because I feel like the ecosystem around JS/TS is really rich and (finally) maturing when it comes to these things. So its really all about coordinating UI/user feedback, validation, serialization/parsing etc. And all that under regular change/evolution.
Now my conclusion so far has been to just try and keep it simple and separated and do the plumbing between all those parts explicitly. There is a benefit to that as well, but it does require more boilerplate and more bug surface. I will definitely tinker with some of the Deepkit libs to reassess this, because I think it might just do the right things in those areas.
How was it digging into the compiler api for that stuff? Every time I've poked around with that it's felt like a mess. Any resources you'd recommend?
I think you just did! (comment on something irrelevant to Deepkit, like the generic and uninformative landing page, that is)