Explore strategies for handling JSON data in strongly typed applications through this 21-minute conference talk by Lucas Twisk. Discover the challenges of pushing JSON objects from servers to view components in JavaScript, even with type systems like Flow, ReasonML, or TypeScript. Learn about runtime errors that can occur when server data differs from expectations and how to prevent them. Examine available solutions for validating server data early and handling invalid cases gracefully. Delve into a specific approach using TypeScript Compiler API to generate typed JSON decoders from TypeScript interfaces, as implemented in a React Native application. Gain insights into topics such as React Native, parsing JSON, TypeScript, JSON schema validation, JSON decoders, and code generation techniques.
Overview
Syllabus
Intro
Runner App
React Native
Parse JSON
Errors
Problems
Typescript
JSON Schema Validation
JSON Decoders
JSON Decoder Example
JSON Decoder Pros and Cons
JSON Decoder Generator
Code overview
Adding properties
Taught by
React Conferences by GitNation