Skip to content
HHackerTube.videoSurprise me

React without memo

React without memo on HackerTube: recommended by 1 Hacker News commenter across 1 month, 2022–2023.

React Conf

talk · intermediate · dated

Open on YouTube

A React Conf talk by Xuan Huang previewing React Forget, a compiler that automatically memoizes components. It argues for making memoization the default so developers need not write useMemo or useCallback by hand.

Why Hacker News recommends it

Shared in discussions of useCallback and memoization as the first look at where React was heading with an auto-memoizing compiler.

people recommended it
1
separate months
1
strong recommendations
0
discussed on HN
2022–2023
“I wanted to share this talk given at a recent React Conf”
— brundolf, Aug 2022, in “Not using useCallback is premature optimization”

What HN commenters said

3 Hacker News comments link this video. Each one links back to its thread.

brundolfAug 2022Recommends

For those pushing back, I wanted to share this talk given at a recent React Conf: ▶ this video The idea (still just an internal prototype) is that one day your compiler might automatically memoize all React components and intermediate values for you. It obviously would be great to skip all the syntax noise, as well as the linter-enforced rules around correctly maintaining dependency arrays, etc. But I think a big takeaway from this talk is that the React team sees memoizing as the norm . It is something to do by default , so much so that it may happen without your intervention one day. Immutability and value identity-based comparison are core to React. Violating these is the only way memoization can result in bugs (as some in this thread are worried about), and if you aren't following them then a lot of your React code is only working by accident to begin with, memo or no memo.

in “Not using useCallback is premature optimization” · View on HN

matvpMay 2023Cites it

There isn't much info out there yet, but this video is a small preview: ▶ this video The latest update is mentioned in the March 2023 blog post: [link]

in “Next.js 13.4” · View on HN

ksbrooksjrOct 2022Cites it

I agree that the typescript team should consider using the compiler to extend javascript rather than just supplement it with types. Like you said, there are technically parts of typescript that don't have a direct corollary in js (enums/namespaces), so why not take it a step further and add some of the features that js is missing? The only example where they've really taken that next step is with experimental decorators. I think in general the js/ts community is starting to realize that if we're going to have all of these build tools, we might as well use them to do more than just format, transpile, and bundle. Svelte has sort of pushed this idea with its abuse of the js label feature (it can detect when a variable is reassigned if you prefix it with the dollar sign label, which is technically not possible with js, even with proxies). There's also React Forget, which is promising to completely rewrite components at compile-time to avoid all of the gotchas that hooks have (and improve performance) [1]. In terms of making all of ts erasable, you can technically just write all your type definitions using js-doc comments, in which case the compiler can just be run with the --noEmit flag, and then the code is fully valid js without any modifications. [1] ▶ this video

in “Ten Years of TypeScript” · View on HN

Topics & tags