dan’s alt Profile picture
secret alt of @dan_abramov2
58 subscribers
Jul 20, 2023 15 tweets 4 min read
i feel bittersweet sharing i’m leaving my job at meta in a few weeks. working in the react org at meta has been an honor. i am thankful to my past and present colleagues for taking me in, letting me make mistakes, helping me see my strengths, being kind, and sharing their time. for the past three years, i kept saying i’d leave “in a year or so” but the moment never felt right. i wanted to (1) finish the new docs and (2) see a broadly usable Suspense data fetching integration shipping. after years of work from the team, both have shipped this spring.
Jun 7, 2023 9 tweets 3 min read
fwiw i expected the article to be clickbait (and the title is) but it’s actually pretty balanced. imo it gets a few things wrong so i’ll provide an alternative perspective (tiny thread) the framing of “existing features like useState / react-query / CSS-in-JS don’t work” is misleading at best.

to understand why, consider that here is the React you already know… A circle saying React Tree ...
Jun 6, 2023 6 tweets 2 min read
yeah i thought this was nice. idk if “spatial computing” will catch on or will stay as an apple-esque “we’re too good to use the industry terms” thing, but i thought it’s funny that this launch simultaneously validated meta’s bet *and* made meta’s branding feel instantly obsolete mark’s meta announcement felt corny because they had to come up with a vision of mainstream aesthetics for a medium that has no mainstream community yet. of course it’s not believable! apple stuck with floating 2d stuff in the presentation because it feels familiar.
Jun 5, 2023 7 tweets 1 min read
lol sorry but i think apple did it again curious what the actual apple vision (not pro) looks like
May 19, 2023 4 tweets 1 min read
i mean i sorta get the point but also if a ballpen wrote stuff by itself and contained much of humanity’s collective knowledge within, maybe people would have a point being a bit more concerned about ballpens too? it’s more like a phone line with an alien made out of our voices which is maybe fine, who knows! the internet is pretty good imo and it sure sounds a lot more dangerous than a ballpen. but like idk it’s just such a freaky vibes piece of technology, both natural and freaky like golems or acid. you don’t see language itself reanimated every day.
Apr 20, 2023 4 tweets 3 min read
real talk. modern frameworks like Next.js and Gatsby have sort of an “SPA mode”. the main difference is with classical SPAs is that they produce several entry HTML files (per route). this means a purely static (not Node!) deploy needs a tiny URL -> path config. this trips people. we need to get past this hurdle collectively. it is ridiculous if this is the reason we’re delaying adoption of better tools. SPAs with multiple HTML entry files are much better SPAs! we just need some standard way to deploy these across providers.
Apr 20, 2023 8 tweets 2 min read
RSC quiz

