Cargando…

ReasonML Quick Start Guide : Build Fast and Type-Safe React Applications That Leverage the JavaScript and OCaml Ecosystems.

ReasonML, also known as Reason, is a new syntax and toolchain for OCaml that was created by Facebook and is meant to be approachable for web developers. Although OCaml has several resources, most of them are from the perspective of systems development. This book, alternatively, explores Reason from...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Rafatpanah, Raphael
Otros Autores: Joseph D'mello, Bruno
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing Ltd, 2019.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Title Page; Copyright and Credits; About Packt; Contributors; Table of Contents; Preface; Chapter 1: Introduction to ReasonML; What is ReasonML?; Why Reason?; Support for immutability and purity; Module system; Type system; Cross-platform; Maintainability; Interoperability; ES2030; Community; The Future of ReactJS; Exploring Reason; Data structures and types; Creating our own types; Pattern matching; Making Invalid States Impossible; Summary; Chapter 2: Setting Up a Development Environment; The Reason toolchain; Installing BuckleScript; Editor configuration
  • Setting up a pure Reason projectThe bsconfig.json file; The warnings field; The package-specs field; The suffix field; The sources field; Working with DOM; Setting up a ReasonReact project; Improving the developer experience; Summary; Chapter 3: Creating ReasonReact Components; Component creation basics; Component templates; self; Event handlers; unit; JSX; Props; Children; Life cycles; Subscriptions helper; Stateful components; State, action, and reducer; Refactoring; Instance variables; Ref and mutable records; Navigation menu; Bindings; Events; Js.t Object; Adding actions; Inline styles
  • React ref Velocity; Client-side routing; Current route; Helper functions; Usage; Summary; Chapter 4: BuckleScript, Belt, and Interoperability; Module scope; Data structures; Array; Using the Reason standard library; Using the Belt standard library; Using BuckleScript's built-in JavaScript bindings; Using a custom binding; Using raw JavaScript; List; Recursion; Pipe operators; Using Belt; Option module; List module; make; makeBy; shuffle; take; Deck of cards example; Currying; Uncurried functions; makeByU; JavaScript interoperability; Using JavaScript in Reason
  • Understanding the [@bs.val] decoratorUnderstanding the [@bs.scope] decorator; Understanding the [@bs.send] decorator; Understanding the [@bs.module] decorator; Reasonable APIs; BuckleScript documentation; Binding to existing ReactJS components; Importing dependencies; Creating the make functions; Using [@bs.deriving abstract]; Using the components; Summary; Chapter 5: Effective ML; Module signatures; Module types; Abstract types; Using module signatures; Phantom types; Polymorphic variants; Would this work with normal variants?; Advanced type system features; Summary
  • Chapter 6: CSS-in-JS (in Reason)What is CSS-in-JS?; A brief history; Using styled-components; Using [@bs.variadic]; Using bs-css; Trade-offs; Other libraries; Summary; Chapter 7: JSON in Reason; Building views; File structure; Updating the router and navigation menu; CustomerType.re; CustomerList.re; Customer.re; Integrating with localStorage; Populating localStorage; DataPureReason.re; Validating JSON strings ; Using Js. Json.classify; Writing to localStorage; Using bs-json; Using GraphQL; What is GraphQL?; When using GraphQL, do I need to create JSON decoders?; Summary