Advertisement · 728 × 90

Posts by Jonathan

Preview
Pushing and Pulling: Three Reactivity Algorithms | Jonathan's Blog It’s looking like I’m going to need to build a reactive engine for work, so I’m going to prepare for that by writing down what I know about them. I want to look at three ways of building reactive engi...

Pushing and Pulling: Three Reactivity Algorithms: jonathan-frere.com/posts/reacti...

1 month ago 9 2 1 0
How to Recalculate a Spreadsheet

Did you see lord.io/spreadsheets/? That looks like a great resource for more specifics into different algorithms.

1 month ago 0 0 1 0

That's so cool! It looks very signal-y. I think there's a lot of value in separating these reactive containers from the UI layer directly, so that you can build your model separately from your UI and then plug them together afterwards.

1 month ago 0 0 1 0
Preview
Pushing and Pulling: Three Reactivity Algorithms | Jonathan's Blog It’s looking like I’m going to need to build a reactive engine for work, so I’m going to prepare for that by writing down what I know about them. I want to look at three ways of building reactive engi...

I wrote a brain-dump of everything I know about reactivity algorithms for UI frameworks (and other stuff as well): jonathan-frere.com/posts/reacti...

1 month ago 2 2 1 0

Nice work! How did you do the types in the end?

1 month ago 3 0 1 0
Preview
Additional Thoughts about the Command Pattern | Jonathan's Blog A couple of weeks ago, I wrote a post on my employer’s blog titled Undo, Redo, and the Command Pattern, which I ended up quite pleased with. Here, I wanted to add a couple of additional thoughts based...

A new post! And not just because GitHub sent me a notification that there's been no activity in my blog repo in almost 60 days... A follow-up on a post I wrote for my employer, and some thoughts on design patterns: jonathan-frere.com/posts/comman...

4 months ago 0 0 0 0

@thealexlichter.com, I saw your comment on HN about workspaces in tsdown and I'm excited to try it - is there any documentation for that yet? Is it just a way to define the configuration for an entire monorepo in one place, or is there more that it can do?

5 months ago 2 0 0 0

I've used classes for state objects in SolidJS a few times, although I've mostly moved away from it because I prefer the way hooks compose to how classes compose. But yeah - classes are a poor man's closure and vice versa!

5 months ago 1 0 1 0
Advertisement

I'd love to see more frontend tools lean into disposables. It's such a simple but powerful mechanism. But I think there's a good reason why almost every framework sharply turned away from classes when React hooks came out - hooks compose so nicely compared to anything class-based.

5 months ago 1 0 1 0

But like I said before, it's way more intuitive, and you only really need to think about it when you start doing weird stuff with the reactivity system. And you have the tools to manipulate it yourself (getOwner/runWithOwner) when needed.

5 months ago 0 0 1 0

It's similar to React because you've got this "secret" global scope that opens when you call certain functions, but it's different because you don't have the same ordering issues where if a scope gets created multiple times, it needs to have the same children added in the same order.

5 months ago 1 0 2 0

You're right, I'd forgotten that creating a new component doesn't create a new owner. But effects/memos still need to be called with a global ownership scope, so that SolidJS knows when to clean them up (i.e. when the given owner is disposed). That ownership scope is the hook-like invisible one.

5 months ago 1 0 1 0

But you're right that this is very different from React's signals in that calling one hook inside a component body won't affect the other hooks - there's no sense that hooks are ordered. There's just a single parent scope that hooks internally attach themselves to.

5 months ago 1 0 0 0

Signals are (mostly) regular objects without hidden state, but effects, memos, cleanups etc all rely on an invisible scope mechanism that allows Solid to track which effects/computations are owned by which components, and when they can be cleaned up.

5 months ago 1 0 2 0

With Solid you can use onCleanup and createComputed inside memos which gives you some of the lifecycle stuff, but I had a look at some other libraries and I don't think they have the same tools. So maybe the ability to do this is SolidJS specific?

5 months ago 0 0 1 0
Advertisement

