3 ms·
We generate byte-code from the TypeScript AST, embed that into the emitted JavaScript, and execute them on-demand in a virtual machine during runtime. The resul
by primering 4y ago
We generate byte-code from the TypeScript AST, embed that into the emitted JavaScript, and execute them on-demand in a virtual machine during runtime. The result is a type-object which contains the computed type of a TypeScript type expression which can then be used for various use-cases. We use them for ORM, validation, serialisation, RPC, HTTP Router, etc. You can learn more on how it works here https://deepkit.io/blog/introducing-deepkit-framework https://deepkit.io/blog/introducing-deepkit-framework and in very detail in the TypeScript Bytecode proposal: https://github.com/microsoft/TypeScript/issues/47658 https://github.com/microsoft/TypeScript/issues/47658. Soon in a new doc/ebook it is explained in great detail how it works and the API of it can be utilised to build for example your own libraries/functionalities on top of it.
- VyperCard 4y agoIt’s a great read. Thanks.