News for hackers. Stuff that matters.

alexmacarthur

Re: on Saturday November 11, 2023 @03:25PM (#38234167)
In rare moments, you might want to execute script tags injected with React's dangerouslySetInnerHTML prop. Here's how to make it possible.
Re: on Sunday October 29, 2023 @11:28AM (#38059468)
For the best performance, there’s no good reason content-focused sites should ever serve an uncached page to a visitor. With modern caching directives and other approaches on the table, it’s easier than ever to preventing visitors from knowing your origin exists at all.

Impressive performance gains in moving TypeIt from Gatsby to Astro

The previous version of typeitjs.com was on Gatsby for several years. It was chosen during the framework’s hype days, and had grown in complexity along the way (there was even a great deal of home-grown documentation features in there as well).After building a few sites with Astro, I pulled the trigger on migrating TypeIt’s site over too. And I’m glad I did. The process was extremely...

( Read More... | no comments | on HN )
Re: on Sunday July 09, 2023 @09:00PM (#36660770)
Image performance on too many websites these days suck pretty bad, making it difficult to build strong user experiences and SEO. I’m building this service that reformats, optimizes, and aggressively caches images just by prefixing the URLs. Hoping to serve people with established sites, but who don’t have a lot of time or resources to stay on top of image performance themselves. Let me know your thoughts, and how something like this might be improved down the road.
Re: on Saturday April 29, 2023 @05:28PM (#35757377)
I wrote a blog post breaking down some of the reasons Maps (and WeakMaps) are especially useful tools when working with a large number of DOM nodes.
Re: on Sunday March 12, 2023 @04:59PM (#35126199)
With so much going on on the browser's main thread, keeping a canvas animation buttery smooth can sometimes be a challenge. I wrote about how Web workers can help ease that hassle by handling the painting process elsewhere.
Re: on Sunday January 29, 2023 @04:08PM (#34572770)
Reviewing some of the most common approaches available to remove event listeners in JavaScript.

Show HN: A stab at building my own string diffing library

Took a stab at building my own string diffing JS package.I built an interactive demo for TypeIt’s website (https://typeitjs.com/build-your-own) a while back. The approach I took to handle user input necessitated a way to calculate the difference between the versions of a user’s text input.I searched around for a package to help me out and found a couple of good ones (like fast-diff), but I...

( Read More... | 8 comments | 29 points | on HN )
Much appreciated feedback!

Christian Git: A collection of aliases to sanctify your Git workflow

A while back, I began creating aliases for some basic git commands. Eventually, I began to explore how to alias the "git" command itself (for example, 'g status' would execute 'git status'), and the best way I could make this new alias portable and distributable.As a result, I turned to creating a Node package for this as a first-time run. Christian Git is what came about: a collection of...

( Read More... | 1 comment | on HN )