Reasonable React
@arnarths
@arnarthor
Who am I?
• Previously at QuizUp ⚡ and WOW Air 🛫
• Full time Reason developer for a year
• Maintainer of bs-express, bs-react-native and
bs-electron
• Fullstack developer at Gangverk
What is ReasonML
• Syntax on top of OCaml 🐫
• Similar to Javascript syntax 👋
• Blazing fast compiler 🚀
• Integrates seamlessly with Javascript
• Targets byte code and Javascript
• Typed function language
BuckleScript
OcamlC
Bucklescript (aka BS) 🐫
• Compiles Reason and OCaml to JS 🚀
• All in on tool 📦
• Flow/TypeScript, Prepack, Babel, ESLint and ImmutableJS
• Fork of OCamlC 🐪
• Produces super readable output 👀
Integrating with JS
• Interface with Javascript through bindings 👍
• Everything needs to return a type 👍
• Open ended Javascript objects *
• Confusing for newcomers 👎
Example
Why not use TypeScript instead?
• Compiler is faster
• No extra tools ✨
• Language is stricter
• Functional language
• Type system is sound 👌
• Bindings are more than just type interfaces
Using React with Reason
• Props are typed 🤝
• Css is typed 💅
• All components have built in reducers for state
• WrapReasonForJs and WrapJsForReason
• ReasonReact has a great interface
Demo time
https://github.com/arnarthor/spotify-unconf

Reason React

  • 1.
  • 2.
    Who am I? •Previously at QuizUp ⚡ and WOW Air 🛫 • Full time Reason developer for a year • Maintainer of bs-express, bs-react-native and bs-electron • Fullstack developer at Gangverk
  • 3.
    What is ReasonML •Syntax on top of OCaml 🐫 • Similar to Javascript syntax 👋 • Blazing fast compiler 🚀 • Integrates seamlessly with Javascript • Targets byte code and Javascript • Typed function language
  • 4.
  • 5.
    Bucklescript (aka BS)🐫 • Compiles Reason and OCaml to JS 🚀 • All in on tool 📦 • Flow/TypeScript, Prepack, Babel, ESLint and ImmutableJS • Fork of OCamlC 🐪 • Produces super readable output 👀
  • 6.
    Integrating with JS •Interface with Javascript through bindings 👍 • Everything needs to return a type 👍 • Open ended Javascript objects * • Confusing for newcomers 👎
  • 7.
  • 8.
    Why not useTypeScript instead? • Compiler is faster • No extra tools ✨ • Language is stricter • Functional language • Type system is sound 👌 • Bindings are more than just type interfaces
  • 9.
    Using React withReason • Props are typed 🤝 • Css is typed 💅 • All components have built in reducers for state • WrapReasonForJs and WrapJsForReason • ReasonReact has a great interface
  • 10.
  • 11.