Will's avatar

Posts and notes

Javascript

(15 items)

Ramblings on Hypermedia APIs for Pure Web Applications 7 September 2024

Many moons ago I would write web applications using technologies like PHP or Python to directly serve web content – often using templating engines to more easily handle data display. These apps would thus ship server-side rendered plain HTML, along with a mix of browser-native forms and AJAX … Read more (8 minute read)

Re-Building my Website with Hugo 3 September 2022

GatsbyJS For several years I’ve been using GatsbyJS to generate the static site content for this website. Gatsby is a great tool and produces blazing-fast websites through the use of an interesting combination of technologies. In Gatsby, pages are simply React components, and developers can … Read more (6 minute read)

Parcel to the rescue 25 May 2022

Earlier this week I needed to make some changes and re-deploy an old Vue app. I hadn’t touched the codebase in over a year, and my experience with the rate of change in the front-end web space made me dread what would happen if I tried to re-awaken this thing. Sure enough, after running a yarn … Read more (3 minute read)

Adding 'dark mode' and dynamic theming to your React websites 21 August 2021

Adding theming and the choice between “light” and “dark” modes to your website can enhance your site’s accessibility and make it feel more consistent with the host operating system’s own theme. With JavaScript (and React in particular) this is easy to do, as … Read more (8 minute read)

Code syntax highlighting in Gatsby 28 July 2021

Providing code snippets on your website or blog can be a great way to convey meaning for technical concepts. Using the HTML pre tag can help provide structure to your listings, in terms of spacing and indentation, but highlighting keywords - as most people do in their code text editors - also vastly … Read more (2 minute read)

Generating video previews in webapps 19 July 2021

Many web apps have support for uploading video files. Whether it’s a media-focused platform (such as a video sharing service) or just offering users a chance to add vlogs to their profile - videos are a powerful mechanism for distributing ideas. For services providing image upload … Read more (2 minute read)

Easily set up discoverable RSS feeds on a Gatsby website 4 March 2021

RSS has had a bit of a resurgence for personal websites and blogs in recent years, especially with the growing adoption of Small Web and IndieWeb ideologies. Many static site generators - including Hugo, Jekyll, and Eleventy - can easily support the automatic generation of RSS feeds at build time … Read more (7 minute read)

React State Management with Zustand 5 February 2021

React state React state management is what gives the library its reactiveness. It’s what makes it so easy to build performant data-driven applications that dynamically update based on the underlying data. In this example the app would automatically update the calculation result as the user … Read more (5 minute read)

React Query 15 December 2020

If you write React web apps that interface with a backend web API then definitely consider trying React Query. The library makes use of modern React patterns, such as hooks, to keep code concise and readable. It probably means you can keep API calls directly inside your normal component code rather … Read more (1 minute read)

JS Tidbit: Nullish Coalescing 20 November 2020

This short post introduces a useful JavaScript operator to help make your one-liners even more concise. The specification was added formally in the 11th edition of ECMAScript. It is implemented as a logical operator to selectively return the result of one of two expressions (or operands) based on … Read more (1 minute read)

JS Tidbit: Optional Chaining 10 October 2020

JavaScript has lots of handy tools for creating concise code and one-liners. One such tool is the optional chaining operator. The optional chaining operator is useful for addressing an attribute of a deeply-nested object in which you cannot be fully certain that the successive levels of the object … Read more (2 minute read)

CENode 22 June 2017

Whilst working on the ITA Project - a collaborative research programme between the UK MoD and the US Army Research Laboratory - over the last few years, one of my primary areas has been to research around controlled natural languages, and working with Cardiff University and IBM UK’s Emerging … Read more (5 minute read)

Node.js Contribution to Heroku's Dev Center 17 March 2014

I recently wrote a new article for Heroku’s Dev Center on carrying out asynchronous direct-to-S3 uploads using Node.js. he article is based heavily on the previous Python version, where the only major change is the method for signing the AWS request. This method was outlined in an earlier blog … Read more (1 minute read)

Direct-to-S3 Uploads in Node.js 17 January 2014

A while ago I wrote an article for Heroku’s Dev Center on carrying out direct uploads to S3 using a Python app for signing the PUT request. Specifically, the article focussed on Flask but the concept is also applicable to most other Python web frameworks. I’ve recently had to implement … Read more (1 minute read)

ScriptSlide 18 February 2013

I’ve taken to writing most of my recent presentations in plain HTML (rather than using third-party software or services). I used JavaScript to handle the appearance and ordering of slides. I bundled the JS into a single script, js/scriptslide.js which can be configured using the js/config.js … Read more (1 minute read)