Migrating Websites from SvelteKit to Astro, the results

Introduction I have had my eye on Astro for a while. It looked like the perfect fit for the static websites that I manage. But because of the following reasons, I didn’t want to switch: I was/am very satisfied with SvelteKit’s static adapter. There was no support for Astro in Webstorm (my IDE). I didn’t know that the prefetch addon existed. I use something similar in SvelteKit and didn’t want to migrate some sites without that functionality. What changed? Well, since Webstorm 2023.1 there is an Astro plugin. Combine that with some curiosity and my discovery of the prefetch addon and off I went. ...

April 11, 2023 · 3 min · Fabian

Urql GraphQL what are exchanges and why their order matters

Introduction So I recently ran into a nasty bug where urql, the GraphQL client I was using, seemed broken. Turned out I messed up the order of my exchanges. And I want to prevent others from making this mistake. :) What are exchanges? Exchanges are basically middleware. For those not really familiar with middleware in this context, middleware is a piece of software which every request goes through. So you could for example have middleware which will add an arbitrary HTTP header to every request. ...

February 15, 2023 · 2 min · Fabian

Nodejs graphql-upload Replacement

Introduction Ever since graphql-upload v14, the maintainer has made the controversial decision to force deep imports. This means that you can no longer do this: import {GraphQLUpload} from 'graphql-upload'; Now you have to change that to this: import GraphQLUpload from 'graphql-upload/GraphQLUpload.mjs'; Although this is dubious at best, this seems like a quick fix. It is, except when you use TypeScript. The Proposed “Solutions” Now I’m not going to document all the proposed solutions from the maintainer and the community alike here. I’ve spent quite a few hours trying to fix this myself. I’ve followed this, this, this, that and probably a lot more when I went deep into the rabbit hole. But nothing seemed to work, and even if it did, the “solutions” often meant changing your tsconfig.json to allow JavaScript and **** like that. ...

November 21, 2022 · 1 min · Fabian

CSR, SSR and SSG. Explained, pros and cons and its use cases

Introduction In this post I’ll explain the different ways you can render a webpage, their pros and cons and some examples where I think some methods are better suited than others. CSR (Client Side Rendering) In CSR only the bare minimum for the initial page is sent by the server. Any other logic, data fetching, templating and routing required to display content on the page is handled by JavaScript code that executes in the browser/client. ...

July 13, 2022 · 5 min · Fabian

Why I switched from Ghost CMS to Hugo

Introduction Recently an update to Ghost CMS caused it to not work anymore with MariaDB. MariaDB isn’t officially supported on Ghost but since it’s meant to be a drop-in replacement for MySQL in 9/10 cases it doesn’t present any issues. Until it did. What happened? Apparently it was an upstream issue with Knex. For those of you wondering what Knex is: A batteries-included, multi-dialect (PostgreSQL, MySQL, CockroachDB, MSSQL, SQLite3, Oracle (including Oracle Wallet Authentication)) query builder for Node.js. ...

June 30, 2022 · 4 min · Fabian