HNHacker News
TopNewBestAskShowJobs

andrewingram

3,005 karma · joined July 6, 2010

submissionscomments
andrewingram··on Progressive JSON
Yes, hence the last paragraph in my comment :)
andrewingram··on Progressive JSON
I also appreciate that you’re doing these explainers so that people don’t have to go the long way round understand what problems exists that call for certain shapes of solutions — especially when those solutions can feel contrived or complicated.

As someone who’s been building web UI for nearly 30 years (scary…), I’ve generally been fortunate enough that when some framework I use introduces a new feature or pattern, I know what they’re trying to do. But the only reason I know what they’re trying to do is because I’ve spent some amount of time running into the problems they’re solving. The first time I saw GraphQL back in 2015, I “got” it; 10 years later most people using GraphQL don’t really get it because they’ve had it forced upon them or chose it because it was the new shiny thing. Same was true of Suspense, server functions, etc.

andrewingram··on Progressive JSON
For the use case of streaming data for UI, I don’t think empty arrays and nulls are sufficient information. At any moment during the stream, you need the ability to tell what data is pending.

If pending arrays are just returned as empty arrays, how do I know if it’s empty because it’s actually empty, or empty because it’s pending?

GraphQL’s streaming payloads try to get the best of both worlds, at any point in time you have a valid payload according the GraphQL schema - so it’s possible to render some valid UI, but it also communicates what paths contain pending data, and then subsequent payloads act as patches (though not as sophisticated as Mendoza’s).

andrewingram··on Show HN: templUI – The UI Kit for templ (CLI-based, like shadcn/UI)
From what I can tell it's a Go-based library for building web UI.
andrewingram··on Show HN: templUI – The UI Kit for templ (CLI-based, like shadcn/UI)
Nit: I just spent about 5 minutes clicking around trying to find out what templ is.

I could've just Googled it sooner, but I was just surprised I couldn't find any reference to the thing it's actually building on/for.

andrewingram··on CSS Painting API
A few years ago I tried to use it to implement mesh gradients. It didn’t go well, mainly because you can’t draw individual pixels without cheating with lots of 1x1px rectangles. But it was a fun experiment.
andrewingram··on Lottie is an open format for animated vector graphics
I haven’t used Rive myself, but have been following its progress. Notably, the creator of Lottie joined the Rive team a couple of years ago. It’d be on my shortlist for tools to evaluate in this space.

I’ve personally pushed against the use of Lottie in projects I’ve worked on due to the file sizes being very difficult to justify for the kinds of animations that our designers wanted to use it for. SVGator was another alternative we had success with.

One thing I’ve been very frustrated is the amount of places I see Lottie pushed with no mention of file size. ie tools like Webflow, and general advocacy from prominent figures in the tech community. I’m sure there is a sweet spot for Lottie, but I’m also convinced that there are better choices for use cases most people are using it for.

andrewingram··on Zod 4
We have an enormous number of backend-only Zod schemas that are used as part of our data pipelines; so it doesn't seem like something that only exists to solve SPA problems.
andrewingram··on Zod 4
Is there any interop between v3 and v4 schemas themselves? We have an enormous graph of hundreds (if not thousands) of Zod schemas, many inheriting or extending others. It's difficult to envisage us being able to do an incremental upgrade unless both versions can interact neatly.

But I am looking forward to seeing if this fixes our issue where in the worst case a 500 line schema file turns into 800,000 lines of generated types.

andrewingram··on ArkType: Ergonomic TS validator 100x faster than Zod
A fair number of unions, yeah. Which also means some of the tricks for keeping the types small don’t work —- ie taking advantage of interface reuse.
andrewingram··on ArkType: Ergonomic TS validator 100x faster than Zod
We use it heavily for backend code, and it is a bit of a hot path for our use cases. However the biggest issue is how big the types are by default. I had a 500 line schema file that compiled into a 800,000 line .d.ts file — occupying a huge proportion of our overall typechecking time.
andrewingram··on Show HN: Nue – Apps lighter than a React button
Yeah, I think both these are true:

1. React is bigger and slower than it needs to be. There are likely better choices today. 2. Most websites will be bigger and slower than they need to be due to the endless September of new devs, and the rarity of being given space to focus on size/performance. As React is popular, it means even if React was tiny and fast, these websites would still be slow.

andrewingram··on Minding the gaps: A new way to draw separators in CSS
Came here to make the exact same comment, just being able to specify a border feels a little shortsighted.
andrewingram··on Things we've learned about building products
I did a "trial week" at Linear a few years ago, essentially the same thing but for an entire week.

Nice to get paid, but even getting paid is stressful if you're used to working PAYE and not having to think about how to do taxes on foreign income. The process works out very well for Linear, but as a candidate... not so much. It was probably the most stressful week of my professional career. You can't really simulate a typical work day or week with the stress of a sword of damocles over your head.

