Disappointed

| 1 min read

Want to view a single image on @imgur (literally its only job)? Good luck! You gotta successfully download (354KB) and run (1.21MB) of client-side React in order to get your image requested as resource 110 of 553. What should have been an IMG element became… this.

@csswizardry - and don’t forget to look at the visualization

This is ridiculous. Things like this don’t even make me any mad anymore, they disappoint.

To make things worse, a large portion of the replies try to justify everything with “but business decisions…”.

Nah.

We can do better. We should do better.


Laravel Mix Preload v1

| 1 min read

Today I tagged v1 of a new package: Laravel Mix Preload. It automatically generates preload and prefetch links based on the contents of your mix-manifest.json file.

Read more


Writing a custom React hook: Google Places autocomplete

| 3 min read

I built a small React component that uses the Google Places API to autocomplete an address in a project I’m working on, and extracted the predection fetching to a custom useAddressPredictions hook. It’s a nice example of a custom React hook composed of different primisite hooks, so I decided to pen write my thought process while building it.

Read more


This site now supports dark mode

| 1 min read

I prefer to use light interfaces, so I rarely use dark mode in macOS or iOS. I often see people add dark mode to their sites, but never really knew whether visitors actually care. I started a Twitter poll:

Do you consider dark mode on websites / blogs (not apps) useful?

The poll is still open. At the time of writing, 225 people responded, and 47% answered “Yes”. Enough to convince me to add a dark mode to my blog.

Read more


Inertia.js and Livewire: a high level comparison

| 7 min read

Both Inertia.js and Livewire have been in the spotlight the past few months. The two libraries often get put next to each other because of their (coincidentally) simultaneous releases.

I’ve seen many people compare the two, or ask if they can be used together. This post showcases their similarities and differences, and should help you understand which problems they each solve best.

Read more


Handling routes in a Laravel and Inertia app

| 2 min read

If you’re building an app with Laravel and Inertia, you don’t have access to Laravel’s helper methods because you’re writing views in JavaScript. This means you lose the ability to generate URLs on the fly with Laravel’s route and action helpers.

This short post outlines two ways to deal with routes in a Laravel and Inertia app.

Read more


Live updating Oh Dear! status pages

| 2 min read

Last week Oh Dear! launched a new status pages feature. I designed them and implemented their frontend. Here’s a live example on status.flareapp.io.

We were originally going to use Vue for the pages, so we could make the entire view reactive so we could easily fetch and update data with AJAX or websockets. I started building the status page view, but quickly became hesitant about the decision to use Vue. It didn’t feel like the right tool for the job.

Read more


How much JavaScript do we really need?

| 3 min read

How much should we invest in JavaScript as developers? I’ve asked myself that question over and over again. Around last year I came to a conclusion: I strongly believe JavaScript is a requirement for excellent user experiences. Not good experiences, excellent experiences.

Read more


Adding webmentions to my blog

| 2 min read

I first noticed webmentions in the wild on Hidde de Vries’ blog about two years ago. Last week it finally happened, I added webmention support to my blog too! Well, partial support at least. I’m now receiving and displaying webmentions. Sending them out is a project for another day.

Read more


Forget about component lifecycles and start thinking in effects

| 3 min read

React components have always relied on lifecycle methods for side effects. While lifecycle methods get the job done, they’re often overly verbose and have large margins for error.

It’s easy to forget to “clean up” a side effect when a component unmounts, or update the side effect when props change. As Dan Abramov preaches: Don’t stop the data flow.

React recently introduced a new way to deal with side effects: the useEffect hook. Translating lifecycle methods to useEffect calls can be confusing at first. It’s confusing because we shouldn’t be translating imperative lifecycle methods to declarative useEffect calls in the first place.

Read more