[ Web Proxy ]
URL:
Viewing: https://blacksheepcode.com [Back]  [Original]

Black Sheep Code
Black Sheep Code
BlogAboutOpen SourceAI Policy

Jump right in!

Explore the following topics:

Blog

An AI-generated blindfold

Published: August 27, 2026

Increasingly, I'm finding it hard to hard to get a sense of human consensus on a topic from the internet

Human comprehension is still the bottleneck

Published: July 9, 2026

All this talk about how AI can build a whole whatever with $120 of credits and a day is beside the point - the bottleneck is how fast we can understand things

Does this tool exist? A tool for comparing/testing the difference between LLM harnesses, models and prompts

Published: July 8, 2026

All the talk in the world about certain prompting techniques, models, or workflow strategies isn't very useful unless you can actually measure it

Some problems only exist when you are new to the organisation

Published: July 8, 2026

New people to the organisation have fresh eyes and can spot issues that old hats might well be used to. But those things don't necessarily need to be fixed.

Where are the prompts to stop humans going off the rails?

Published: July 3, 2026

Humans are just as finicky as AI

The case for adding a 'this file was generated by AI' header

Published: July 1, 2026

It helps not gaslight anyone reading the code

The case for clear code ownership

Published: June 25, 2026

Clear code ownership = developers proud of their work, high quality code

Psychological pitfalls of using artificial intelligence - a heightened sense of urgency

Published: June 15, 2026

AI can provide a lot of content very quickly, and we can feel the need to match its pace.

A shield or a cudgel?

Published: May 31, 2026

A dynamic I frequently observe is that the project manager becomes a cudgel against their team members, rather than serving to protect them from the rest of the organisation.

Reasons to be a token miser

Published: May 27, 2026

There is a school of thought that says 'Just throw money at the problem' - here's why you should be constantly optimising your token usage.

The time required to wait for a job to complete - changes the workflow for how you do it

Published: May 27, 2026

There's a big difference between a job that takes one hour, vs a job that takes one minute vs a job that takes less than a second

Agentic AI - yak shaving on steroids

Published: May 23, 2026

The prospect of having agentic AI do all the real work means that we now focus on tuning the AI, not delivering the work.

Advice for someone looking to get into software engineering

Published: November 24, 2025

This is advice I have for someone who is either pivoting career or has finished high school and is looking at university options.

Encapsulate as much state as possible in your component

Published: October 31, 2025

A common pattern I see is passing every bit of a component's state in as a prop. This just puts the responsibility of that component's actual useful logic on to the parent.

The nuance of React rendering behaviour as it relates to children

Published: September 22, 2025

Components that are passed as props.children and components that are directly declared by a component have different rendering behaviour - yet they are both just called 'children'. The adoption of React 19's compiler might mean that this distinction does not matter.

Tools I like: @inquirer/prompts

Published: July 30, 2025

@inquirer/prompts is a JavaScript library for creating interactive CLI prompt menus

I'm apprehensive about using too many AI-generated images in my blog.

Published: July 2, 2025

I'm worried that the blog will look samey and like more-ai-slop-everywhere.

Reasons to not use GraphQL

Published: June 30, 2025

GraphQL is one of the cool kids in modern web development - but I generally recommend against using it.

It is better to have the same meeting four times with four people each, than to have one large meeting with sixteen people.

Published: June 26, 2025

If some idea or decision needs to be socialised amongst many people, it may be tempting to get everyone into one meeting and sort it out in one go.

Delete a range of commits

Published: June 26, 2025

The --onto option of a git rebase can be used to delete a range of commits

Conference notes for Web Directions Code 2025 - The behaviour of browsers and their loading of resources.

Published: June 11, 2025

Links to documentation and open issues.

How to add an experimental feature to your code, without having it in your main version control

Published: May 19, 2025

You might have a really good idea, but its not practical to get it commited to version control. You can keep the feature around for local use with some shell aliases and git commands.

No, react context is not causing too many renders

Published: May 9, 2025

A lot of people are under the impression that context shouldn't be used to store state, because it'll cause the entire application tree to re-render. This is a misnomer.

At least write one test.

Published: April 23, 2025

The value of writing one test isn't in testing the code's correctness - it's in testing its consumability.

I'm going off MDX for blogging

Published: April 23, 2025

I like standardised formats like markdown. MDX allows markdown, plus sprinkle in some React. However, I'm considering that maybe I'd be better off just using React.

Well designed code is easy to delete

Published: April 23, 2025

The mark of some well designed code is that the act of replacing it is some what straight forward.

How to prevent further modification commits to a file with a pre-commit hook

Published: February 25, 2025

Sometimes you want to prevent accidentally modifying sets of test fixtures etc. Use this simple pre-commit hook to prevent it.

Tools I Want: A VSCode plugin that highlights how often an error appears in Sentry, or other monitoring tools

Published: February 20, 2025

