Sign in

Sam Selikoff

@samselikoff.com
3.4K followers 78 following 150 posts

Next.js team @vercel.com youtube.com/samselikoff

PostsRepliesMedia
Sam Selikoff @samselikoff.com · 20/08/2026
now this is the "blessed" way. It just suspends during SSR and runs once the app is hydrated in the browser. Curious if that makes sense + how we could improve the docs!
000
Sam Selikoff @samselikoff.com · 20/08/2026
It's really just an escape hatch for when it doesn't make sense to SSR a component. Say you have a <Websocket> that only makes sense to render in the browser. Folks usually do "typeof window !== undefined" checks or "const isSSR = true; useEffect(() => setIsSSR(false)" to opt-out of SSR but
210
Sam Selikoff @samselikoff.com · 25/07/2026
BTW the main point I think Dan was highlighting is that you can do this cross-route instant navigation even though there's no normalized client-side store to render from. The details page doesn't have two ways to render (either fetch data from the db on page load, or reuse data from index), only one
030
Sam Selikoff @samselikoff.com · 25/07/2026
You could show something inline in the previous page too. But if you look at how most sites and native apps work these days, I think streaming UI is the way to make the best of a bad situation.
210
Sam Selikoff @samselikoff.com · 25/07/2026
I think so many sites stream their UI (bsky for example) is precisely because of (2). If internet is always fast it doesn't matter, but if internet is spotty (you enter a subway), or an upstream data source is slow, it's better for the app to respond immediately to your tap and show _something_.
100
Sam Selikoff @samselikoff.com · 14/07/2026
Hadn't seen this one, so glad you shared it. Does an incredible job balancing technical depth while keeping up the momentum. Will be coming back to this one for sure!
010
Sam Selikoff @samselikoff.com · 04/07/2026
Yep it's so you could set the cacheLife.expire time based on the Cache-Life header in the response for example. The directive itself is so you know at build-time which components are on "the cache computer" and which are on "the server computer". So things like children can remain opaque.
121
Sam Selikoff @samselikoff.com · 16/06/2026
Appreciate you man, it was so great to finally meet! Loved our convo 👍
030
Sam Selikoff @samselikoff.com · 22/05/2026
Oh man oh mannnn that is incredibly exciting!!
010
Sam Selikoff @samselikoff.com · 21/05/2026
I'm seeing Bright Eyes in two weeks!! Cute pup 🐶
120
Sam Selikoff @samselikoff.com · 03/02/2026
For the e2e locators specifically, can you use something like playwright's getByRole? Those automatically filter by visibility (and therefore are also robust to other UI patterns like tabbed navs or disclosures/accordions).
130
Sam Selikoff @samselikoff.com · 03/02/2026
We're discussing an opt-out since especially for existing code it can cause quite a few issues. I wrote more about the reason behind the change here if you're interested: github.com/vercel/next....
github.com
[cacheComponents] Activity component route preservation causes significant breakage in application logic, UI behavior and E2E tests · Issue #86577 · vercel/next.js
Link to the code that reproduces this issue https://github.com/SorooshGb/next16-activity-breakage-repro To Reproduce This reproduction demonstrates 3 issues caused by Activity-component–driven rout...
320
Sam Selikoff @samselikoff.com · 02/02/2026
Same, but a few years ago I moved to either trap bar (which doesn't go as far down) or rack pulls, and haven't had issues since. Have you tried either?
000
Sam Selikoff @samselikoff.com · 26/01/2026
Oh man Jon Hopkins, what a throwback. Did you ever get into Trifonic? www.youtube.com/watch?v=UA3W...
youtube.com
Trifonic - NightRun (feat. MindBuffer)
YouTube video by TrifonicOfficial
110
Reposted by Sam Selikoff
dan @danabra.mov · 18/12/2025
i wrote about my new hobby project overreacted.io/introducing-...
overreacted.io
Introducing RSC Explorer — overreacted
My new hobby project.
3755
Sam Selikoff @samselikoff.com · 18/12/2025
Been working on a new microsite to teach Next.js patterns, and I just published a new one: "Sharing data with Client Components" See how to use promises to keep your page unblocked so it can be rendered (or prerendered) as early as possible. Enjoy! next-16-recipes.vercel.app/sharing-data...
0284
Sam Selikoff @samselikoff.com · 15/12/2025
Absolutely. Already had an idea that seb showed me, using a server component for saved messages and a client component for an optimistic message. The optimistic state is not just data it’s a whole component. Would be so cool to see it in this playground.
050
Sam Selikoff @samselikoff.com · 15/12/2025
Basically I've seen a lot of people not understand that you can write your own client functions when using the action prop. Think it'd be good to show it off more. action={async (formData) => { const message = await greet(formData.get('name')) setMessage(message) })
110
Sam Selikoff @samselikoff.com · 15/12/2025
Btw, I really hate that uAS's reducer shape contaminates server actions with prevState first arg. I kinda think examples like this should show an inline client function that calls setState with the response, before jumping to uAS. Similar to how you'd useState before useReducer. Wdyt?
100
Sam Selikoff @samselikoff.com · 15/12/2025
"Ahh... look at that. The response is <Timer>. So <ColorTimer> gets rendered, the RSC tree melts away, and we return <Timer> with a new prop. Makes perfect sense."
110
Sam Selikoff @samselikoff.com · 15/12/2025
This is so good man. Could do a lot to demystify RSCs and Server Actions. I love this one. "Ok so I'm calling a server action that returns <ColorTimer>... wtf is happening?"
120
Sam Selikoff @samselikoff.com · 02/12/2025
Agree with you that flashing skeletons can be a very annoying UX, but the alternative is not being able to cache the initial UI, and Next evaluates the tradeoff in favor of speed here by default. Totally fine to wrap body in Suspense and generate the full response at request time though.
130
Sam Selikoff @samselikoff.com · 02/12/2025
Added some thoughts to your issue. For this one, it's less about it being async and more about it being IO. IO isn't cachable. That's why even sync APIs like Math.random or new Date() trigger the warning. The model wants you to keep your IO separate so that it knows what can be cached.
100
Sam Selikoff @samselikoff.com · 30/10/2025
revalidateTag (the new form, with the second arg) allows the next read to be stale, then triggers a background rerender.
030
Sam Selikoff @samselikoff.com · 30/10/2025
But the way the team intends it to be thought of is as "updating the UI". It's a "pull" of the freshest data in the context of a mutation that the current session kicked off. So I read it more like, "update the UI for this tag".
130
Sam Selikoff @samselikoff.com · 30/10/2025
Right, but updateTag basically triggers a read. So in a Server Action, you get the mutation + fresh RSC render in the same round trip. The name updateTag was a bit strange to me at first, because as you say it's not really "updating the tag"...
120
Sam Selikoff @samselikoff.com · 30/10/2025
Basically refresh() is as if you hit +R, but we can send the updated payload in the same round-trip as your mutation. In the past folks used revalidatePath('/') for this but that was overloaded & had the additional behavior of expiring caches.
130
Sam Selikoff @samselikoff.com · 30/10/2025
Yes exactly 👍 updateTag is for updating "tagged cached data" (i.e. data that's been "use cache"'d as well as cacheTag'd). refresh() is for rerendering the RSC tree. So any dynamic data will be refetched (but any cached data that isn't expired won't be).
260
Sam Selikoff @samselikoff.com · 30/10/2025
updateTag is for updating cached data, but if you're just mutating and want the dynamic data on the page to update refresh is what you want
220
Sam Selikoff @samselikoff.com · 27/10/2025
Yep understood + agree. Working on a canonical tutorial. Server-side version of refresh is new, previously folks were using revalidatePath() to accomplish something similar but now that we have it it's the right way to refresh dynamic RSCs. Basically makes your UI look as if you +R.
0100
Sam Selikoff @samselikoff.com · 27/10/2025
The reason I'd enable cacheComponents even if you're not using "use cache" is because it enables other behaviors like dynamic-by-default, which make Next overall easier + more predictable to work with. For new apps I would think of it as the default mode of Next 16.
160
Sam Selikoff @samselikoff.com · 27/10/2025
I would enable cacheComponents in next.config.ts, and just build your app as a dynamic/uncached app to start (i.e. don't worry about "use cache"). Then, after a mutation in a server action, call `refresh()`: nextjs.org/docs/app/api... That will send over the updated UI in the same round trip.
nextjs.org
Functions: refresh | Next.js
API Reference for the refresh function.
240
Sam Selikoff @samselikoff.com · 02/10/2025
Ah looks good now, hadn't checked since earlier 👍
010
Sam Selikoff @samselikoff.com · 02/10/2025
I think it's CDN, I saw sebbie mention is for the sandboxes on react.dev. They work if you fork them.
react.dev
React
React is the library for web and native user interfaces. Build user interfaces out of individual pieces called components written in JavaScript. React is designed to let you seamlessly combine compone...
100
Sam Selikoff @samselikoff.com · 02/10/2025
The clock example from Dan's talk was great. I feel like there's some contrived example that can communicate that... maybe a "subway network" demo? I feel like that's relatable (at least for me as a new yorker ^_^)
110
Sam Selikoff @samselikoff.com · 25/09/2025
Mic quality? That’s the thing I’m most curious about!
110
Sam Selikoff @samselikoff.com · 24/09/2025
It's so tasteful though, and they always still load fast, don't have layout shift, don't highjack scroll, etc. I think they do a really good job of capturing your taste and personality while being exemplary of a professional. I'd wager they really help with sales!
040
Sam Selikoff @samselikoff.com · 24/09/2025
Fantastic work man! Always love the detail in your landing pages.
150
Sam Selikoff @samselikoff.com · 23/09/2025
It's going to be insanely awesome. Cannot freaking wait
020
Sam Selikoff @samselikoff.com · 23/09/2025
Oh yeahhhh! Nice!
010
Sam Selikoff @samselikoff.com · 22/08/2025
Very interesting. Nice work exploring a new pattern 👍
010
Sam Selikoff @samselikoff.com · 21/08/2025
How do they get passed as props? Do you automatically send them over from the client in the call to re-render the page? Also does this mean the RSCs re-render every time client components re-render? I honestly am not understanding how this could work haha
100
Sam Selikoff @samselikoff.com · 20/08/2025
What happens if you conditionally render the RSC based on the client's state value from useState?
100
Sam Selikoff @samselikoff.com · 20/08/2025
I had a feeling it must be something like this – cool stuff! Curious to see how it feels, will have to give it a spin soon :)
200
Sam Selikoff @samselikoff.com · 20/08/2025
Cool stuff! Love seeing more frameworks exploring RSCs. How does this example work – I thought it was a fundamental part of the design of RSCs that client components can't import server components?
220
Sam Selikoff @samselikoff.com · 01/08/2025
Awesome. I think a <Button pressAction={}> component from Aria would be a killer example to motivate this pattern!
130
Sam Selikoff @samselikoff.com · 01/08/2025
Maybe I can work on this next after we get Activity merged
010
Sam Selikoff @samselikoff.com · 01/08/2025
Here's another example from from @aurorascharff.no: aurorascharff.no/posts/buildi... She actually follows exactly the pattern Seb mentioned in that github thread with Devon
aurorascharff.no
Building Reusable Components with React 19 Actions | Aurora Scharff
In this blog post, we will explore how to build reusable components with React 19 Actions, track transition states, use optimistic updates, and expose action properties for custom logic.
130
Sam Selikoff @samselikoff.com · 01/08/2025
I actually do think this use case is realistic if you use the absolute positioning pattern like here: www.radix-ui.com/themes/docs/... I have a <Spinner> I copy-paste around all my apps that does this. A <Button clickAction={}> that did this would be great for design systems to have.
radix-ui.com
Spinner – Radix Themes
Displays an animated loading indicator.
140
Sam Selikoff @samselikoff.com · 01/08/2025
a server action but the UI could flip immediately. It would also flip back if the action failed. I think that's a good use case!
120