The thing I was tasked to do was pretty simple on the surface, but had some unexpected dead-end avenues that ate up quite a bit of time. So ended the week with "you're not fast enough". If I'd hit on the correct approach from the start i'd have probably easily finished early, so it really felt like a coin toss to me.

andrewingram··on Cognitive load is what matters
In recent years my general principle has been to introduce an abstraction (in this case split up a function) if it lowers local concepts to ~4 (presumably based on similar principles to the original post). I’ve taken to saying something along the lines of “abstractions motivated by reducing repetition or lines of code are often bad, whilst ones motivated by reducing cognitive load tend to be better”.

Good abstractions often reduce LOC, but I prefer to think of that as a happy byproduct rather than the goal.

andrewingram··on If not React, then what?
React does have a bunch of legacy baggage holding it back, definitely from a performance angle. But I think a major part of the issue is just the fact that React _is_ so popular, with that comes the inevitability that the majority of people using it aren’t all that experienced. It’s relatively easy to build a React app that performs pretty well if you prioritise performance, though not as easy as something say Svelte or Solid, but getting performance to be prioritised and rewarded is the real battle —- as mentioned in the article itself.
andrewingram··on Show HN: One – A new React framework unifying web, native and local-first
I think there are two valid interpretations of the words “local-first”.

1) The outcome of all interactions can be seen locally first, but are sent to a server too. Optimistic updates on steroids, largely done to make software seem faster. Linear is the notable example.

2) The app is built so that it’s fully functional and useful without any kind of internet connectivity. But if network _is_ available, there are some augmented capabilities. Think note-taking apps like the one built into MacOS and iOS, or Bear

andrewingram··on From Gatsby gridlock to Astro bliss: my personal site redesign
Even as a massive GraphQL fan, the GraphQL layer is what made me migrate all my projects away from Gatsby. It just doesn’t portray it at its best.
andrewingram··on How I Built My Blog
It wouldn't surprise me if a lot of those 100k lines were from the interactive playgrounds that are specific to each blog post.
andrewingram··on Nothing: Simply Do Nothing
Interestingly, http://www.donothingfor2minutes.com/ eventually morphed into Calm
andrewingram··on Remix is better than GraphQL
If I were using Remix, I'd probably trigger GraphQL queries from route loaders, one doesn't really obviate the other. Yes, there are challenges with using GraphQL well, but there's no inherent tension between it and the loader approach.
andrewingram··on After 6 years, I'm over GraphQL
When you build a GraphQL server, you’re creating a system that outputs page-specific endpoints. They can be generated just-in-time (the default) or at build time (the general recommendation).

The engineering work involved shifts from building individual endpoints to building the endpoint factory. This shift may or may not be worth the trade off, but there are definite advantages, especially from the perspective of whomever is building the client. And once you factor in the ease at which you can introduce partial streaming with defer and streamable (granted they’re still WIP spec-wise), the experience can be pretty sublime.

andrewingram··on Coding interviews are stupid (ish)
That does loosely suggest that something of fizzbuzz-level triviality may be sufficient for first-round filtering.
andrewingram··on How to Use JSON Path
We're using JSONPath to annotate parts of JSON fields in PostgreSQL that need to be extracted/replaced for localization. Whilst I'd naturally prefer we didn't store display copy in these structures, it was a fun thing to implement.

Contrived example:

    @localizedModel({
      title: {},
      quiz: { jsonPath: '$.[question,answerMd]' },
    })
    class MyQuiz {
      title: string;
      quiz: JSONObject;
    }
andrewingram··on The day I canceled my Spotify subscription
I miss the Spotify 3rd-party apps, I discovered some great music through them.
andrewingram··on Hyrum's Law
One could argue that React’s strict mode behaviour in dev is a guard against this —- as it prevented you from building things that will break with (the then) upcoming functionality.
andrewingram··on Mario Maker 2 API
Thanks!

The original inspiration was a DGR video in late 2021 when he showed the original chinese-language windows-based level viewer. That inspired me (as a Mac user) to seek out the API and level format documentation, then it was a whole load of trial and error to get the rendering working. There are more popular viewers (AFAICT) out there, but I enjoyed the challenge.

andrewingram··on Mario Maker 2 API
A few years ago I built a level viewer based on this API: https://www.smm2-viewer.com/

Was quite a fun challenge, some interesting tech at play, and interesting algorithm work to render out the slope tiles.

andrewingram··on Blueprint health protocol
More people will get to age 80 if we tackle the causes of aging
andrewingram··on Blueprint health protocol
They're illnesses for which age is the biggest contributing factor of whether you'll get sick, and how sick you'll get. Nearly every disease affects you more severely the older you are.
← PreviousPage 3 of 34Next →