Files
blog/content/_data/works/vue-ts.md

2.5 KiB

Vue 3 TS implementation written with Composition API. Instead of using outdated Bootstrap v4 alpha 2 theme, I rewrite it on UnoCSS, an awesome efficient Tailwind-like utility-first CSS framework.

For API communication, as we have full proper OpenAPI spec, it's a real benefit to have a generated Typescript client for full autocompletion feature. I generally hate generated boilerplate code and the well known OpenAPI Generator is not very nice to use.

Thankfully this openapi-typescript package was the perfect solution. It simply translates the OpenAPI spec to a simple Typescript file, with only types. No code generation involved ! In order to work, we need to use a specific fetch tool which will use all advanced features of Typescript 4 in order to guess type all the API with only a single TS file in runtime !

Main packages involved :