Jay Freestone

Jay Freestone

@jayfreestone.com

A product engineer living & working in East London. jayfreestone.com

69 followers220 following48 posts

Jay Freestone reposted

how to be good at your job - realize this one thing is actually made up of two separate things - realize instead of solving the direct problem you can solve a broader problem - instead of implementing thing, implement other thing that makes it easier to implement thing

If you're not sticking with traditional OOP and don't have a clear domain model, you might not need the repository pattern. Most of the JS/TS examples I've seen in the wild start out well-intentioned, but devolve into a mess: www.jayfreestone.com/writing/you-...

jayfreestone.comYou might not need… the repository patternMost codebases implement a cargo-cult 'repository pattern' that Evans and Vernon would shudder at. What actually gets shipped is usually a grab-bag collection of methods that provide no real abstracti...

Jay Freestone reposted

A silly braindead pattern in modern app design: pseudo-“avatars” you can’t customize, serving no purpose at all

Late to the party, but I just discovered the 'blocking=render' script attribute. Used judiciously, it’s perfect for hiding components that depend on client-side JavaScript to render properly. Firefox is the only holdout, so support is already pretty good. www.jayfreestone.com/writing/inte...

jayfreestone.comIntentionally blocking rendering with JavaScriptYou nearly always want to put `<script>` tags in the `<head>` and mark them as non-blocking using either `async` or `defer`. However, there's an interesting use-case for actually *wanting* to block pa...

Jay Freestone reposted

🔥 I've been debugging @nodejs.org performance for over a decade. The hardest part? Making sense of thousands of stack frames in a flamegraph. What if your AI assistant could do that for you? Today, we're releasing a new feature in `@platformatic/flame`. 🧵

Jay Freestone reposted

🆕 npx unbarrelify At last, an easy way get rid of barrel files! Rewrites consumers to import directly from source, then deletes the barrels. Safe and fully automated, read all about it at github.com/webpro/unbar...

Jay Freestone reposted

Since people seem to interested in alternative Server Component architectures, might as well publish the source. These documents are rough, basically brain dumps. But I think thanks to Tanstack there is interest. "Isomorphic First Framework" hackmd.io/@0u1u3zEAQAO...

hackmd.ioIsomorphic First Framework - HackMDSeeing the reception to SvelteKit Remote functions and Tanstack Start I realize I probably should codify the architecture we designed on stream.

Jay Freestone reposted

TIL: the "sync" in @react.dev's useSyncExternalStore isn't for "synchronise", it's for "synchronous". As: it's not for synchronising against an external store, It's for synchronously (ie: disabling concurrent features) updating against a store's changes. h/t @tkdodo.eu 🤯

Jay Freestone reposted

🚀 Good news, everyone: GraphQL now supports OneOf input objects (aka input unions)! This long-requested feature is a small change that packs a big return for developers, making schemas more expressive and APIs easier to use. Read all about it 👉 graphql.org/blog/2025-0...

Jay Freestone reposted

@danabra.mov just dropped a blog post in the comments where he points out why RSCs effectively solve the problems a number of disparate technologies were created to solve (but can fall short). High quality content.

Jay Freestone reposted

“Introducing command and commandfor” by @keithamus.social This is one of the most exciting additions to the web platform in a while, in my opinion. Opens many opportunities from the get-go, but also opens many good opportunities in the future. developer.chrome.com/blog/command... #html #js #web

developer.chrome.comIntroducing command and commandfor  |  Blog  |  Chrome for DevelopersLearn about the new capabilities for declarative behavior on buttons.

Jay Freestone reposted

Great post today from a former NYT dev who traced the history of the widespread `useIsomorphicLayoutEffect` snippet back through multiple libs... and identified "a React-Redux maintainer" as the main source that everyone copied. Uh. Hi. Yes. That'd be me :) smoores.dev/post/no_such...

smoores.devsmoores.dev - There’s no such thing as an isomorphic layout effectThere’s something off about the most popular approach to quieting React’s warnings about using layout effects during server-side rendering. Let’s break down why the warning exists, and when it really ...

Jay Freestone reposted

Got this neat suggestion during the Vitest workshop this week. Wen can technically use `expect.fail` in "onUnhandledRequest" to make MSW actually fail the tests where unhandled requests happen. This isn't something I recommend as of now but an interesting idea.

Jay Freestone reposted

🌠 A long-requested CSS feature is the ability to transition height between a known value (`height: 20rem`) and a derived one (`height: auto`). A new global CSS property makes this possible now. 😄 html { interpolate-size: allow-keywords; } More info in thread 🧵

Reminds me of Sebastian Markbåge's tweet a while back: > This is also how most dependency injection in React apps should be done. Not Context. Import a named default value from JS. Override it in package.json imports.

I always felt this was awkward, as you usually want to inject, configure and control the double inline. Plus you likely need to mix and match *many* different dependencies for each test, rather than just have a 'test' and 'real' implementation of a single dependency/god object. Still, cool to see!

Even if you get it working, the solutions require another tool which you likely weren't using (will we ever break free of Babel?) Not great default behaviour. I suspect loads of people just end up shipping the whole thing.