Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I just learned that there’s an open issue [0], apparently for introducing a similar feature.
[0]: https://github.com/microsoft/TypeScript/issues/43505
For anyone using both TypeScript and JSON schemas, but wanting to use TypeScript as the source of truth, I highly recommend the following library: [ts-json-schema-generator](https://github.com/YousefED/typescript-json-schema).
It does exactly what it says in the box: turns your TypeScript `types` / `interface` into machine-readable JSON schemas.
The library has a few open issues (does not deal well with some edge cases of composing Omit<> on sum types, and does not support dynamic (const) keys), but compared to manually writing JSON schemas, it's been amazing!
Related posts
- Template Literal Types: How To Type Strings
- I need to learn about TypeScript Template Literal Types
- GitHub - thoughtspile/awesome-tiny-js: A collection of tiny JS libraries (under 2 kB) to put your bundle on a diet
- awesome-tiny-js: A collection of JS libraries under 2 kB
- Getting overwhelmed while trying to doing open source or How should I practice such that I am able to do some open source