Advertisement · 728 × 90

Posts by Dennis Kats

Preview
React 19 SkipRenderOnClient.tsx GitHub Gist: instantly share code, notes, and snippets.

For anyone that recalls the SkipRenderOnClient React SSR performance hack, if you have run into compatibility issues since React 19.2+, I think I've found an idiomatic fix: gist.github.com/denk0403/be1...

1 month ago 0 0 0 0

Personally, since cleanup functions were added to ref callbacks, I've begun to sorta see them as effects, and at times using them instead of useLayoutEffect for things. But I now realize that might behave weirdly with Activity, which I bet still runs ref callbacks, but doesn't commit effect events

2 months ago 1 0 0 0

The framing that helped me was that useOptimistic creates a proxy for the provided argument, and in a transition, you can set the proxy to use a different ephemeral value. This clarified for me that I also need to do something (async) in the transition to actually update the provided argument.

2 months ago 1 0 1 0

Though I just remembered WebSockets exist and are full duplex, so I wonder why they aren't used already

4 months ago 0 0 0 0

But maybe we should be writing server actions as if it is supported so we get progressive enhancement.

4 months ago 0 0 0 0

Also with a custom protocol, I believe it could allow for full duplex streams once browser support improves. At the moment, "use server" waits for all serialized promises to resolve before transmitting the request, which definitely makes it a bit less useful currently.

4 months ago 0 0 2 0
Preview
Bug: View Transitions occasionally stall with default `onDefaultTransitionIndicator` · Issue #35015 · facebook/react The default onDefaultTransitionIndicator seems to sporadically stall view transitions. This does not occur with a custom onDefaultTransitionIndicator handler. This occurs in Chrome, and Safari with...

After some investigation, I think that error is due to a React bug. I didn't notice anything particularly wrong with the router code, and my random attempts to fix it on the router side weren't fruitful. So I filed a bug report: github.com/facebook/rea...

5 months ago 0 0 0 0
Preview
[Fizz] Support Suspense boundaries anywhere by gnoff · Pull Request #32069 · facebook/react Suspense is meant to be composable but there has been a lonstanding limitation with using Suspense above the <body> tag of an HTML document due to peculiarities of how HTML is parsed. For ins...

It's not ideal, but you can put a Suspense boundary around the <body> tag of your root layout, and React will not start streaming until it is unblocked. Unfortunately, you will also lose visibility into which parts are blocking.

5 months ago 1 0 0 0
Post image

I think "below the first div" is the direct child of <Item> in LessonCard, which for me doesn't fix the issue. It only works with an extra DOM node for me.

Also, I occasionally see this error when toggling items quickly. It causes the whole page to freeze until the timeout.

5 months ago 0 0 1 0
Advertisement
Preview
ViewTransition around Lesson prevent interaction with all items · Issue #1 · rickhanlonii/async-react Whenever i check/uncheck a Lesson, all Lessons participate in a view transition preventing further interaction with them until the end of the view transition. Is there any way to prevent the items ...

Yea that seems to fix it. Interestingly, that's closer to the first workaround I mentioned in github.com/rickhanlonii..., but I was missing the default "none" piece. I'll update the comment and PR with this fix, but it's also not really clicking for me why the extra <div> is necessary.

5 months ago 0 0 1 0

Somehow I didn't notice until now there was search functionality. But yea it does break it :/.
What do you mean by "below the item"? Like below <Item> in the LessonCard component? When I add a default "none" there, it also break search filtering animations.

5 months ago 0 0 1 0
Preview
Fix view transitions from blocking interactions for static list items by denk0403 · Pull Request #4 · rickhanlonii/async-react Fixes #1 using second technique described in #1 (comment)

Kind of feels like a React bug where it's too aggressively applying view transition names. But this is my best attempt at a workaround: github.com/rickhanlonii...

5 months ago 0 0 1 0
Preview
JSer.dev Personal homepage of JSer, and his blogs.

As for low-level details, I highly recommend looking through @jser.bsky.social's blog. jser.dev

5 months ago 1 0 1 0
Preview
React 19 Resources React 19 Resources. GitHub Gist: instantly share code, notes, and snippets.

