Vite: The Documentary premieres October 9th at @viteconf.org in Amsterdam โก
youtu.be/46fe5AFc0tY
@ryansolid.bsky.social
got signals? @solidjs.com @sentry.io previously: @netlify.com @markojs.com
Vite: The Documentary premieres October 9th at @viteconf.org in Amsterdam โก
youtu.be/46fe5AFc0tY
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 ๐ 0Yeah 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.
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 ๐ 0But 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 ๐ 0I 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 ๐ 0The 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 ๐ 0But 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 ๐ 0I 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 ๐ 0The 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 ๐ 0My 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 ๐ 0I 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 ๐ 0Yeah 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 ๐ 0Yeah 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 ๐ 0I 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 ๐ 0What I really want is to be able to do view transitions with this API.
startTransition(() => setTab('B'), (runEffects) => {โจ
document.startViewTransition(runEffects);
return true;
})
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));
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 ๐ 0Yeah 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.
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.
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.
We're live twitch.tv/ryansolid
25.07.2025 17:05 โ ๐ 11 ๐ 0 ๐ฌ 1 ๐ 0Fine-grained Rendering.
www.youtube.com/watch?v=VgGl...
Definitely watch the full stream:
www.youtube.com/live/kL4Tp8R...
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...
Also he created this. How could I not check it out?
github.com/ajcwebdev/ry...
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 ๐ 1Most 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.
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 ๐ 0At 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...