I liberally throw errors defensively, often not expecting the error scenario to ever actually occur - it would be nice if I could see some real metrics about how often a thing is occurring, without having to leave the IDE.

The tool I want to exist - an API mocking tool that generates mock data by observing real world usage.

Published: February 4, 2025

Mocking API calls, particularly multiple interlinked calls can be cumbersome. I want a tool to do it for me.

If I were building a start up from scratch, these are the things I would include (or have a plan to include).

Published: January 13, 2025

The easiest time to include something in your application is at the start. On the other hand, you're likely time-poor and there's no point on burning all your runway on a gold-plated hello world! application.

Good idea: Loading screen tips for developers

Published: December 13, 2024

Video games commonly show helpful hints and tips on loading screens. Developer tools should contain the same.

React testing patterns: When making a change to a leaf component breaks tests further up the tree

Published: December 13, 2024

A common pain point in testing React applications is when we make a change to a component that exists down the component tree, and this change causes breaks in multiple components that directly or indirectly consume this component. Here we outline some strategies for mitigating this problem.

Module behaviour in browsers - loading waterfalls, module preloading, cache invalidation cascades and import maps.

Published: November 26, 2024

Browsers now support ESM modules natively - meaning that we no longer need to bundle our modular code. However be aware that naive use of ESM modules may lead to unperformant loading waterfalls. Our options: bundle, use dynamic imports, or preload our modules.

How to create an imperative useConfirmationModal hook

Published: November 20, 2024

Avoid a bunch of state hooks and handlers in your code for things like confirmation modals by encapsulating that kind of logic away in a hook.

Examples of tooling that do not play nicely with ESM

Published: November 19, 2024

EcmaScript Modules (ESM) are well established - leading some to argue that we no longer need to provide CJS packages. However, is that really the case?

Two caching strategies

Published: November 19, 2024

There are generally two strategies for caching, 'cache, but require validation' and 'trust what you've already got without caching'. The latter is well suited for caching static assets.

Assume the next developer will copy paste what they see you do. (That next developer might be you.)

Published: November 18, 2024

It's not a criticism of developers to suggest that they'll copy paste what they already see in a codebase. Programming is complex and we'll use whatever hueristic we can to reduce what we need to think about.

The behaviour of browsers and loading resources - Scripts

Published: October 31, 2024

JavaScript scripts cannot be evaluated until they have been completely loaded. By default they are parse blocking.

The behaviour of browsers and loading resources - HTML, images, and CSS

Published: October 31, 2024

Browsers do not need to wait for an entire HTML document to be loaded before it can display it. CSS is render blocking. Images will start streaming as soon as the tag is encountered.

TypeScript - indexing into a mapped type

Published: October 14, 2024

Indexing into a mapped type a powerful TypeScript technique to allow a collection of all different types, while retaining the type information.

TypeScript types are inferred in a forward direction

Published: October 14, 2024

TypeScript's type inference is powerful, but it does have constraints. One constraint is that it can't retrospectively narrow types.

Using cookies in React Server Components to avoid a flash the incorrect content.

Published: October 2, 2024

We make use of NextJS's `cookies` function to access the cookies on the server side.

How to create a responsive React hook to listen for changes to cookies

Published: October 2, 2024

Your React components may wish to listen for changes to made to cookies, whether they were made by other React code, or HTTP requests or non-React JavaScript. The CookieStore API can help.

The natural state of software is chaos

Published: September 24, 2024

The perfect codebase is a myth. Abondon the pursuit of it, and instead seek to contain the mess.

Migrating from Remix to NextJS

Published: September 9, 2024

NextJS appears to well and truely established. These are the steps I followed to migrate from Remix 1.9.3 to Next 14.

An overview of configuring proxy behaviour in NodeJS applications

Published: September 5, 2024

You may wish to proxy node requests via service like mitmproxy for the purpose of analysing the requests its making or generating test data. Here's a quick reference sheet for setting this behaviour up.

How to publish a React component package, using NextJS as the compiler

Published: August 23, 2024

Although your component library may not be making use of React Server Components and the like, it can be helpful to see how the component behaves in a NextJS context.

How to configure NextJS to proxy its requests

Published: August 19, 2024

We may wish to proxy the requests NextJS makes, for example through a tool like mitmproxy in order to analyse traffic or generate test data.

The problem of testability in React

Published: July 25, 2024

It seems like there are no perfect solutions for testing in React.

Tools I like: git checkout interactive

Published: June 12, 2024

gci is an interactive CLI utility to select a git branch with arrow keys.

Adding dark mode to a blog - how to avoid flashes of the wrong theme

Published: June 7, 2024

I've added dark mode to this blog. Here's a few tricks I've learned.

How to configure Remix and mdx-bundler for a serverless platform - barrel files approach, Remix v1

Published: March 22, 2024

If using Remix on a serverless platform such as Netlify we can use a build time compilation and barrel files to access frontmatter metadata.

How to get started testing a React codebase that has no tests

Published: March 12, 2024

