Tag Archives: Derbyshire

Feeling RESTful

A month ago I took a (relatively) short train ride into the beautiful Derbyshire countryside to spend a week coding in the middle of nowhere.

I was attending A Week of REST – a training event put on by the excellent folks at WordPress agency, Human Made.

Part of a group of about 20, we descended on Darwin Lake near Matlock, a beautiful set of holiday cottages set around a lake and right next door to the Peak District National Park – one of Britain’s best destinations.

Being remote there was no mobile signal and the wifi was pretty terrible! But that didn’t matter – the course had been set up in such a way that an internet connection was more of a luxury and the disconnect allowed us to concentrate on learning and interacting with each other.

So what did I learn?

I learnt how to build a standalone React app in ES6 syntax, using NPM and Webpack for a local development environment. I learnt how to authenticate with the REST API from Javascript, send different types of request and interact with the responses within React.

Building a React app was very different to developing for WordPress. We used NPM and Webpack to create a local development environment (sitting at localhost:3000) and we were writing entirely in JS/JSX and there was even an index.html file! Crazy times.

The API endpoints were just a WordPress plugin, and creating them was much like interacting with other WordPress APIs. I’d equate it to registering new post types, so very simple for a WordPress developer to get on with.

Having done the React class at last year’s Automattic Grand Meetup everything I learnt came flooding back, so that wasn’t a big challenge. Using ES6 was weird at first but I quickly came to enjoy it – and I really don’t enjoy JS dev usually 😉 The biggest challenge was probably understanding authentication with the API. While we only used one authentication method and had a helpful library to make it easy, there are some complicated concepts to get your head around and there were a lot of questions on that topic from the group.

The teachers – Joe Hoyle, Ryan McCue and Zac Gordon – were great. We went at a good pace, no-one got left behind and we were given lots of opportunities to ask questions. I’d recommend looking out for future Human Made events, including A Day of REST and you should certainly check out Zac’s Javascript for WordPress course.

Not only were they great teachers, I had a great time hanging out with them, the other Human Made crew and the other attendees. I’m lucky that because of my awesmazing job I already knew some of the HM folks (and met some I work with but hadn’t yet met in person!) which made socialising easier, but I also got along really well with my fellow students, and really enjoyed our various games and late night shenanigans 🙂

Finally, it wouldn’t be right to spend such a long time without an internet connection and not have something to show for it. So I present to you my very first solo-built standalone React app: howmuchhuel.com.

I’ve recently started using Huel* regularly and needed a quick way to measure the mixture on my phone, so I built this neat little app. The calculations are a bit scrappy, but it works. Contributions welcome.

*get £5 off with this link,  because I love you.