First Thoughts About ReasonML vs TypeScript

Today I finished my first TypeScript experiment with React. Here are some thoughts after using ReasonReact first, and now TypeScript second. Setup Is Not Better Than ReasonReact I used Create React App to bootstrap the app. npx create-react-app <project-name> –typescript But then I had to setup ESLint and Prettier with TypeScript. ReasonML & BuckleScript: npm install -g bs-platform bsb -init <project-name> -theme react-hooks After that you’re done.
Read more →

Preparing For My First Tech Talk: TypeScript Experiments

A few days ago I started preparing for my first tech talk. One of the common questions about ReasonML and ReasonReact is: Why not TypeScript? If you’re looking for a statically typed alternative for JavaScript, TypeScript seems like the obvious choice. I did a TypeScript workshop with FrontEnd Masters (online) a while ago, but I have to admit that I didn’t use TypeScript in practice. The last few days I started creating a simple TypeScript React app.
Read more →

Check For Equality in Reason vs JavaScript

Reason and JavaScript are not the same languages, although the syntax looks similar. That’s intentional, but sometimes hides fundamental differences of those languages. Comparing values is a common task in programming. Let’s look at the equality operators. Checking For Equality in JavaScript Here’s what MDN has to say: Equality (==) The equality operator converts the operands if they are not of the same type, then applies strict comparison.
Read more →

Preparing For My First Tech Talk

I’m not sure how it happened. But a while ago, I agreed to hold a tech talk. 😱 Today, I was able to prepare for the talk. I woefully underestimated the amount of work! I now have a new appreciation for all the speakers. Tools I decided to use Remark.js to create slides from a Markdown file. With the CLI tool backslide you can easily automate the process. I found it painless to create decent-looking slides with minimal effort.
Read more →

Learning Update End of October 2019

Read more →

How To Create a Music Player in Reason With The useContext Hook Part 4

We’ve come quite far with our music player in ReasonReact. We created a React Context with state, a hook to manage the Context, and we started with our UI. In this post, we will create a component for the music player control buttons, and we will finally implement the functionality to play the track via the DOM API. You can find the complete code on GitHub. Create Player Controls Create src/PlayerControls.
Read more →

How To Create a Music Player in Reason With The useContext Hook Part 3

Our goal is to create a music player with ReasonReact like this one: ☞ Demo. James King wrote the JavaScript version of the tutorial at upmostly. My blog post series is a port of the tutorial to ReasonML and ReasonReact. I encourage you to check out the original JavaScript tutorial if you’re unsure about how useContext works. ReasonReact compiles (via BuckleScript) to React. We can leverage our existing React knowledge.
Read more →

How To Create a Music Player in Reason With The useContext Hook Part 2

In the last post, we set up our project: a music player with useContext in ReasonReact. You can find the demo on GitHub pages and the full code on GitHub. The tutorial is a port from the React tutorial How to Use the useContext Hook in React by James King. Type-Driven Development ReasonReact is a statically typed language. We should now think about our data model and create types. That will help to flesh out our app’s state.
Read more →

How To Create a Music Player in Reason With The useContext Hook Part 1

What Are We Building? This tutorial will show you how to build a music player with ReasonReact and the useContext hook. You will learn how to bootstrap a ReasonReact project, how to build a simple application, and how to use hooks with ReasonReact. ☞ View Demo Why ReasonML and ReasonReact? ReasonReact provides a type-safe way to build React applications. It leverages the mature OCaml language that comes with a superb type system.
Read more →

Learning ReasonReact Step by Step Part: 10

Here are some reflections on my path to creating a first ReasonReact application. ReasonReact is still React ReasonReact’s API stays as close as possible to React. As you know, ReasonML is a syntax and build chain for OCaml, but it compiles to JavaScript (and React.js). You can use your previous knowledge of building React applications. However, ReasonReact ships with the underlying assumptions of React and React hooks: one-way data binding, handling derived state or synchronizing state, the complexities of life-cycle management, useEffect, etc.
Read more →