Ryan Carniato's Avatar

Ryan Carniato

@ryansolid.bsky.social

got signals? @solidjs.com @sentry.io previously: @netlify.com @markojs.com

6,620 Followers  |  67 Following  |  264 Posts  |  Joined: 16.05.2023  |  1.9921

Latest posts by ryansolid.bsky.social on Bluesky

Video thumbnail

Vite: The Documentary premieres October 9th at @viteconf.org in Amsterdam โšก
youtu.be/46fe5AFc0tY

04.08.2025 16:40 โ€” ๐Ÿ‘ 108    ๐Ÿ” 24    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 5

I need to play with this I think. My first question is if `useOptimistic` must be used inside a Transition and if not, what does calling the setter(2nd argument) do? Does it just set it until some future transition?

01.08.2025 16:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Yeah you've sold me on `useOptimistic`. I really like the shape of this solution. I wasn't sure at first, but now that I've developed granular derived primitives the DX can be clean like this without losing fine-grained updates.

Thank you.

31.07.2025 21:31 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Yeah that is a good point. Suspense leaving fallback happens independent of Transitions so my idea of combining the APIs like this doesn't hold up.

31.07.2025 19:23 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

But I admit I'm interested in hearing the answer. Because in the absense of `useDeferredValue` or `useTransition` you will be ripping things out to Suspense which I imagine is the outcome no one wants.

31.07.2025 18:32 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I thought `useDeferredValue` became more the go to because without exposing (and use of pending state) from these internal transitions people tended lose visual affordances. For a lot of in place changes the baseline today is tearing so pointing people that way is simpler than explaining Transitions

31.07.2025 18:32 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

The behavior is dictated by what is rendered rather than the call. Our only responsibility is to make sure the snapshot happens at the right time and that it gets the updated render.

31.07.2025 18:28 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

But I admit I haven't played with View Transitions enough to know if I'm missing something here. My thinking was that regardless of how the Transition shakes out the view Transition happens at the end. So as long as something requests it, it happens.

31.07.2025 18:28 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I implemented a similar Transition wrapper around optimistic updates in Solid Router (tied to Router actions more specifically). I wasn't as confident in the feature so I made them part of the router instead of core. And honestly it hadn't occurred to make it core until I later saw React's version.

31.07.2025 18:28 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

The thinking is that for large moves like navigation we're probably single future anyway. But for more granular same page type things because of the granular isolation of signals things might not converge as often as they would in a UI Component tree.

31.07.2025 17:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

My thinking for future Solid keeps that characteristic but attempts to use the reactive graph to determine if changes are isolated enough to do multiple in parallel. Basically if things overlap we have single future like today, but if they don't we can service them independently.

31.07.2025 17:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I think there are some difference in the model that I'm working on for future Solid from the proposed model for future React. Right now both solutions are pretty similar in that there is a single future. Although we don't ever cancel we just merge changes on top of each other granularly.

31.07.2025 17:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Yeah I mean composition is interesting I hadn't thought through this too far. This calls at the end. For isolated things there is no problem. For things that converge, if we were to call all the callbacks in sequence only the last view transition would apply which should still be fine.

31.07.2025 17:14 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Yeah we have `isPending` currently. I guess it was similar thinking for `useOptimistic` where it seemed arbitrary to just have a certain pending state when people might want to do different things.

31.07.2025 17:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

I wish the old experimental docs (~2019) were still up. I think Transitions originally had a configurable (global) timeout and held even with new Suspense boundaries. There was some change in thinking in realizing intent of "new" vs "existing" that was a breakthrough and changed approach.

31.07.2025 17:02 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

What I really want is to be able to do view transitions with this API.

startTransition(() => setTab('B'), (runEffects) => {โ€จ
document.startViewTransition(runEffects);
return true;
})

30.07.2025 15:33 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Basically allowing the `startTransition` API to be awaited so you can set your own signals on either side. Although maybe I will do it with a second callback.

setPending(true);
startTransition(() => setTab('B'), () => setPending(false));

