Azure Static Web Apps staging environments allow you to test changes before they go live. This post shows how to use Playwright against staging environments with GitHub Actions. It's a follow up to my previous post on using Lighthouse with Azure Static Web Apps staging environments.
Migrating from ts-node to Bun
I've wanted to take a look at some of the alternative JavaScript runtimes for a while. The thing that has held me back is npm compatibility. I want to be able to run my code in a runtime that isn't Node.js and still be able to use npm packages. I've been using ts-node for a long time now; it's what I reach for when I'm building any kind of console app. In this post I want to port a console app from ts-node to Bun and see how easy it is.
Node.js 18, Axios and unsafe legacy renegotiation disabled
Node.js 18 doesn't allow legacy TLS renegotion by default. But some APIs still need it. This post shows how to support them with Axios.
In defence of pull requests
Not everyone values pull requests. I really do, and this post explains why.
Docusaurus blogs: adding breadcrumb Structured Data
By default, Docusaurus blogs don't add breadcrumb Structured Data to their blog posts. It's not hard to make it happen though; this post shows how to add it using the JSON-LD format.
Docusaurus blogs: using the createFeedItems API with git commit date
A new API landed in Docusaurus 2.3.0 - it's called createFeedItems
. It's a great API that allows you to tweak the Atom / RSS / JSON feeds for your blog. This post shows how to use it with the git commit date.
Image Optimisation with the TinyPNG API
Image optimisation can be automated with the TinyPNG API. This post demonstrates how to do that.
Docusaurus: improving Core Web Vitals with fetchpriority
By using fetchpriority
on your Largest Contentful Paint you can improve your Core Web Vitals. This post implements that with Docusaurus.
How I ruined my SEO
In October 2022 traffic to my blog dropped like a stone. What happened? Somehow I ruined my SEO. Don't be me. I'll tell you what I got up to and hopefully you can avoid doing the same.
Azure Pipelines - Node.js 16 and custom pipelines task extensions
Support for Node.js 16 for Azure Pipelines custom pipelines task extensions has arrived. From a TypeScript perspective, this post documents how to migrate from a Node.js 10 custom task to one that runs on Node 16 using azure-pipelines-task-lib
.
Using Application Insights with Bicep to monitor Azure Static Web Apps and Azure Functions
Application Insights are a great way to monitor Azure Static Web Apps and Azure Functions. But how do you deploy that using Bicep? Let's find out!
Serving Docusaurus images with Cloudinary
Cloudinary offers an image CDN which can improve performance of your site. This post details how to get Docusaurus to use Cloudinary to serve optimised images.
Azure Static Web Apps: dynamic redirects with Azure Functions
Azure Static Web Apps can perform URL redirects using the routes
section in the staticwebapp.config.json
. However it is limited. This post will demonstrate dynamic URL redirects with Azure Functions.
Azure Static Web Apps: build app externally
Azure Static Web Apps can generally build themselves with Oryx. If you need finer grained control of your build, you can with skip_app_build: true
and some GitHub Actions.
Publishing Docusaurus to dev.to with the dev.to API
The dev.to API provides a way to cross post your Docusaurus blogs to dev.to. This post describes how to do that with TypeScript, Node.js and the dev.to API.
Deep linking with Azure Static Web Apps and Easy Auth
Azure Static Web Apps doesn't support deep linking with authentication. The post login redirect parameter of post_login_redirect_uri
does not support query string parameters. This post describes how to work around this limitation.
Docusaurus: Using fontaine to reduce custom font cumulative layout shift
Custom font usage can introduce cumulative layout shift (or "jank") to your website. This post shows how to use fontaine to reduce this with Docusaurus sites.
Adding lastmod to sitemap based on git commits
This post demonstrates enriching an XML sitemap with lastmod
timestamps based on git commits.
XML: read and write with Node.js
This post demonstrates reading and writing XML in Node.js using fast-xml-parser
. We'll use the Docusauruses XML sitemap as an example.
Azure AD Claims with Static Web Apps and Azure Functions
Authorization in Azure Functions is impaired by an issue with Azure Static Web Apps linked to Azure Functions. Azure AD app role claims are not supplied to Azure Functions. This post will demonstrate a workaround.