function Note({ note }) {
return (
<Toggle>
<Details note={note} />
</Toggle>
}

the *only* Client Component out of these is Toggle. it has state (isOn, initially false). it returns <>{isOn ? children : null}</>.

what happens when you setIsOn(true)? now say isOn is true. you’ve edited the note and told the router to “refresh” the route. this refetches the RSC tree for this route, and your Note server component receives a note prop with latest DB content.

(1) does Toggle state get reset?
(2) does Details show fresh content?
Apr 19, 2023 10 tweets 3 min read
after the mess of early PHP code, much of the world has moved to “separating” view and controller. view templates in separate files, logic separately. but this is not what happened at FB. there, XHP fixed that. XHP is like JSX + React component model, but for PHP/Hack. so the “server” era Facebook code did not actually look at all like what you would see in the server code of the pre-React generation of most web development. it was not a bunch of controllers or template files. no, it was components! components that could do data fetching.
Apr 18, 2023 5 tweets 2 min read
everyone’s implying this is a bad way to look at it, but i am curious if someone can help me understand what exactly the objection is? is there a specific objection showing why this argument is bad, or are there multiple objections from different camps (eg agi [non-]believers)? like, is an ai aimed to understand the nature of the universe a laughable concept by itself? or is that idea ok but obviously is not close to feasible? or is it the implication that we’re objectively interesting? or is it truthgpt branding aimed at fox news viewers? all of it?
Apr 15, 2023 7 tweets 2 min read
here’s a good rule of thumb. for any “server components” solution, check how many network requests a client makes when *refetching* this tree:

<Server>
<Client>
<MoreServer>

where Server and MoreServer read some async data.

to meet the RSC bar, it must be one request. - if it doesn’t let you refetch the server content, it doesn’t meet the RSC bar

- if refetching this tree triggers multiple client requests, it doesn’t meet the RSC bar

- if Server and Client components are written with different technologies, it doesn’t meet the RSC bar
Apr 7, 2023 4 tweets 1 min read
good developer advocacy is bidirectional. it’s a cycle:

1. you learn from the team how to use something, and teach that to users

2. you learn from users what sucks about it, and teach that to the team

a good DA is essentially a product owner. they’re involved in the design. it’s interesting some people read “advocate” as “advocate for the product” and some as “advocate for the users’ needs”. it’s really both. sometimes you need to convince the people, sometimes you need to convince the team. the job is to make sure the story makes sense.
Mar 30, 2023 4 tweets 1 min read
docs are product want your company to invest in better docs? look at the reception for react.dev and put some of that on your slides. docs are a huge amplifier and deserve the investment.
Mar 29, 2023 7 tweets 2 min read
imo this post fails to convey that the path “in the middle” that re-executes only includes things along the way that *actually contribute* to that change — all the transformations of props you do in the middle. you *do* want to recalculate those :) a Signal does that on read the picture in the post is chosen so that you do not see that, but the point is that we (usually) should be able to prune all the siblings at every level except for the path(s) that actually changed. so it’s actually a pretty thin path down. not 100% free, but this matters a lot.
Mar 28, 2023 4 tweets 1 min read
imagine being so busy pattern-matching hype cycles that you forget to notice when something actually works "im not owned! im not owned!!", i continue to insist as i slowly shrink and transform into a corn cob with every frame interpolated by a language model. this is balenciaga, harry
Mar 26, 2023 20 tweets 4 min read
if i was 20 now i’d drop everything and jump into AI. i feel a great deal of FOMO tbh but also hesitant about abandoning all the context i already have in my field. not sure what to do. i think AI more or less replaces the middle layer. you still have the higher level of product design, and the lower level of designing the right composable primitives (language, core abstractions). at least for now.
Mar 21, 2023 17 tweets 14 min read
@TejasKumar_ RSC as a feature is at a different architectural *level* than most of our other features. it orchestrates how a bundler, a server, and a client tie together. at minimum, it requires a bundler with support for it. for pragmatic use, it also requires a router designed for it. @TejasKumar_ this is why it’s not drop-in.

bundlers don’t support it natively yet (though we’re in talks with bundler developers who are prototyping first-class support: @devongovett, @jarredsumner).

no routers except App Router are designed *for* it yet. it’s an entirely new category.
Mar 21, 2023 28 tweets 8 min read
i can’t believe we shipped react.dev. i know there’s still a lot missing and it’s been “available” in a very similar state for a while, but there’s something special about shipping it as stable. i don’t think i’ve ever worked on a single project for such a long time the original idea behind a big rewrite (rather than an update) was to “reintroduce” React. i think we’ve largely pulled this off. there’s a clear separation between modern and legacy APIs, and the bet on Hooks is unambiguous. i know the design is a bit bland but it’s fresh too.
Mar 17, 2023 13 tweets 3 min read
when i was thinking about possible futures for Create React App, it was clear client-only doesn’t make sense. way too limiting.

why are we always producing an empty HTML file if React can pre-render to HTML? why can’t i make a blog by map()ing over markdown files on my disk? for a while i thought maybe that’s what the next iteration of CRA should be. sure, you still don’t have to use a Node.js server — but you should be able to take advantage of running code during the build! it doesn’t make sense that you did not have that option.
Mar 16, 2023 4 tweets 2 min read
we actually agree with this. with Server Components, the equivalent code looks like this:

async function BlogPost({ slug }) {
const blog = await blogForSlug(slug);
// do what you like with it :)
}

alas, async/await during rendering doesn’t work so well on the client. we’ll try to provide more convenient primitives for simple ad-hoc fetches directly from React in the future. but even today, there are great choices like react-query. much nicer than useEffect + setState

function BlogPost({ slug }) {
const {blog, isLoading} = useQuery(...)
Mar 16, 2023 11 tweets 3 min read
imagine starting your ui library with super granular updates by default via some runtime mechanism. would you ever dare to remove them or make them more coarse? i think i probably wouldn’t. it sounds so obviously like a regression that it might be impossible to convince the users it’s hard to “show the numbers” because the numbers really depend on a specific case. if a generic tool is already used for cases where that trick *really* helps, going even slightly back is alienating that audience. even if it doesn’t help many other cases (or even hurt some).
Mar 16, 2023 14 tweets 3 min read
this hack is funny to me because it illustrates a cultural difference in naming at FB and outside. (tiny thread) in the community, this hack is called useIsomorphicLayoutEffect. this sounds science-y and convoluted, which of course perfectly matches the less charitable view of our community (for another example, i think andrew and i are both sorry for the “reducers” :)