Daniel Fry (@danfrydev) header
Daniel Fry (@danfrydev) profile picture

Software engineer in London. TypeScript and AI. VP SWE @jpmorgan @chase_uk

London
Joined February 2022
Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)Photo by Daniel Fry (@danfrydev)
Daniel Fry retweeted
hey. here's a little demo of the most meaningful improvement to my productivity since speech-to-text.
213
144
93
3,423
330,846
Daniel Fry retweeted
turns out TypeScript types can enforce an exact string length
8
4
2
145
122,406
Daniel Fry retweeted
Goal: Calculate a value once per render. Mistake: Declaring a parameterless function. Why? Because then the function may be needlessly called multiple times on every render. Solution: If a function takes no args, declare a variable instead.
18
19
2
361
39,926
Here's my favourite method for getting Go/Zig/Rust-like errors in TS. It's by returning custom errors from functions. - Shows right in the return type - Easy checking with instanceof - No deps required
88
79
29
1,497
175,388
loving this pattern to avoid redundancy in complex class declarations...extract the props from the class prototype and use it as the constructor argument ✅ typesafe ✅ no redundant interfaces ✅ constructor becomes a one-liner
36
83
7
1,250
96,575
Daniel Fry retweeted
TypeScript problem: You need to support any string value, but you’d like autocomplete support for common values. Solution: Create a union with "string & {}" on the end. Now you get autocomplete support for all values listed in the union, but can still enter any value.
19
80
7
838
98,946
349 days. 19 million steps. Finish line this Sunday🫡
323
2,368
460
49,091
3,903,671
TypeScript v5.5 is going to be soooo amazing 🔥 The type-checker will now be able to *infer* type predicates for us 😍 And there's more. Type predicates will ✨compose✨! Huge, huge thanks to @danvdk for landing this PR, I'm so excited about this!
8
39
3
225
12,109
Daniel Fry retweeted
😴 Tired: enabled not doing any type narrowing 🚀 Wired: the brand new skipToken 🔥 Now available in v5.25.0
21
39
4
522
55,708
I wrote a game of TicTacToe using only TypeScript's type system
10
10
202
34,137
Daniel Fry retweeted
We've got you covered
1
8
265
Daniel Fry retweeted
The Mac turns 40 today 🎂 To celebrate, we're giving away Raycast Pro with GPT-4 for one year to 40 people. Simply retweet this tweet and follow @raycastapp to enter. Winners will be announced by the end of the week.
55
927
42
716
285,804
Daniel Fry retweeted
📚 So I finally found the time to write about why we made the breaking parameter changes in v5, and what this new API enables us to do. Prepare to have your mind blown if you don't yet know what the Query Options API can do for you 🤯 tkdodo.eu/blog/the-query-opt…
12
42
2
374
45,435
TypeScript 5.4 will bring a new utility type: NoInfer. This will be EXTREMELY useful for generic functions where you have multiple candidates for inferring a type. In the example below, we use NoInfer to make sure that 'initial' must be one of the states passed.
32
137
11
1,280
107,403
Daniel Fry retweeted
📢Announcing TanStack Query v5 🎉🥳 🤝 unified object API 📈 simplified, optimistic updates ♻️ sharable mutation state 🔀 suspense and streaming w/ RSC ♾️improved infinite queries ⚡️ ~20 % smaller 🛠️new agnostic devtools 💾 fine-grained persistence
59
311
60
2,027
242,029
Daniel Fry retweeted
Implemented safe triangles to improve submenu selection in @shoelace_style today.
112
510
86
5,462
883,746
as a twitter video
32
110
53
951
117,207
❌ Avoid listening for ref changes with useEffect() in React. ✅ Instead use a ref callback function.
17
136
5
949
101,669
Daniel Fry retweeted
🔥 JavaScript Sets are about to become a lot more useful with these 7 new methods: .difference() .intersection() .symmetricDifference() .union() .isSubsetOf() .isSupersetOf() .isDisjointFrom()
81
794
63
5,188
558,559
❌ Avoid difficult-to-read conditionals to render elements in react. ✅ Instead use utility components for conditional rendering.
60
225
39
1,618
301,168