Mateusz Burzyński Profile Banner
Mateusz Burzyński Profile
Mateusz Burzyński

@AndaristRake

6,214
Followers
388
Following
624
Media
12,062
Statuses

programmer but also a little bit of code-poet wannabe, maintaining XState, Emotion, redux-saga & more, OSS enthusiast, working at @statelyai

Wroclaw, Poland
Joined June 2014
Don't wanna be here? Send us removal request.
@AndaristRake
Mateusz Burzyński
2 years
I've spotted a new label in the TypeScript repo and I dig it 🤣
Tweet media one
11
101
977
@AndaristRake
Mateusz Burzyński
1 year
A code snippet like this saved me already *multiple times* when investigating why the focus shifts somewhere unexpectadly
Tweet media one
10
39
576
@AndaristRake
Mateusz Burzyński
2 years
OMG, you only tell me now about this?! { "jest": { "snapshotFormat": { "printBasicPrototype": false } } }
10
32
300
@AndaristRake
Mateusz Burzyński
2 years
This is not a drill! Improvements to the *in operator* might be coming in TS 4.9 🔥🔥🔥
Tweet media one
14
32
293
@AndaristRake
Mateusz Burzyński
2 years
One dev "super power" that I have is debugging... how do I teach this to others?
49
6
251
@AndaristRake
Mateusz Burzyński
3 months
Reverse mapped types are just so super elegant for certain use cases... Here we have an equivalent of `Promise.allSettled` that retains positional information for each item in the input
Tweet media one
8
14
242
@AndaristRake
Mateusz Burzyński
2 years
TIL: the second variant is more verbose but should be preferred because it's homomorphic (preserves property modifiers):
Tweet media one
5
30
228
@AndaristRake
Mateusz Burzyński
6 years
Just published a new experimental @babeljs plugin which makes it easier to write render props (no nesting!) based on @trueadm idea , cc @threepointone @IAmTrySound @reactjs
Tweet media one
Tweet media two
9
45
220
@AndaristRake
Mateusz Burzyński
2 years
This might be the weirdest fix I've added to a codebase after hours of debugging...
Tweet media one
18
1
216
@AndaristRake
Mateusz Burzyński
1 year
TypeScript 5.0 Beta is going to be published today! Can't wait for playing more with it
6
11
211
@AndaristRake
Mateusz Burzyński
1 year
const modifiers for type parameters are coming to TS 5.0, I had a feeling that this might happen soon loving, loving it ❤️ declare function bar<const T>(obj: T): T; bar([1, 'foo']) // readonly [1, 'foo'], and not (string | number)[]
7
31
207
@AndaristRake
Mateusz Burzyński
1 year
aaaand `const` modifiers on type parameters landed in TS 🚀
6
11
196
@AndaristRake
Mateusz Burzyński
2 years
Still need to read through the whole thing but this looks quite exciting for dealing with a class of stale closure problems
5
20
190
@AndaristRake
Mateusz Burzyński
1 year
Tweet media one
12
10
192
@AndaristRake
Mateusz Burzyński
2 years
Who said that OSS work doesn't pay bills? Jokes on you!
Tweet media one
8
4
175
@AndaristRake
Mateusz Burzyński
3 years
Tree-shaking deoptimizations demystified 🧙‍♂️ and some tips on how to make your libs more treeshakeable, by my humble self 😉
4
45
166
@AndaristRake
Mateusz Burzyński
5 years
redux saga v1 is finally out! just slight evolution, fixing past mistakes etc, certainly not the revolution. I hope your migration will go smoothly 🚀
10
59
164
@AndaristRake
Mateusz Burzyński
1 year
Just opened a new PR to TypeScript - one that would allow people to opt into "partial inference". The current problem is that once you supply any type argument - the rest can't be inferred (defaults are used). I'm trying to change that. Feedback welcome
10
13
159
@AndaristRake
Mateusz Burzyński
1 year
Yet another reason to avoid `instanceof` as much as possible.
Tweet media one
20
13
158
@AndaristRake
Mateusz Burzyński
3 months
to overload functions or to not overload them in TS? overloading is often easier but you might lose some control, especially when it comes to completions you can often do better with "dynamic rest" technique
Tweet media one
10
5
156
@AndaristRake
Mateusz Burzyński
1 year
My 100th commit has just been merged to @typescript It’s a wild run, learned a shitload in the process and yet I still barely scratched the surface. For more to come 🍻!
6
5
147
@AndaristRake
Mateusz Burzyński
4 years
@erikras given your description, I was literally expecting him to fall into the water - I'm confused now...
6
1
137
@AndaristRake
Mateusz Burzyński
2 years
Instantiation expressions are coming to TypeScript. It will, sort of, become possible to have the deferred application of type arguments. Wonky experiment to experiment with the syntax below and link to the TS PR too:
Tweet media one
11
9
138
@AndaristRake
Mateusz Burzyński
2 years
Over 10% of the currently open PRs to TypeScript are mine... I should get a Hoarder achievement badge from GitHub or something
5
1
131
@AndaristRake
Mateusz Burzyński
6 months
Not exactly the hottest feature but if you ever wanted to narrow types in TS using `switch (true)` then TS 5.3 will finally support this :)
6
15
130
@AndaristRake
Mateusz Burzyński
1 year
Nobody can say that my code reviews are not thorough 😅
Tweet media one
6
0
115
@AndaristRake
Mateusz Burzyński
1 year
@alistaiir Dont put types condition first when u are using type:module at the top of ur package.json. It’s a mistake and TS wont resolve it it correctly from CJS-targeting files (authored in ESM) when using moduleResolution:node16
11
8
116
@AndaristRake
Mateusz Burzyński
3 years
👩‍🎤 Emotion 11 is out! On 11/11 (at least in some parts of the world 😉). A year of tackling issues and helping the community - it wouldn't happen if not for the help of external contributors & the keen eye and the support of @mitchellhamiltn 🚀
8
26
113
@AndaristRake
Mateusz Burzyński
1 year
Reverse mapped types are extremely powerful in TypeScript - but very little known. Example: inferring per tuple element types based on one of the element’s properties:
1
5
114
@AndaristRake
Mateusz Burzyński
6 years
So I've written best practices for JS package publishing (more coming soon!) using @RollupJS & @babeljs , use them to make your libraries smaller 🚀
1
39
109
@AndaristRake
Mateusz Burzyński
2 years
Isn't TypeScript just beautiful? 😜 Instantiations expressions are just awesome and probably way underutilized and little known! They require TS 4.7 though
Tweet media one
22
8
103
@AndaristRake
Mateusz Burzyński
1 year
Understanding the foundations of the type system comes in pretty handy. Sometimes it helps write faster types 🏎 You can play around with those examples here:
Tweet media one
5
9
100
@AndaristRake
Mateusz Burzyński
5 months
My PR from 2017 to @babeljs has just been merged!
4
1
99
@AndaristRake
Mateusz Burzyński
1 year
Please don't reimplement package resolution algorithms. Use libs - they exist for a reason and they are **battle tested** Those few kbs that you can shave ain't worth the pain caused by the bugs you create by reimplementing this stuff
9
1
97
@AndaristRake
Mateusz Burzyński
8 months
1.toString() // syntax error 1..toString() // ok 1. toString() // syntax error 1 .toString() // ok 1/**/.toString() // ok
16
1
98
@AndaristRake
Mateusz Burzyński
5 months
Do you know how long it takes to land 100 commits to @typescript ? 7 months 😅 I'm quite proud of myself for landing my 200th 😉
@AndaristRake
Mateusz Burzyński
1 year
My 100th commit has just been merged to @typescript It’s a wild run, learned a shitload in the process and yet I still barely scratched the surface. For more to come 🍻!
6
5
147
9
0
97
@AndaristRake
Mateusz Burzyński
3 years
Oh man, i cannot lie, It still feels like a lucky roll of die: Moving from one amazing team To the job from my dream. State machines, readable logic, open source?! That life of mine have not turned out the worst 😉
@statelyai
Stately.ai
3 years
Time to share our current state. We're excited to announce the Stately team that will be working on the mission of making application logic more visual, robust, and accessible. Stay updated and get early access here: 👩‍💻🧑‍💻👇
12
29
188
16
3
95
@AndaristRake
Mateusz Burzyński
4 years
Stylis 4 has shipped - . Its a foundation of most css-in-js libs. A super tiny, fast and crazy as fuck css parser by @thysultan 👏 ive helped with the newest release a little bit but this is all this man’s mind. Blessed for having a chance to work with him
3
13
92
@AndaristRake
Mateusz Burzyński
2 years
nested `describe` blocks in tests are overrated... over time I often see tests added to random blocks because they are just appended~ to a file and nobody bothers finding the "proper" block. It's also hard to catch this during code review just list them all flat...
7
2
88
@AndaristRake
Mateusz Burzyński
2 years
Based on my recent findings - the best way to gain followers is to: 1. Post what has been merges to TS 2. Post about a jest config option 3. Engage with Dan Abramov in some super random thread I think im going to focus on those strategies now
4
0
87
@AndaristRake
Mateusz Burzyński
9 months
Why did this render? - Hook 66 changed
3
1
83
@AndaristRake
Mateusz Burzyński
2 years
I've heard stories about M1 but executing a full TS test suite in under 2 minutes with fans barely being heard... this is ridiculous. My previous Mac took over 15 minutes to run through this and I could barely use it for other stuff in the meantime 😱 😱 😱
11
3
84
@AndaristRake
Mateusz Burzyński
2 years
After more than 3 years - my old PR to React was kinda merged, making different types of memo components reusing old props more consistently during bailouts. Don't let your dreams die, just wait patiently 🤣
3
2
81
@AndaristRake
Mateusz Burzyński
2 years
I just had to pull over and recheck one extra thing in the TS playground that I had open cause I got a new idea while driving. I’m sick. Send help
9
2
78
@AndaristRake
Mateusz Burzyński
11 months
Just opened a new TypeScript feature request... this time for "named type parameters", this is what @tannerlinsley often refers to as generic bags declare function fn<{ a extends number, b }>(arg1: a, arg2: b): void fn<{ a: 100, b: 'foo' }>(100, 'foo')
8
7
77
@AndaristRake
Mateusz Burzyński
8 months
@matthewcp try { var foo = doStuff() } catch (err) { throw err } // use `foo` here
7
1
76
@AndaristRake
Mateusz Burzyński
1 year
How to start debugging an infinite loop? Just pause "at random" in devtools while looping and inspect the call stack. It might give you a lot of insight into what is happening. You don't need a breakpoint to pause!
Tweet media one
6
6
74
@AndaristRake
Mateusz Burzyński
4 years
0
0
72
@AndaristRake
Mateusz Burzyński
9 months
TIL that `typeof v === 'function'` and `isFunction(v)` behave differently in TS
Tweet media one
6
5
73
@AndaristRake
Mateusz Burzyński
11 months
Just opened a new feature request for TypeScript - a new `preferinfer` type parameter modifier: declare function get<T, preferinfer K extends keyof T>(obj: T, key: K): T[K] get<User>({ name: 'Andarist', age: 32 }, 'name') // string
10
8
72
@AndaristRake
Mateusz Burzyński
5 months
Tweet media one
6
2
71
@AndaristRake
Mateusz Burzyński
10 months
I poured (and continue pouring) so many hours of my thoughts into this... Check it out while it's hot 🌡!
@DavidKPiano
David K 🎹
10 months
After many years & lots of feedback, we're finally announcing XState v5 beta 🚀 npm i xstate @beta • Powerful new statechart features ⚡️ • Actor logic for anything, not just state machines 🎭 • Reduced API surface area 🗜 • New docs 📚 • So many fixes & improvements ✨
Tweet media one
26
112
657
3
2
69
@AndaristRake
Mateusz Burzyński
11 months
this is truly the darkest TypeScript magic I've seen
@arktypeio
ArkType
11 months
What if instead of hitting instantiation limits on cyclic types, your validator could pass them to optimized, type-safe generics? Everything you've been told about the limitations of TypeScript is a lie- you just have to be willing to think a bit of outside the box0️⃣1️⃣📦
Tweet media one
4
11
85
3
1
67
@AndaristRake
Mateusz Burzyński
5 months
I'm such a good contributor that @vercel lists me twice 🤣
@rauchg
Guillermo Rauch
5 months
Compiling the list of contributors for a @nextjs release never gets old. What an incredible community 🥲
Tweet media one
16
11
370
5
0
66
@AndaristRake
Mateusz Burzyński
3 years
Modern JS lib maintainer mantra: “please provide @codesandbox with the issue reproduced... please provide @codesandbox with the issue reproduced...”. Honestly cant imagine living without @codesandbox , the past without it feels grim nowadays
3
3
63
@AndaristRake
Mateusz Burzyński
1 year
Tweet media one
3
5
63
@AndaristRake
Mateusz Burzyński
2 years
React landed its `experimental_useEvent` hook a few days ago. There are also tests there that show that the very same behavior can't be implemented in the user-land - those callbacks get updated ASAP, before any other effect types
3
8
60
@AndaristRake
Mateusz Burzyński
1 year
@_philpl Dont worry, it always feels weird at first, you will get used to it though…
1
0
59
@AndaristRake
Mateusz Burzyński
2 years
And the saga continues...
Tweet media one
10
1
59
@AndaristRake
Mateusz Burzyński
2 years
Sometimes it's helpful to name "branches" of your conditional types in TypeScript and use pattern like this. I've seen this in some cool libs like . I've always wondered if TS can smartly only compute the "chosen" branch... 1/2
Tweet media one
3
4
59
@AndaristRake
Mateusz Burzyński
8 months
This is a valid JavaScript: class N extends null {} You can't construct an instance of this class but you can declare this class 😅
13
3
59
@AndaristRake
Mateusz Burzyński
1 year
Just refrained myself from posting a snarky response to a demanding OSS user. Is there now anything I can’t do? 😮
10
0
58
@AndaristRake
Mateusz Burzyński
3 years
Current status: time-travel debugging @typescript 's node run in a browser. @replayio is a hero tool I don't deserve. My dev life consists of 2 major eras now - I call them pre-Replay and post-Replay
6
8
58
@AndaristRake
Mateusz Burzyński
6 months
@DavidKPiano if you are not writing mov al, [count] inc al mov [count], al you are already doing it wrong
3
1
56
@AndaristRake
Mateusz Burzyński
9 months
@mattpocockuk My bet: in the past TS didnt have intrinsic type aliases so the latter couldnt be implemented without such
2
1
54
@AndaristRake
Mateusz Burzyński
1 year
Already experimenting with the upcoming `const` modifiers for TS type parameters. Thanks to a tip from @ahejlsberg I have a working spike for *recursive* validation of initial/states/ids in XState:
6
1
54
@AndaristRake
Mateusz Burzyński
2 years
Did you know that this can be a dangerous operation? const min = (arr: number[]) => Math.min(...arr) If your `arr` is big enough - it will blow up your call stack 😉 It's also not totally a made-up problem, I've patched this issue yesterday in @replayio
8
5
53
@AndaristRake
Mateusz Burzyński
1 year
I opened a TypeScript PR with the PoC for extending reverse mapped types inference with the capability to infer *multiple* things per tuple element/object property through (what I call) concrete properties Im pretty pumped about this potential feature 🤩
4
1
54
@AndaristRake
Mateusz Burzyński
1 year
What people will go through to squeeze two lines into one... amazing.
8
0
53
@AndaristRake
Mateusz Burzyński
22 days
TS 5.4 (stable) is available on npm already, grab it while it's hot 😉
2
1
53
@AndaristRake
Mateusz Burzyński
4 years
I can't express this enough but Preconstruct by @mitchellhamiltn ( ) is fucking amazing for building libraries, especially for monorepos. It just amazes me how little spotlight it gets. Go and star it - or even better, use it and spread the love 🧡🎁
4
8
52
@AndaristRake
Mateusz Burzyński
2 years
Couldn't agree more with @turborepo on this one 😉
Tweet media one
2
3
51
@AndaristRake
Mateusz Burzyński
1 year
Switching to modern moduleResolution in TypeScript be like #itsfine
Tweet media one
4
1
50
@AndaristRake
Mateusz Burzyński
2 years
Escape rooms are cool and all, but have you ever tried to merge two long living branches?
6
2
51
@AndaristRake
Mateusz Burzyński
5 months
@erikras memoizing the components is even a better optimization here - if u really need it. React might recognize that the return value is the same and might skip rerendering all of those Items altogether, without any prop checks nor anything else
5
0
50
@AndaristRake
Mateusz Burzyński
2 years
Friendly reminder - if you are already on React 18 please make sure that you are using `createRoot` API and not the classic `ReactDOM.render`. It might spare you some gotchas and save you from reundant rerenders
1
1
50
@AndaristRake
Mateusz Burzyński
2 years
I would consider myself pretty good at TS, I even manage to fix some things in the compiler itself and yet... I won't be able to ever internalize what {} and object types exactly mean 🤦‍♂️ Is it me or is it confusing for other people too?
5
0
50
@AndaristRake
Mateusz Burzyński
11 months
Super excited about this one! Stayed up late yesterday after having small epiphany during the day (brains are weird, lol) and... I managed to improve inference for context sensitive functions in mapped types
2
2
49
@AndaristRake
Mateusz Burzyński
1 year
@TkDodo Ok, ok, fine… I will move that util to a separate file so I can test it
3
0
50
@AndaristRake
Mateusz Burzyński
1 year
today's achievement: investigating which TS nightly broke my autocompletes - just to learn that it was my own PR from Dec  😅
10
0
49