Image for post
Image for post
Photo by Donald Chodeva on Unsplash

ReasonML has stolen my attention recently.

If I’m not at work or running about, I am probably digging into some ReasonML/OCaml repositories like an addict in the tenderloin.

Perhaps I like it for the unparalleled incremental build speed.

Perhaps I like it because its not too different from JavaScript yet it nets me a plethora of built-in advantages like type safety.

Perhaps I like it because of my affinity for math in school, and the functional paradigm gives me a warm fuzzy feeling inside.

There are a few reasons, no pun intended, for my love of Reason. Just like a functional program wields function composition with immutable state to achieve its goal, Reason’s composition of the best of OCaml and JavaScript make it a strong candidate for the future of programming. …

Image for post
Image for post
A Superb Pairing.

ReasonML, also known as JavaScript-flavored OCaml, offers nearly impenetrable type safety for developing user interfaces. By adopting a static type system, you can eliminate an entire class of errors before your app is served.

Update 4/11/19: ReasonReact 0.7.0 has introduced some updates to the base API (including hooks! 😍) so some of the code snippets below are a little outdated. I’ll update this soon so this post stays relevant.

We’re going to look into building a small web application that uses consumes a GraphQL endpoint using ReasonML. If you’d like to check out the finished example, here is the repo.

We’ll…

Image for post
Image for post
“A fun and scary roller coaster with lots of twist in an amusement park in Fuji-Q Highland” by Priscilla Du Preez on Unsplash

Before I landed my first paying role as a software developer, I had to learn how to stay fired up about working in tech. After graduating, it took me 9 months to get my first solid job.

To survive in the joblessness, I delivered pizzas and did simple freelance projects.

I had friends who graduated at the same time as me, frolicking about in their cozy Google intern roles. I just wanted to work somewhere where I could put my skills to use.

Eventually, I was fortunate enough to get a pretty nice gig with BCG Digital Ventures as a full stack JavaScript developer. As a consulting firm, their job was to build a medical application for Boston Scientific called PainScale. …

Image for post
Image for post
Photo by Mike Enerio on Unsplash

Today in web development, we will be learning how to:

  • Easily setup a GraphQL Server with NodeJS
  • Mock data without a database using json-server
  • Build a CRUD app that speaks GraphQL
  • How Apollo saves us a lot of time and effort

If any of these items interest you, read on! Be sure to check out the source code for this repo if you would like to refer to the completed example.

Gentle Introduction

A couple years ago, I spun up my first Node HTTP server with Express. It took only 6 lines of code on my end.

const express = require('express')
const app = express()

app.get('/', function(req, res) {
res.send({ hello: 'there' })
})

app.listen(3000, () => 'Listening at…

Image for post
Image for post
That’s not a gopher, its a badger. Photo by Hans Veth on Unsplash

There is a lot of busywork that comes with writing blogs and posting them to different platforms.

For example, I usually start writing an article by creating a markdown file within my code editor. As I write the post, I insert code snippets and images to make the content a little more digestible.

However, problems arise when I need to post this same markdown to Medium. Although their text editor is pretty, it is not perfectly safe to copy and paste my markdown files there.

Here are some issues:

  • code words such as fields or someFunction wrapped in backticks are not formatted properly on…

Image for post
Image for post
“A couple of pineapples side by side on the beach.” by Pineapple Supply Co. on Unsplash

One thing I struggled with when I started learning React was testing my web apps in a way that is both useful and intuitive. I used Enzyme with Jest to shallow render a component every time I wanted to test it.

Of course, I was absolutely abusing the snapshot testing feature.

Well, at least I wrote a test right?

You might have heard somewhere that writing unit and integration tests will improve the quality of the software you write. Having bad tests, on the other hand, breeds false confidence.

Recently, I attended a workshop through workshop.me with Kent C. Dodds where he taught us how to write better integration tests for React applications. …

To be honest, I didn’t know what to think of GraphQL when I first heard of it. I was watching Netflix engineers talk about scaling their microservices with Node.js when one of them mentioned he worked on GraphQL in its early days at Facebook.

Image for post
Image for post

Enamored by its name and its neat connected dots logo, I checked out its landing page and was mesmerized by their succinct self-description in the hero section. From the type definition and a declarative json-like query, we get exactly the results we asked for — without delivering more data than necessary and without any roundtrips.

This REST alternative, though it breaks from the easily understood URL-centric conventions, offers a few advantages to its adoptors. …

Image for post
Image for post
Photo by alan King on Unsplash

Something that has held my interest recently has been finding better ways to build and test JavaScript applications, particularly those speak GraphQL.

  • Say I have a GraphQL server written in Node.js, how should I arrange my folder structure? Where should I put my schema and resolvers? Should my type definitions be co-located with their respective resolvers?
  • What is a good way to go about testing my /graphql endpoint for all of my different queries and mutations?

Recently, spectrum.chat open sourced their whole stack. That means you and I can head on over to their repo and study their source code. My plan was to observe how they architect their JavaScript applications and steal a few ideas for my own apps. …

Image for post
Image for post
Photo by Joshua Earle on Unsplash

A couple weeks ago I got this crazy idea to try out a new front end framework that isn’t React. Given the recent hype behind Vue, I figured that this would be a good opportunity to get dirty with it.

I usually start learning a new technology by going through half a dozen tutorials or video courses. Then, after I’ve digested enough good examples, I’ll start making my own projects by changing the names of variables and then slap my branding on them.

This time I would like to conduct an experiment, however.

I am going to learn to construct a user interface with Vue by consulting only the official Vue documentation. For styling purposes, as I tend to get discouraged by a drab webpage, I will use Vuetifyjs. Hopefully, I will be able gain a new perspective on the learning process by doing it this way. …

The young web developer knows the web. They’ve spent countless hours slinging divs and casting margins. They’ve hammered out countless to-do applications in JavaScript, Python, Golang, Fortran, Basic… you name it!

But now, this hotshot developer wants to conquer a less familiar territory. They want to displace their team’s gang of mobile developers—all of them—by using the hip new framework, React Native. Thinking it’ll be practically like writing a simple web application, they install the React Native CLI and scaffold an empty project.

It starts off just fine. They find out that instead of divs, they must create Views. In order to create text, they must use the built in Text component. Instead of CSS, they must use inline JavaScript styles. …

About

Ian Wilson

Software developer, runner, and surrealist. You can view my site at https://ianwilson.io — Be sure follow me on twitter @iwilsonq

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store