30.07.2025 15:33 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I agree. This is something we're changing. I prioritized initially knowing in the tree. Technically you can make your own wrapper like we do with the router. But this is more onerous than the other way around. What I'm actually thinking right now is getting rid of the isPending Signal all together.

30.07.2025 15:33 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Yeah I changed to follow suit immediately when I saw this change. Suspense always had the existing boundary behavior, but letting the new boundaries go to fallback was genius.

This (and useDeferredValue) is what I meant by completion depending on read. It is why people associate with Suspense.

30.07.2025 15:24 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

The reason the lines blur is that while Transitions wrap from the write, the indicator of completion is still based on "read". So the state of boundaries can impact their completion.

However, they aren't interchangeable and cannot be completely replaced by each other.

29.07.2025 21:07 โ€” ๐Ÿ‘ 10    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Suspense, Activity, and other boundaries are fundamentally different than concurrent Transitions.

Boundaries are "read"-centric and local. They care about if/when something can be rendered.

Transitions are "write"-centric and global. They enable transactional state updates.

29.07.2025 21:07 โ€” ๐Ÿ‘ 28    ๐Ÿ” 2    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

We're live twitch.tv/ryansolid

25.07.2025 17:05 โ€” ๐Ÿ‘ 11    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
What Every React Developer Should Know About Signals
YouTube video by Ryan Carniato What Every React Developer Should Know About Signals

Fine-grained Rendering.
www.youtube.com/watch?v=VgGl...

24.07.2025 19:40 โ€” ๐Ÿ‘ 6    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
Asynchronous Svelte YouTube video by CodeTV

Definitely watch the full stream:
www.youtube.com/live/kL4Tp8R...

24.07.2025 18:18 โ€” ๐Ÿ‘ 5    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
YouTube Share your videos with friends, family, and the world

Just watched a great @codetv.dev stream about the exciting new Async features in @svelte.dev.

Thanks for the shoutout @rich-harris.dev:
www.youtube.com/clip/Ugkx_JL...

24.07.2025 18:18 โ€” ๐Ÿ‘ 31    ๐Ÿ” 1    ๐Ÿ’ฌ 3    ๐Ÿ“Œ 0
Preview
GitHub - ajcwebdev/ryan-gpt: Every Ryan Carniato stream ever summarized and turned into embeddings for chatting with Every Ryan Carniato stream ever summarized and turned into embeddings for chatting with - ajcwebdev/ryan-gpt

Also he created this. How could I not check it out?
github.com/ajcwebdev/ry...

24.07.2025 16:22 โ€” ๐Ÿ‘ 6    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Did AI Write This Summary? w/ Anthony Campolo
YouTube video by Ryan Carniato Did AI Write This Summary? w/ Anthony Campolo

I admit I know very little about AI tools. I spend most my time deep in mechanical R&D of frameworks. But my educational(video) content is definitely a place I can use the help. Anthony Campolo joins me tomorrow to talk about how these tools can help even me: www.youtube.com/watch?v=n0Xo...

24.07.2025 16:22 โ€” ๐Ÿ‘ 12    ๐Ÿ” 2    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 1

Most props are getters. I mean they are similar. But since they don't change shape we don't need proxies. However when spreads enter the mix then they show up.

The weird part of what I'm showing is previous updates to the store are kept when assigning outside references unless you clone the source.

23.07.2025 22:10 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

On the positive this doesn't mutate sources, can handle structured(immutable) diffing, has shared models, supports optimal deep tracking, and should be concurrent safe. So does all the things. But it doesn't escape its identity is still the underlying reference.

23.07.2025 20:45 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Solid Playground Quickly discover what the solid compiler will generate from your JSX template

At a certain point Proxy metaprogramming can endanger the semantics of JavaScript. When you blur the lines between immutability and mutability. Well you blur the lines.

Lots of different ways to take it. Not sure how I feel about where I'm currently at:
playground.solidjs.com/anonymous/ea...

23.07.2025 20:40 โ€” ๐Ÿ‘ 18    ๐Ÿ” 1    ๐Ÿ’ฌ 3    ๐Ÿ“Œ 0

@ryansolid is following 20 prominent accounts