I work on an Excel-clone that uses SolidJS signals under the hood for the cell reactivity, and it works quite well, but it gets a bit brain-bending sometimes, which I think is a sign that there's probably a simpler approach out there.

5 months ago 0 0 1 0

In practice, there's diminishing returns making things more fine-grained because of the increased complexity of trying to figure out which variables are being tracked when and where and how. There are some tools that can help a bit (c.f. solid-primitives), but nothing as simple as SolidJS for HTML

5 months ago 3 0 1 0

In theory, SolidJS or any other signals library should be able to do this. You can define your sources as signals, and create derived data using computed/memo values. To make it fine-grained, you can nest computed values, and control the reactivity that way.

5 months ago 0 0 1 0

Ooh, the getter trick is really clever. I also like DisposableStack#move(), which is really useful when writing a function that creates a bunch of resources and returns them. It lets you automatically dispose the resources if the function fails, but not if it succeeds.

6 months ago 2 0 0 0
Preview
Storing Unwise Amounts of Data in JavaScript Bigints | Jonathan's Blog Storing Unwise Amounts of Data in JavaScript Bigints This is a short note to document storing data in JS’s bigint type. I tried this out in a project recently, and it’s not obviously a terrible idea, as long as you take into account all the caveats that make it only useful for very specific case…

Storing Unwise Amounts of Data in JavaScript Bigints, by @jonathan-frere.com:

https://jonathan-frere.com/posts/bigints-are-cool/

#javascript

6 months ago 0 1 0 0
Preview
Storing Unwise Amounts of Data in JavaScript Bigints | Jonathan's Blog Storing Unwise Amounts of Data in JavaScript Bigints This is a short note to document storing data in JS’s bigint type. I tried this out in a project recently, and it’s not obviously a terrible idea, ...

Storing unwise amounts of data in JavaScript bigints
@jonathan-frere.com
jonathan-frere.com/posts/bigint...

#ECMAScript #JavaScript

6 months ago 2 2 0 0

There's an excellent podcast, More or Less, about numbers in the news, and one of the questions they always ask is "is this a big number?" E.g. is it a big percentage increase but for a small number? Or does it sound big but need to be divided by the population. It's the basics of stats literacy.

8 months ago 3 0 0 0
Advertisement

I think the only hope is that eventually they’ll run so many ‘inconclusive’ UBI trials that everyone will de facto be on UBI even though they won’t ever decide to implement it.

8 months ago 554 109 12 5
Preview
This Overly Long Variable Name Could Have Been a Comment | Jonathan's Blog Here’s a belief I’ve held for a while but only recently been able to put into words: explanatory comments are often easier to understand than explanatory variable or function names. Consider a complic...

Okay, this isn't perhaps the spiciest of takes, but I wrote about using comments vs using variable names: jonathan-frere.com/posts/names-...

9 months ago 2 0 0 0

In uni we did a course on parsing natural language with Prolog, and there were explanations of different types of language and how Prolog was designed to parse then, and then at the end of the course the prof showed us all the reasons Prolog can't parse English because it doesn't work like that.

9 months ago 2 0 0 0

This is a bit of a historical artifact though. Natural languages are parsed (haha) very differently from programming languages, even though a lot of the ideas come from the same discipline. They also behave differently and are apparently even processed by different parts of the brain

9 months ago 1 0 1 0

The less you interact with a page, the less likely it is for the browser to do something funky, so the more stable your tests will be

9 months ago 1 0 0 0

Also (and possibly controversially): do less stuff directly in playwright. Particularly for tests, have e.g. one test that tests the login form,and then all other tests that log in can fetch tokens via the API directly or use a dev-only shortcut to skip login

9 months ago 2 0 1 0

I think the flakiness is part of e2e/browser interaction in general. But playwright is typically pretty good at mitigating problems. Stick to the locator API as much as possible, even for complex logic, and use a linter to check for missing `await`s, and it's usually pretty stable.

9 months ago 4 0 1 0
Advertisement

Which model are you using for this? And do you notice significant differences between the models? I've been looking into Claude Code, but it's difficult to know which plans/models make the most sense.

10 months ago 3 0 1 0