Talking to the computer
Communicating ideas and exploring them quickly While the term vibe coding has been controversial, I do think the sentiment hints towards a way you might want to work with these tools. Leaving aside…
Web Frontend Design and Development
Communicating ideas and exploring them quickly While the term vibe coding has been controversial, I do think the sentiment hints towards a way you might want to work with these tools. Leaving aside…
Robust UI E-book Cover Long overdue, I've archived my Robust UI e-book landing page. While the content about React component testing strategies might be useful to some, I never got it to a final state…
Planning Using a model like o3 in ChatGPT can be useful to flesh out an idea and iterate before building anything. Once you are happy with the plan you can even ask o3 for an initial prompt to put…
A large differentiator in the quality of output you will receive from AI coding tools depends on the quality of the AI model and the framework which it can act within, together often called an “Agent…
You might have a suite of end-to-end tests that cover your application well and you might be thinking do we need to duplicate our tests at a unit or integration test level also? Putting aside that end…
With Frontend libraries like React, we often don't use classes. But the same public/private differentiation can be made through the keyword. Anything that has an is public and anything that doesn't…
When writing integration tests (tests that do minimal mocking) I often find myself duplicating test cases. In scenarios like this where I might have two functions that do similar things and share code…
To share code between gatsby-node files and other components the shared file must use CommonJS syntax. For example: The exported stuff can then be used in gatsby-node.js with a require import and…
This is part three in a series on Testing Hooks The final category of hook usage is one of utility. These are hooks from libraries or hooks that are used widely throughout your code. They often have a…
This is part two in a series on Testing Hooks In the last section where we shuffled around some code to make it more readable, we were not taking full advantage of the benefits of hooks which is to…
This is part one in a series on Testing Hooks The first category of hook usage is code organization to make our code easier to read. This is usually in the form of breaking a component into smaller…
The primary category of React hook usage is code reuse between components. When trying to determine a testing strategy for a particular hook a few more categories appear. One of code organization…
For a quick overview on Compound Compounds check out this article. Compound components are made up of many component parts. The most effective way to test them is together, holistically. To achieve…
If you're here you're probably second-guessing your usage of GraphQL. It's a great tool but if your not deliberate about your schema design it can create complexity. A misuse of it can happen in the…
React Context is a tool for designing flexible Component APIs. How we test it depends on the situation, we are going to explore some of the situations you might find yourself in and the best way to…
This article will be enough to get you started with unit testing gatsby-node.js, we are not going to deep dive into every possible test you might need to make. First of all, you need to ask yourself…
This article is walk-through of testing a React Bar Graph with Jest and React Testing Library. The style of tests documented here could also be called integration tests. The gold standard for UI…
A few months ago I added a feedback textbox to the bottom of every article. I wanted to know when someone finds there way to an article do they solve their problem. I think the textbox was too much…
Often we can end up with complex logic in components because the shape of the data determines how we write our component code. Sometimes we are not in control of that data at all. If we can simplify…
tells CSS grid to slot in items where there is space. This shuffles around the visual order of the elements, the DOM tree remains in the original order. A dense layout can look something like this…
I had been following the Presentational and Container pattern invented by Dan Abramov, although it seems that even Dan has changed his views on the usefulness of this pattern with the introductions of…
Kent C Dodds mentions in his article about snapshot testing when referring to a particular snapshot. "What makes this snapshot good is it can communicate the intent by the title of the snapshot" I…
Sometimes typescript can feel like duplication, describing code that is already static (constant). Heres one trick to mitigate that by generating a string literal union type from an array. The…
To some extent, it is the design of tools like slack that makes them addictive. To avoid the point of diminishing returns with slack usage, we can nudge ourselves to become less addicted by making…
After re-reading YDKJS: Async and Performance. I had the realization that I have been making over-optimizations. I had not taken into consideration JS engine optimizations. Iterators Like always using…
This article will go over some component API design patterns at a high level without getting into implementation details of specific components. A Component API is the props of a component. When we…
What are Compound Components? It's a base component that expects to be combined with other component parts. Below the is the base component and the and components are the composable parts. It…
React-redux hooks like and the can have the same outcomes. The main difference between them is their ability to nudge (guide) the way you write your components. Understanding what each of them…
Tailwinds utility classes make styling lighting fast (for me at least) but I have found there is a point where conditional styling can become hard to maintain because it concentrates the complexity in…
Update: You might be better off using TSDX "TSDX is a zero-config CLI that helps you develop, test, and publish modern TypeScript packages with ease" There are so many options for bundling javascript…
AngularJS has ng-class for conditionally applying classes. This is a replacement for that in React. At accelo we are in the process of transitioning from AngularJS to React. We are not using a CSS-in…
This is a list of git aliases I commonly use, mainly this is just a reference for myself for when I change computers or when someone sees me typing them and wants to know more. If you have any more…
This article is not a tutorial on how to build a chrome extension from scratch. Maybe you know how to make an extension with vanilla JS and now want to build it with your favorite frontend library. We…
This is a solution for implementing color themes with tailwind. It makes use of CSS variables which are great providing that you don't need to support IE11. Those CSS variables that are referenced in…
Never override them Avoid CSS where the utility class is overridden. For example, overriding with a child selector. You want them to be predictable everywhere you use them. A warning sign for breaking…
Let's go over some ways to keep your z-index usage sane. All in one place Keeping all of your z-indexes in one place, in order. That way you can easily see what sits on top of what. The global file is…
I learned some things about media queries while looking into how they are used in Tailwind. It's a CSS library that generates utility classes, no prior knowledge about it is needed to follow along…
A problem I came across when using a mix-match of tailwind, purgecss and Gatsby is that selectors used in the generated pages were being stripped from the CSS. Tailwinds docs recommend using purgecss…
This article contains a strategy for creating category list pages from categories defined in a markdown article. There is an assumption of some basic knowledge of gatsby. Our end goal is to generate…
This article aims to show an alternative to overriding properties directly. Instead we can use CSS variables with the help of inheritance and media queries. I think that this approach leads to CSS…
This article explores using the currentColor property to theme elements, to avoid writing extra CSS to override color. In cases where you have an element that needs to have a few different colors the…
A magic number is a number or value in code that does not have an explicit meaning. In CSS maybe we don't have to be too strict and not every number usage needs to be a variable. But I think the more…
My approach to color usage is similar to a "no magic numbers" rule that you might find in javascript, where colors are always referenced from a variable. It's useful to think about color usage…
I like elements that move on hover to convey interactivity. A problem with this pattern is "flickering" that can happen when hovering over the space left behind. First lets make the button move up on…