Working on Apollo Client @apollographql Redux Toolkit Co-Maintainer Creator of RTK Query phry.dev

Deutschland
Your timeline might have quite a lot of butterflies today, and I've seen a bunch of people voicing the opinion that it's just "the libs leaving X". No. It's just impossible to have a technical discourse on a platform that uses an algorithm so tuned to ragebait.
5
5
27
7,327
Replying to @AdamRackis
If you really don't care, click "accept all" once and forget it forever. If you do care, blame the lazyness or greedyness of that web site's owners - this warning is purely optional, they could also just respect their users.
34
2
578
21,182
Did you know you can make `reduce` even more unreadable by putting an async function in there?
25
43
546
After witnessing "peak RSC frustration Twitter week", I sat down on the weekend and tried to write down my take on this - as a blog post. phryneas.de/react-server-com… More balanced. No unexplained frustration in 280 characters. And some constructive ideas.
8
55
289
97,273
Replying to @kettanaito
Very cryptic, but I get the hidden message.
3
265
6,242
I'm proud to announce that today we are launching an experimental package that will help people use Apollo Client with the new @nextjs App Router - in React Server Components, but also in Client Components with streaming SSR and Suspense! apollographql.com/blog/annou…
10
32
210
75,673
I didn't realize before, but in RSC, React.Component is not available anymore. Seems like React Class components are finally dead, officially.
13
9
167
68,541
I just came up with this neat trick to enforce that a hook argument or prop has hone through useMemo or useCallback. What do you think?
13
13
149
Replying to @alexdotjs
You can even `return false` in the finally block and change the return value after the fact.
7
147
8,653
I am looking for a new job. Does your company have a great product made for developers and you need a Senior FullStack Developer or a Developer Advocate? Do you have internal teams that need support and coaching to stay on top of tech? We should talk. phryneas.de/hire-me/
9
45
148
Replying to @kcnaija
Have you actually read that thread?
1
142
I'm thrilled to finally announce the release of a new @testing-library, React RenderStream testing library. We have been using the underlying approach in over 500 Apollo Client tests for a year now, and it has given us a new level of confidence. (Link in next Post)
3
29
138
45,984
I'm happy to announce that today is my first day working at @apollographql! I'll be working on the Apollo JS Client library and its ecosystem. Let's make this even more awesome! 🚀
21
5
124
15,974
Hey @kentcdodds, I just thought I give quick feedback: The promo emails have been piling up here. 16 emails in a week are not something that I want to get - it's quite annoying. I'm unsubscribed now. Is there something going wrong or is this intended?
8
1
114
Library maintainers! I just published github.com/phryneas/remark-t… to npm This could be interesting for your documentation. * it transpiles TypeScript code examples to JavaScript * it typechecks your TypeScript code examples * it allows you to include Docblocks from your sourcecode
5
23
116
Replying to @thekitze
If the alternative is one UI running on every port from 8000 to 9000 and having to remember the port number to make a click in a badly-designed obscure UI I'd happily take another CLI ;)
3
106
This one is for library authors: frustrated how TS versions handle your package slightly differently, but don't want to ship a full copy of your types with TypesVersions? Now you can adjust your types depending on the TS Version! Just published as npmjs.com/package/@phryneas/…
3
14
98
Trying to package a package for CJS and ESM with TypeScript types and export conditions for React Server Components is killing me right now. What's wrong here?
14
3
93
44,955
It's an amazing feeling to open @eggheadio and see my course for RTK Query in the spotlight like this. I'm super motivated and will soon start to record the intermediate course. In the meantime: check out this course - it's free! egghead.io/courses/rtk-query…
5
12
81
A few years ago I'd have been proud of coding for two weeks straight, now I'm kinda proud that I managed to stay away from it for two weeks.
6
1
81
I cannot stress how much I want to recommend everyone using Redux to go through our Style Guide from time to time. Many tutorials, blog posts and even books out there show styles of building Redux logic we explicitly recommend against. redux.js.org/style-guide/
1
13
84
The exact opposite of this whole thread. There's no reason to avoid any of these. Some of them should maybe be used sparingly and with purpose, but not avoided as a general rule.
7
5
76
25,525
> The React canary channel is stable for frameworks like Next.js to adopt Be honest: This point is such a fig leaf. The only framework that can get the insights to do so right now is Next.js, because you have the React team next door and there's no doc.
2
6
82
9,321
I'm procrastinating and building something that will forever change my #GitHub and #StackOverflow experience.
5
4
75
18,761
Replying to @mattpocockuk
Function calls >> both of them. Directives are so horrible to bundle.
1
3
72
4,673
Maybe you wanted `useRef<HTMLDivElement>(null)` ?
2
68
So apparently `Promise.race` can cause a memory leak because it never stops waiting for the failed promises. I would have assumed that something like that is handled by the JS engine. Of course we use that in RTKs `listenerMiddleware` - time to fiddle around...
3
2
65
17,844
I'm following the React repo's PR and there seems to be a trend of people submitting random optimizations that lack the understanding of why the code was like it was there before. It feels like a bunch of people are throwing the React sources into an AI and ask it "what could I make better"? And I'm conflicted. It's cool that this seems to enable access to high complexity code bases. But so far I haven't seen a single real improvement. The React code base is highly complex and a lot of the code there is written so the build tooling can best optimize it afterwards. For the React team, this most likely is just spam without value :/
4
2
65
13,138
Replying to @skillhubai
Hi, I'm a Redux maintainer. Those are two technologies that do different things and are often used together - about 40% of React applications choose Redux as well. You will *never* be in a situation to choose between them.
2
62
My talk at @ReactAdvanced has been accepted - I'll be talking about ADHD, not Redux or TypeScript. Wrong topic for a tech conf? I think not :) Looking forward to seeing all of you in London!
7
9
64
Replying to @nikitonsky @github
can you please make this a theme?
55
Calling it now: Someone is gonna find a bug that can only be reproduced with Node 22 stable, React 19 beta, TS 5.5 beta and Apollo Client 3.10, all which released in the last 24 hours or so.
4
4
59
6,498
Replying to @AdamRackis
Honestly, she makes a pretty good point. If there are people at the same company who are significantly senior to her and still earn the same amount of money, there's no incentive to stay there other than "enjoying the job" - which she clearly didn't. So good for her to get out.
3
54
2,272
"Next.js app router - now production ready, shipping a canary version of React." I think that RSC and streaming SSR have a lot of potential, but I think this is too soon, and I'm really not happy about this decision 🫤
5
5
54
31,575
I'm a bit sad that this was not communicated before. Fetch being patched is not a small thing - and from reading the code, this might cause problems with some polyfills - at least from my experience from creating RTK Query.
8
8
55
The React team has taken ownership of these types though, even if they are still in DefinitelyTyped.
2
49
3,251
I very much agree to this. TypeScript enables us library authors to do amazing things - but the ecosystem for lib devs is not there. Doing things right is often undocumented and a pain. Yet, it's worth is.
Library developers need better tooling! erock.prose.sh/typescript-te…
2
6
47
Replying to @diegohaz
No, sometimes I want to convey intent that the Compiler cannot meaningfully infer, and then writing the type explicitly is very valuable - for the author, the reader, and the codebase. After 6 years of TypeScript, JavaScript is just random mush to me that makes me anxious.
1
47
1,287
I'm happy to announce that my first @eggheadio course is now online: An introduction to the RTK Query Basics: Query Endpoints, Data Flow and TypeScript Check it out - it's available for free as a community resource! More courses to follow :) egghead.io/courses/rtk-query…
2
7
49
I wrote a blog article why you should not use the "discriminating union" #TypeScript pattern for #Redux reducers. I like the pattern, really. Just not in this case. It's a lie to the compiler (and yourself). phryneas.de/redux-typescript…
4
14
47
Replying to @kettanaito
But before that, you answer `for/of`, I hope? :D
2
46
20,970
Can confirm that hetzner IPs are perfectly fine. Using it for a decade.
4
42
11,396
And I have a working demo of RTK Query results suspensefully streaming from React SSR to the Browser, made possible by the hooks I patched into the React sources. Beware, everything about this is very experimental 😅 Tomorrow I'll do Apollo Client. github.com/phryneas/react/co…
1
7
44
13,040
Replying to @diegohaz
Has to be a bubble thing - in my bubble it's the other way round. But there also seems to be a bit of a disconnect here... IMHO, TypeScript mostly*is* about inference, not about types. Those should only be written where necessary. The less explicit types, the better.
1
42
8,166
The Redux Toolkit repository now uses yarn2 workspaces, which significantly reduces install times if you want to check out all the examples 🥳
2
2
42
We just published a new version of the `@apollo/experimental-nextjs-app-support` and `@apollo/client-react-streaming packages`. Version 0.11.0 comes with a lot of updates: - Prefetching queries for Client Components in RSC - Renamed exports - Next.js 15 support - Less transported data - @apollo/client-react-streaming/stream-utils
5
14
40
5,946
So some of the latest @nextjs canaries seem to error on build when an RSC-imported node module even just contains a hook - even if none of those hooks is actually imported. @leeerob could you please look into this? github.com/apollographql/apo…
2
5
39
22,905
Replying to @kcnaija
"Endorsment"? Really? That's your boost, and anyone should be affected by that? It's called analyzing the use case and using a fitting tool for the use case. I hope nobody ever does anything just because Facebook does it. Most of us have vastly different problems to solve.
4
37
Replying to @a_watch
Im ersten Moment dachte ich, mit "Dt. Zuckerwirtschaft" wären Homöopathie-Firmen gemeint 😆
35
This will break my mind.
9
37
3,543
Replying to @erikras
`type FruitPie = `${Fruit}Pie``
3
34
I just enabled GitHub sponsors. I don't expect that I'll be able to make a living from this, but if someone wants to show me their appreciation for my work, now they can 🙃 github.com/sponsors/phryneas
2
8
36
I'm making some good process learning how to add my own experimental hooks for better streaming SSR support to the React sources. github.com/facebook/react/co…
2
3
36
10,257
One of our users came up with a way around this: Put the secret token into a prop (which will leak into the client bundle), but encrypt it - and have the encryption key available only in RSC & SSR using non-exposed ENV variables. I made a package for it: npmjs.com/package/ssr-only-s…
😣 he's right Client components can't read cookies during ssr—credentials: include does not work in ssr fetch call, nor can cookies be read in middleware for that call I'm about ready to give up on app dir for app development. Maybe Tanstack or Remix will ship something usable
6
2
37
27,253
Me at... 20? Close enough. I had just won a "coolest program competition" at uni by implementing multiplayer-capable Tetris in an Assembler dialect for our "self-built" RISC-emulated processor. Good times ^^
Me at 19
1
34
8,290
While last #TypeScriptTuesday we looked at #TypeScript Generics Basics, today we continue where we left off, by taking a closer look at type argument inference, pitfalls and workarounds. We will take a look at a simplified version of #redux-toolkit's `createAction` function. 🧵👇
2
11
34
Honestly, I would love to scroll Twitter and see content written by humans instead of screenshots of content written by a bot. I'm here to read what you have to say because I think you're brilliant. It's okay to be hyped about these experiments, but can you please be human again?
3
1
33
Replying to @sangster @TkDodo
The cookie law is only about tracking, technically necessary things like session cookies is untouched anyways
2
32
Why have I never heard of `node:stream/consumers` before today? nodejs.org/dist/latest-v20.x… Available for `text`, `json`, `buffer`, `blob` and `arrayBuffer`!
5
1
33
4,387
Replying to @kcnaija
The performance increased mentioned in the blog article was gained by using plain C. What has swift to do with that? And how exactly was swift boosted? Is there any tooling available for swift developers now that wasn't before? Did it get better in any way?
1
31
Ihr zwei seid das Gold meiner Twitter-Timeline.
31
As a library author: hooks are amazing and allow me to ship APIs that were absolutely impossible before. As someone frequently answering questions in Reactiflux: hooks are amazing and allow me to answer questions much shorter
2
1
34
So as for this article, I honestly don't know if there is any way to change it to make sense... I have never suggested this before, but in this case, deleting it might be the best way to save face?
28
Replying to @mxstbr
<>Sometimes I write strings like this so TypeScript is happy</>
30
Where do I give that feedback? I'm yelling into an echo chamber in the RFCs and in the workplace group. At this point I'm giving conference talks in the hopes a React team member might see them at some point.
2
1
32
6,971
I just took a stab at implementing `use` support for RTK Query and just from looking at the code changes, this is mostly moving code around - almost writing no new code. It is probably the cleanest attempt at suspense support we've made so far. github.com/reduxjs/redux-too…
3
5
31
Replying to @pyrasis @TkDodo
The maintainer of React Query doesn't know Korean, but still is the best source of information you will get. Grow up as a human and be thankful if someone tries to help you
3
3
33
2,661
I just spent two hours debugging a user-submitted bug in Apollo Client that turned out to just be an `async` Client Component. This stuff is dangerous :(
2
1
32
7,524
Every other framework will be behind, because for a lot of the features the only "documentation" is the Next.js implementation. (Looking at e.g. the timing specifics behind useServerInsertedHTML - there's no guarantee or doc, the only safe thing to do is doing what Next does.)
1
2
32
4,218
Very happy to see that this is fixed in React 19 - finally useSyncExternalStore will batch together with other state updates and not cause double renders. (Think a Redux dispatch and a setState call at the same time.) github.com/facebook/react/is…
2
2
33
2,580
Tail recursive types make me fall in love with TypeScript all over again.
3
1
30
According to some people on tech Twitter, these people hate each other. They don't, at all. Such a wholesome discussion. People project too much 😊
3
3
32
5,374
Replying to @TheAnkurTyagi
Go by the React Docs Beta. Don't touch anything that shows class components or switch..case reducers. You want hooks. Always check library homepage & docs before starting external tutorials. @eggheadio and @frontendmasters are your friend, udemy will waste your time.
4
32
There is some very advanced #TypeScript trickery in this article: casualdeveloper.net/post/202… Nice to see some more esoteric articles out there :) Thanks to @acemarke for pointing it out to me!
1
13
31
Replying to @thekitze
Yup. But then there's also this part in the Redux docs - and there's a direction that Redux is pushing (no switching reducers, no type constants, no hand-written action creators, hooks where possible). It's a bit like bashing on React for Class Components in 2019.
2
1
31
Replying to @meijer_s
I think if you run 0.4, you're safe. Nobody knows how to compile an exploit for that. Everyone who knew retired already :)
28
1,606
Hello! 👋 This is my first post in the #TypeScriptTuesday series. Today, we're going to talk about the basics of #TypeScript Generics. Let's take this (simplified) example type from #Redux Toolkit and let's try to understand it.
2
13
27
And not building any confidence in his product. Why would I use anything when the person I have to interact with for help is behaving like this?
28
Can we all pack up the pitchforks and go home? This is being taken care of. No more mob needed. That PR is being rolled back in a major release, as agreed by the new maintainer in the PR, days ago.
3
2
30
7,255
Meeting my @apollographql team in person for the first time in half a year 😊 Let's watch (and give) some amazing talks at #reactadvanced!
3
29
2,309
If your CTR is not 100% and not every single person is actively watching every single minute of that video, that nuance is lost. And without that nuance, it's a fake screenshot of a non-existing tweet spreading fake news for clicks. There's no way to frame that positively.
1
28
Replying to @thekitze
Those Redux jokes are getting about as old as the style of Redux you're joking about... could be a good idea to take another look at what modern Redux (with Redux Toolkit and Hooks) looks like ;) Just saying, by now you're devaluing yourself more than you are devaluing Redux...
5
28
Replying to @tlakomy
But horrible minification. Always depends on context.
1
25
4,354
PSA: If you've been using one of the experimental packages for Next.js App Router support with Apollo Client, urql or React Query, please update that dependency ASAP. All three were vulnerable for an XSS attack, and all three packages just published a new version with a fix.
2
13
28
9,362
The scary thing is that paypal is using weird domains like this for years in legit mails. Just looked at a legit mail from them: epl.paypal-communication.com…
1
29
This #TypeScriptTuesday, we're going to take a look at #TypeScript's interfaces. Interfaces are different from types and both have their strengths in different situations. Let's take a look. This is just some interface definition - again an example from the #redux types: 🧵👇
2
6
29
You are skipping the (null).
28
Did some docs work on RTK-Query earlier and came up with this neat little trick to refetch unauthorized queries on login & re-fetch queries with errors. This invalidation model really allows for a lot of nice patterns 🥳
2
8
29
And then it's probably one line of runtime code behind all those types 😅
Looking at TanStack Router source thinking Link component would be simple to start out. github.com/TanStack/router/b… Yeah, I guess I don't know TypeScript
1
27
9,330
If you're not using strict mode, you're probably closer to the feature set of TS 1.5 than the feature set of the language everyone else knows as modern TypeScript.
If you're not using strict: true in your tsconfig.json, you're not using TypeScript.
2
5
26
5,015
I just realized that I like both advanced Typescript and Regex and now I'm questioning if I'm maybe just in for the weird syntax. 🤯
2
24
Found it!
Damn, where is my `as any as £V`?
2
28
2,268
This. The airbnb eslint config was a good guide/starting point 5 years ago. Times have changed. Don't use it any more for new projects. Only add lint rules you have understood and agree with.
1
4
26
Replying to @kentcdodds
"resource" ? Although I'd still go with "api route". JSON has not been there forever and that's what Accept headers are for.
2
24