Sign in

Andrea Simone Costa

@jfet97.bsky.social
21 followers 42 following 29 posts

Just some TypeScript here andreasimonecosta.dev/posts

PostsRepliesMedia
Andrea Simone Costa @jfet97.bsky.social · 26/12/2024
it is suspiciously similar to THIS: _ |_out_ 0 | 0 1 | 1
030
Andrea Simone Costa @jfet97.bsky.social · 24/12/2024
I've completed Parser Combinators: The Final Frontier - Advent of TypeScript 2024 adventofts.com/events/2024/24 Fuck "Type instantiation is excessively deep and possibly infinite", I wanna non termination
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
000
Andrea Simone Costa @jfet97.bsky.social · 22/12/2024
I saw that Andarist already answered. I just wanted to point out that article because there is no proper documentation when it comes to this topic
010
Andrea Simone Costa @jfet97.bsky.social · 22/12/2024
I wrote an article about homomorphic mapped types. I did a deep dive in the compiler to understand them andreasimonecosta.dev/posts/what-t...
andreasimonecosta.dev
What the heck is a homomorphic mapped type?
Let's try to understand what the TypeScript guys mean when they talk about homomorphic mapped types
120
Andrea Simone Costa @jfet97.bsky.social · 20/12/2024
curiosity: what is the longest lookahead you are currently using in arktype?
100
Andrea Simone Costa @jfet97.bsky.social · 18/12/2024
yeah that would have made me think I wasn't solving the challenge in the intended way 👀
020
Andrea Simone Costa @jfet97.bsky.social · 18/12/2024
media.tenor.com
a little girl wearing a blue shirt is standing in front of a shelf full of crowns .
ALT: a little girl wearing a blue shirt is standing in front of a shelf full of crowns .
010
Andrea Simone Costa @jfet97.bsky.social · 18/12/2024
Now that you made me think about it probably I'm cheating because I'm directly using the Color type in their test as upperbound 😂
120
Andrea Simone Costa @jfet97.bsky.social · 18/12/2024
I suspect you ahem didn't infer something
120
Andrea Simone Costa @jfet97.bsky.social · 18/12/2024
I mean the following was enough so I don't get what you are referring to <spoiler> const createStreetLight = <X extends Color>(colors: X[], defaultColor: X) => { console.log(colors); return defaultColor; } </spoiler>
130
Andrea Simone Costa @jfet97.bsky.social · 18/12/2024
Wait what did you do 😂 Which thing?
120
Andrea Simone Costa @jfet97.bsky.social · 16/12/2024
But this is less type safe and I got too many type instantiation error here and there and I didn't bother too much
000
Andrea Simone Costa @jfet97.bsky.social · 16/12/2024
@grad.dev @andarist.bsky.social I think we could just gather all the types of the arguments till the last one to then signaling an error when the last parameter is passed if the history does not match with the order we want. Not sure if that's what they had in mind.
100
Andrea Simone Costa @jfet97.bsky.social · 16/12/2024
I've completed Magic Curry Mind Control Inception - Advent of TypeScript 2024 adventofts.com/events/2024/16 Special cased for t4 😅 with a powerful T extends [string, number, boolean] XD
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
020
Andrea Simone Costa @jfet97.bsky.social · 16/12/2024
@andarist.bsky.social what do you think?
210
Andrea Simone Costa @jfet97.bsky.social · 16/12/2024
Yeah I think t4 should fail as t5 and I'm not gonna waste time on that ahhahaah
110
Andrea Simone Costa @jfet97.bsky.social · 15/12/2024
I've completed Jet Fuel Pricing - Advent of TypeScript 2024 adventofts.com/events/2024/15
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
010
Andrea Simone Costa @jfet97.bsky.social · 13/12/2024
#AdventOfTypescript #AdventOfTS Day 13
010
Andrea Simone Costa @jfet97.bsky.social · 12/12/2024
I've completed 🎩Bernard's Long List Of Names - Advent of TypeScript 2024 adventofts.com/events/2024/12
010
Andrea Simone Costa @jfet97.bsky.social · 10/12/2024
Yeah I remember I was tempted to write descriptions for some PRs of yours about reverse mapped types ahah Another idea would be a six month vacation, I suspect the TS team will be more then happy to cover all the expenses for you and your family 😜😂
000
Andrea Simone Costa @jfet97.bsky.social · 10/12/2024
That's just because I have only 3 PRs in total, I have to maximize the chances of being considere. You 575 😅. You don't need anything else than "fixes #12345"
100
Andrea Simone Costa @jfet97.bsky.social · 10/12/2024
Naming variables, git commit messages and PR titles are definitely not my strong suit 😆
110
Reposted by Andrea Simone Costa
Mateusz Burzyński @andarist.bsky.social · 10/12/2024
nice experimentation by @jfet97.bsky.social going on: github.com/microsoft/Ty...
github.com
Let primitive types discriminate a union of objects by jfet97 · Pull Request #60718 · microsoft/TypeScript
Main goal The ultimate goal of this PR is to allow primitive types in object unions to act as discriminants, even when there are no unit/literal types involved. Some examples of this are as follows...
281
Andrea Simone Costa @jfet97.bsky.social · 10/12/2024
media.tenor.com
a cartoon dog is sitting at a table in front of a fire with the words `` it 's fine '' written above him .
ALT: a cartoon dog is sitting at a table in front of a fire with the words `` it 's fine '' written above him .
000
Andrea Simone Costa @jfet97.bsky.social · 04/12/2024
Thanks also to @andarist.bsky.social for making the switch case exhaustive! PR: github.com/microsoft/Ty... Playground: www.typescriptlang.org/play/?ts=5.8...
010
Andrea Simone Costa @jfet97.bsky.social · 04/12/2024
#typescript The next TypeScript compiler update will be exciting! PR #56941 by @gabritto.bsky.social improves support for conditional and indexed access types as return types, enabling proper typing for functions like the one in the snippet without clunky hacks or dubious overloads.
151
Andrea Simone Costa @jfet97.bsky.social · 30/11/2024
Well, thanks for your exhaustive explaination! 😃 Great job with that PR
000
Andrea Simone Costa @jfet97.bsky.social · 29/11/2024
Hi there @gabritto.bsky.social! I'm playing with your PR and I got a couple of non working cases (and some combinations), but I can't find the reason in the description of the PR. Would you mind to have a look? Thanks! www.typescriptlang.org/play/?ts=5.8...
typescriptlang.org
TS Playground - An online editor for exploring TypeScript and JavaScript
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
100
Andrea Simone Costa @jfet97.bsky.social · 22/11/2024
www.typescriptlang.org/play/#code/G...
typescriptlang.org
TS Playground - An online editor for exploring TypeScript and JavaScript
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
000
Andrea Simone Costa @jfet97.bsky.social · 22/11/2024
#typescript Immediate access in the realm of values is not deferred, but `to` has a type param as type so TS can only resort to its constraint. OTOH in the realm of types `T["property"]` stays deferred, so indirect access is well typed. @andarist.bsky.social highlight of the day from our chat
120
Reposted by Andrea Simone Costa
Mateusz Burzyński @andarist.bsky.social · 06/11/2024
I'll remember the world before and after this PR: github.com/microsoft/Ty... The new era of conditional types checking is coming in TypeScript 5.8!
github.com
Narrow generic conditional and indexed access return types when checking return statements by gabritto · Pull Request #56941 · microsoft/TypeScript
Fixes #33912. Fixes #33014. Motivation Sometimes we want to write functions whose return type is picked between different options, depending on the type of a parameter. For instance: declare const ...
67214
Reposted by Andrea Simone Costa
David Blass @ssalbdivad.dev · 31/10/2024
I'm looking for TypeScript consulting to support my full-time open-source work on @arktype.io! If your team struggles with... 🧩 Writing complex types to optimize DX ☠️ tsserver lag in editor 🧪 Type testing or benchmarking I can help! If not, retweets also really help💖
An editor blowing up while trying to provide autocomplete suggestions
191