You've inherited a React codebase that has no tests. You're having trouble with regressions and think that tests might help, but how do you get started?

Run a Docker image on AWS ECS + Postgres using Terraform CDK

Published: February 21, 2024

CDKTF is a tool that allows us to use fully fledged programming languages to do Terraform deployments, having the advantage of being type safe for one.

Why I've gone off React Testing Library

Published: February 8, 2024

React Testing Library is perhaps the most popular tool for testing React applications. However its use of JSDOM under-the-hood means we often spend time dealing with browser APIs that JSDOM has not implemented.

How to configure Remix and mdx-bundler (with file system access)

Published: November 19, 2023

How to use Remix and mdx-bundler to make use of frontmatter headers. This will allow adding publication dates, or grouping posts into series, adding tags, etc. This solution works for a non-serverless solution - it requires file system access.

A comprehensive guide to testing with Easy-Markdown-Editor

Published: October 19, 2023

Easy Markdown Editor is a handy markdown editor with formatting keyboard shortcuts. This post outlines how to write tests for applications using it, using either Testing Library or Cypress.

Testing strategies for a Single Page Application as it relates to state management

Published: October 10, 2023

The presence of state management is often what makes testing an Single Page Application difficult. Various approaches such as API mocking, dependency injection, component composition and error boundaries can help.

Today I learned: The Etc/GMT+x timezones actually mean UTC-x

Published: August 21, 2023

Counter-intuitively Etc/GMT+x timezones means the opposite of how they appear in an ISO 8601 formatted date string.

Black box contract testing - third party API mocking

Published: August 14, 2023

We have an API that makes calls out to a third party - how do we test it? We can use .HAR files to configure a tool like Mockbin to act as the third party service.

The horseshoe model for software development

Published: August 11, 2023

I propose that the designer and the QA should be one and the same.

Blackbox contract tests - Performance testing with Jest

Published: April 28, 2023

We can use a tool called jest-timing-reporter to provide a performance diff in our Github pull request.

OpenAPI and contract tests with Jest

Published: April 26, 2023

Using good ol' Jest to write some contract tests with our OpenAPI generated client SDK.

Using Postman and an OpenAPI spec for contract/blackbox tests

Published: April 17, 2023

Syncing Postman with our Github repo, generating queries from our OpenAPI spec.

Postman and OpenAPI - Automating tests

Published: April 17, 2023

Postman has an automated testing feature, but how well does it work?

The case for blackbox tests

Published: April 17, 2023

Blackbox tests do not require knowledge of the implementation details - they're a 'how the consumer sees it' style of test.

This blog now features comments

Published: March 24, 2023

You can very easily add comment functionality to a webpage via the Github-powered Utterances plugin.

Thoughts about JSON API

Published: March 6, 2023

JSON API is an opinionated REST API structuring spec. I think it has some good ideas about what can be useful in a RESTful API, but ultimately the complexity of using it makes it not worth using.

Generating MSW mocks from an OpenAPI spec.

Published: January 17, 2023

We're using msw-auto-mock to generate MSW mocks to test our React application.

Why I don't like API mocking as a necessary frontend testing strategy

Published: December 12, 2022

A lot of state management frameworks recommend doing API mocking as the testing strategy. I think dependency injection is a better approach.

User Experience reflects the underlying data structure

Published: December 1, 2022

I propose a variation of Conway's Law.

Generating application and client code from an OpenAPI spec

Published: November 28, 2022

We'll use openapi-generators to generate a Go backend and a React frontend.

I'm playing with Remix

Published: November 28, 2022

Using Remix to generate a static blog.

Why use OpenAPI?

Published: November 25, 2022

OpenAPI is a spec for describing HTTP APIs. It has a healthy ecosystem of tooling that supports it.

The case for splitting Cypress tests into multiple it blocks

Published: November 11, 2022

Cypress recommends long running tests with lots of assertions. I argue that it would be helpful if we had granular visibility of the parts of the test.

A model of extensible changes.

Published: August 10, 2022

Making changes in an extensible manner avoids having to do significant code rewrites or being disruptive to downstream consumers of your API.

Dependency injection when using redux.

Published: August 1, 2022

An unconventional strategy to inject the behaviour of your state management in testing contexts

Different Approaches to Form Element State Management in React

Published: July 27, 2022

Working with lists of data for form inputs such as radio buttons or checkboxes is non-trivial. I outline three approaches.

Agnostic state and service management in React

Published: May 5, 2022

Avoid make state framework specific calls inside of your React components, and instead access them via hooks. This reduces the cognitive overhead in understanding your components, and likely allows reuse of those data fetching functions elsewhere.

What is the role of QA and how should their tests fit into the development process?

Published: April 19, 2022

If we're doing shift-left testing, and developers are writing their own tests - then where does that leave QA?

How to effectively hire contractors

Published: April 11, 2022

Contractors are best utilised to plough through a well defined scope of work.

I support open source: Open Collective


Web Proxy Viewer  |  New URL  |  Original Page