Josh Goldberg - TypeScript for APIs - JSworld 2021
Developers love APIs that make usage easy. Whether we're installing packages on npm, passing data within a project, or integrating with an external service, we don't want confusion or uncertainty around whether our code will work. TypeScript provides a great standard for describing the shapes of all those things and more. Formalizing our APIs with it provides a plethora of benefits for JavaScript and TypeScript projects alike. In this talk, we'll explore how to use TypeScript to set up a "pit of success" for bringing in external code to a project. We'll start off by exploring how npm packages are described by TypeScript "definition files" -- even when the package author and/or consumer aren't themselves using TypeScript. Next, we'll expand these definitions using auto-generation tools such as OpenAPI ("Swagger") that keep shared definitions for known API entities updated across projects. Swagger segues well into GraphQL, which provides a host of options for generating full type definitions and clients from schemas in your code. ________ Rewatch more recordings from our past conferences at our video portal ➡️ https://frontenddeveloperlove.com/video ________ Our upcoming conferences: ➡️ https://vuejs.amsterdam/ ➡️ https://reactlive.nl/ ________ Powered by https://passionatepeople.io #unittests #webaudio #unittesting #hiphop #frontendlove or #vuejsamsterdam #javascript #reactacademy #react #microinteractions #designsystems #javascript #artificialintelligence #amsterdam #speaker #conference #frontendlove #frontenddeveloperlove #javascriptconference #frontendconference #vue #angular #react #cfp #theateramsterdam #meetup #conferences #events