I have a gist of various React 19 resources. They're probably more high-level than what you're looking for, but they're great for building intuition. gist.github.com/denk0403/ef1...

5 months ago 2 0 1 0

In my codebases, I usually use this trick: x.com/sebastienlor...
Seems to also work if you use `shouldRender` to determine the Activity mode.

You could also suspend with an infinite promise to delay hydrating non-visible components, but in my experience this ends up being very slow for some reason

6 months ago 0 0 1 0

React compiler or even just the memo API should help in this scenario, right? And I can't come up with any scenario where the isPending flows into the suspending component that doesn't feel kind of absurd. So long-term, this probably isn't an issue

7 months ago 1 0 0 0
Preview
[React 19] Async transitions race condition handling · Issue #28914 · facebook/react Summary Repro: https://stackblitz.com/edit/vitejs-vite-ymbqrc?file=src%2FApp.tsx How do we handle async transitions that resolve out of order? In the above reproduction the search for "a" can resol...

I also think it'd be beneficial to callout the difference between async transitions and transitions with async work, kind of like what's shown in this issue: github.com/facebook/rea.... I bet code like in the second message is a common mistake.

7 months ago 0 0 0 0

I think some more insight into how and when to use transitions could be helpful. Might be cool to also show it working with <Activity/> and <ViewTransition/>, but then you risk making people think transitions are still experimental as well.

7 months ago 1 0 1 0

Yea, I get the sense from a lot of devs on my team that they think transitions are solely for optimizing performance, or just some advanced feature they haven’t needed yet. In general, I feel like many devs still don’t actually think about concurrent rendering and how it impacts their application.

7 months ago 3 0 1 0
Advertisement
BBC News headline: Frankenstein is monster success at Venice film festival

BBC News headline: Frankenstein is monster success at Venice film festival

Actually, Frankenstein is a doctor success at the Venice film festival

7 months ago 24670 4634 198 116
Preview
Bug: Server functions error when returning a client reference · Issue #33534 · facebook/react Returning a temporary client reference from a server function causes an error. My understanding of the issue is that async functions will automatically check return values for .then() methods in or...

May I submit this one for your consideration then? It's a very unlikely edge case, and it has an easy workaround, but the actual fix also seems straightforward. github.com/facebook/rea...

8 months ago 2 0 1 0

Letdown

8 months ago 1 0 0 0
Preview
Mocking SpongeBob Meme Generator An over the top generator for the Mocking SpongeBob meme.

The first website I ever made: denniskats.dev/Mocking-Spon...

Made it before OffscreenCanvas was available, so it uses a hidden canvas and data URLS to display it as an image.

Last I checked, this gets around 1K visitors a month 😁

8 months ago 0 0 0 0

I really wish the email started with “Sure! Here’s a professional email you can scam Soren with:”

9 months ago 2 0 0 0

I think it works with plain JS too, but regardless it requires an IDE with TS integration. No clue if it works in other flavors of JS though, so having it as a feature of the language would still be nice

10 months ago 0 0 0 0
Documentation - TypeScript 4.8 TypeScript 4.8 Release Notes

Far from a perfect solution, but you can exclude modules from auto-importing via JS/TS preferences. Then “friends” are just modules where you manually import the “internal” modules. www.typescriptlang.org/docs/handboo...

10 months ago 0 0 1 0
Post image

It basically works how it would as a switch statement, but in a declarative and "lazy" way to support SSR.

10 months ago 0 0 0 0

Device width isn't fluid, but we wanted to support going between orientations or resizing the browser window without losing state or jarring the user. The idiomatic fix is to "lift shared state up" (and occasionally we still have to), but it's nice that sometimes we don't.

10 months ago 0 0 1 0
Post image

For us, it’s not so much that the mobile and desktop UIs look substantially different, but that the data and props passed to subcomponents may differ. Below is an example of the API. We wanted it so that switching between mobile and desktop did not remount the “Card” or “NeedHelp” components.

10 months ago 1 0 1 0
Advertisement

I’m unable to send you a DM for some reason, but I’m potentially interested. Could you DM me more about the role?

10 months ago 3 0 1 0