ecyrbe Profile Banner
ecyrbe Profile
ecyrbe

@ecyrbedev

1,581
Followers
195
Following
445
Media
3,161
Statuses

Software Architect, creator of , stalier, apix. Typescript ✨🪄🧙‍♂️

Ile-de-France, France
Joined March 2019
Don't wanna be here? Send us removal request.
Pinned Tweet
@ecyrbedev
ecyrbe
11 months
📢 Zodios just hit 1k ⭐! Thank you all 🙏 #webdev #javascript #typescript
Tweet media one
5
4
68
@ecyrbedev
ecyrbe
7 months
is a really well crafted website to learn advanced typescript. It's 94 contributors... can't beleave so many ts wizards did it (lead by @trashh_dev ). A Masterpeace!
12
131
1K
@ecyrbedev
ecyrbe
2 years
@oven_sh You can't create a business with that premise. Good Luck transitioning to a sane work culture. This is bound to fail.
1
0
243
@ecyrbedev
ecyrbe
6 months
📢 Typescript tip for day 8 of #AdventOfTypescript 1⃣ For those knowing about utility types, day 8 was easy. Just use Omit 🔗 2⃣ For those reinventing the wheel, you learned about Mapped Keys can also filter objects
Tweet media one
3
9
194
@ecyrbedev
ecyrbe
4 months
@GregMolnar Your chances to get a duplicate is 1 in the lifetime of the universe. And if you are concerned, roll your inserts in transactions so that they'll run again in case of failure. UUID are good for distributed databases, for preventing predictable attacks, to allow parrallelism.
6
0
188
@ecyrbedev
ecyrbe
1 year
A lot of typescript wizards don't know this, but there is a way in typescript to do High Order Kinded Types: @mattpocockuk maybe a video about this would be cool
Tweet media one
@ecyrbedev
ecyrbe
1 year
@tannerlinsley @GabrielVergnaud @bat_splinter Here how to do what is in the good link with delayed types :
4
0
9
6
19
177
@ecyrbedev
ecyrbe
7 months
@dillon_mulroy I would not say it's by the book. You have too much repetition allowing for errors everywhere. Use your data as a single source of truth. Bonus, code is easier to read and maintain :
Tweet media one
4
0
136
@ecyrbedev
ecyrbe
2 years
@JackEllis The best advice i can give you is stop micro managing your team. Do not review unless explicitly asked for. Let your team review each other ones PR and give them your trust. Even better, stop doing PRs and ask your team to do Peer programming.
8
7
136
@ecyrbedev
ecyrbe
7 months
📢 Typescript tip. Evoid type and code duplication. Make types and code in sync without having to maintain both whenever you can.
Tweet media one
@dillon_mulroy
Dillon Mulroy 🐫
7 months
Woops! Despite doing everything by the books and not using any escape hatches ('as', 'any', or 'non-null assertions') TypeScript let us give a normal 'member' admin permissions! 💥
Tweet media one
74
31
523
1
12
130
@ecyrbedev
ecyrbe
1 year
A screenshot speaks for itself, this is beautifull and typesafe. Writing you design system with this is so 🤯🚀 🔗
Tweet media one
5
8
104
@ecyrbedev
ecyrbe
8 months
@peterpme If you want to compare apples to apples, compare with the correct packages
Tweet media one
5
1
101
@ecyrbedev
ecyrbe
6 months
📢 Typescript tip for day 9 of #AdventOfTypescript 1⃣ You may have learned that typescript utility types can do recursion. 2⃣ recursion on types has a limit 3⃣ Solution : use Tail Recursion Optimisation 🔗
Tweet media one
7
8
103
@ecyrbedev
ecyrbe
1 year
@trashh_dev my rule of thumb : - use functions for top level - use arrow functions for anything else This is also internal Deno rules, and in general i find that their style guide is really good :
6
6
86
@ecyrbedev
ecyrbe
1 year
Coming tomorrow in HOTScript : 🚀 easy pattern matching:
Tweet media one
4
9
81
@ecyrbedev
ecyrbe
1 year
HotScript is going well. We even have sorting algos :)
Tweet media one
1
9
79
@ecyrbedev
ecyrbe
1 year
♨️ HOTScript is pretty dope ! 🗒️ Json parsing in typescript type system ! In just 50 lines ! @GabrielVergnaud
Tweet media one
3
10
74
@ecyrbedev
ecyrbe
5 months
It's 2024 and there are still misconceptions about typescript.
@WInvincible4397
WInvincible
5 months
@srsholmes @andrewbaisden javascript is much faster than typescript the transpilation step introduces many unnecessary function calls
6
0
0
4
1
71
@ecyrbedev
ecyrbe
6 months
📢 Typescript tip for day 12 of #AdventOfTypescript 1⃣ Tuple['length'] is at the core of today's solution. It returns the length of a type Tuple 2⃣ First approach is to recusively search the Tuple from left to right 3⃣If you do the opposite, no need for an accumulator
Tweet media one
8
1
70
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 17 of #AdventOfTypescript ℹ️ multiple ways to solve it. Chained conditionals, using a Lookup table... 1⃣ The hard part is that Rock Peper Scissors is that it's a cyclic graph 2⃣ You can generalize the problem to use a cyclic graph representation
Tweet media one
6
3
70
@ecyrbedev
ecyrbe
5 months
📢 Functional programming If you want to dig into functional programming concepts, there is a cool channel out there with nice visual explainations
5
6
64
@ecyrbedev
ecyrbe
1 year
Testing a validation library idea that allows for composition, treeshakable, extensible implementation Working fine so far :
Tweet media one
10
3
60
@ecyrbedev
ecyrbe
10 months
@ThePrimeagen Updated :
Tweet media one
0
4
58
@ecyrbedev
ecyrbe
5 months
It's working ! 🔗Source code: cc: @MichaelArnaldi @ssalbdivad
Tweet media one
13
7
54
@ecyrbedev
ecyrbe
6 months
@mattpocockuk This comment with this other opened issue made me investigate typescript arcanes. I was like "how the hell does this black magic works?" Now that i understand it, i also do some vodoo 🧙‍♂️
2
4
55
@ecyrbedev
ecyrbe
5 months
AST parser at type level implemented, now i just need to implement the compiler bindings! We're almost there! 🔗 source:
Tweet media one
3
4
53
@ecyrbedev
ecyrbe
4 months
@GregMolnar It's not security by obscurity, you know the id perfectly well. It's preventing certain type of attacks. Like creating a resource to gain knowledge about another. Security by obscurity is a complete different beast.
1
0
48
@ecyrbedev
ecyrbe
5 months
📢 TypeScript TIP ℹ️ You need to get unique strings from a tuple type of strings? 1⃣Here is an efficient way to do it in one pass by using a Map to check if the current element was already seen
Tweet media one
3
4
48
@ecyrbedev
ecyrbe
1 year
About time @colinhacks 😆
Tweet media one
2
0
43
@ecyrbedev
ecyrbe
10 months
What if you could store a global state at typelevel in typescript. Thanks to interface and function overriding, you can🚀 You can check the real magic here :
Tweet media one
2
4
42
@ecyrbedev
ecyrbe
1 year
@kentcdodds Here you go, but using identitity function instead of satisfies :
Tweet media one
1
1
43
@ecyrbedev
ecyrbe
1 year
@trashh_dev Do you have a PR so i can suggest some improvements ?
1
0
41
@ecyrbedev
ecyrbe
1 year
I was waiting for this 😈 666 ⭐: 🔗
Tweet media one
1
2
40
@ecyrbedev
ecyrbe
1 year
📢 Hello Zodios users. So last poll about zodios return type was a massive go for breaking change and return a complex object. I also got feedback that throwing an exeption was still desirable behaviour. So we will have best of both worlds like this :
Tweet media one
Tweet media two
5
3
41
@ecyrbedev
ecyrbe
1 year
zodios just hit 500⭐️ Thank you! 🙏 #webdev #javascript #TypeScript
Tweet media one
3
3
39
@ecyrbedev
ecyrbe
1 year
Javascript arrays are not real arrays. Meaning, it's not continuous memory, it's actually a linked list behind the scene. It's bad for performance. If you need performance for some algorithms holding data, use Javascript derived ArrayBuffers structure:
3
6
38
@ecyrbedev
ecyrbe
6 months
📢 Typescript tip for day 11 of #AdventOfTypescript 1⃣ Idea was to recusively mark properties readonly 2⃣ Functions get in the way, so you just need to check for it 3⃣ Tuples are Objects, so let typescript handle it 4⃣Typescript will bypass simple types like number, string
Tweet media one
5
1
39
@ecyrbedev
ecyrbe
1 year
@GabrielVergnaud @ssalbdivad Ok, parser is starting to look super cool. This will enable all kinds of crazy things
Tweet media one
4
3
37
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 20 of #AdventOfTypescript ℹ️ Using HOTScript, it's looks like functional code, native solution coming later today 🔗 source code: cc: @TkDodo since you tried using HOTScript
Tweet media one
2
1
37
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 15 of #AdventOfTypescript ℹ️ This one was a good way to deeply understand how Distributed Conditionnal Types work. 1⃣ '(a | b) extends c ...' is the same as '(a extends c ...) | (b extends c ...)' 2⃣ Do 'Union extends T' and not 'T extends Union'
Tweet media one
2
3
37
@ecyrbedev
ecyrbe
6 months
Hope everyone is doing well, Thanks everyone who participated in #adventoftypescript , and shared their solutions here!
Tweet media one
3
0
37
@ecyrbedev
ecyrbe
5 months
📢 I can finally define typeclasses with beautifull string literrals and it works! Fully typesafe, no codegen, it's just typescript. 🔗 Source code: Here is a Monad !
Tweet media one
2
3
36
@ecyrbedev
ecyrbe
1 year
📚 Zodios tip You can use the exellent openapi to zodios playground from @astahmer_dev It generates all the zod types and zodios api definition for you as if they where written by hand 🔗 It don't feel like generated code at all #webdev #typescript
Tweet media one
Tweet media two
2
4
32
@ecyrbedev
ecyrbe
6 months
📢 Typescript Solution for day 16 of #AdventOfTypescript ℹ️ Many possible solutions, with Object Maps or Tuple Recursion 1⃣ Here we show a solution involving Distributed Conditionnal Types, no recursion or Mapping 2⃣ We pre-compute all X and Y indexes to distribute over
Tweet media one
5
2
34
@ecyrbedev
ecyrbe
11 months
📢 typematic has now support for JSON Schema with typescript inference out of the box This means you can copy paste your open api schemas directly and have typescript infer the types
Tweet media one
Tweet media two
3
4
33
@ecyrbedev
ecyrbe
6 months
Here is how it started vs how it ends #adventoftypescript
Tweet media one
Tweet media two
2
2
33
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 20 of #AdventOfTypescript ℹ️ Split the problem in 3. For next days it will be more like 5 or 6. 1⃣ create a merge utility 2 ascii art tuples 2⃣ handle merging ascii art for a single line recursively 3⃣ handle spliting lines recursively
Tweet media one
5
2
32
@ecyrbedev
ecyrbe
1 year
Always be polite with your tools
Tweet media one
1
1
30
@ecyrbedev
ecyrbe
5 months
Has any fp programming library tried to encapsulate JS Generators yet? I'm adding it to Typeskell!
Tweet media one
2
5
30
@ecyrbedev
ecyrbe
8 months
I tried rspress @rspack_dev to replace docusaurus docs for v11. Dev env builds in less than a second. What a refreshing experience.
4
9
30
@ecyrbedev
ecyrbe
10 months
Don't forget that D.Knuth created a ton of efficient algorithms in the 70s. Here is Knuth-Morris-Pratt for searching a pattern in Uint8Array. @deno_land you should use this instead of O(n*m) algorithm in std/bytes. This one is only O(n+m):
Tweet media one
Tweet media two
3
0
30
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for Day 21 of #AdventOfTypescript 1⃣Since the challenge is becoming more and more difficult everyday i now also do a blog post 2⃣The solution will also shared on TypeHero after the challenge has finished 🔗 link to blog post :
7
2
29
@ecyrbedev
ecyrbe
1 year
♨️HOTScript ➗Calculator embedded in typescript compiler!
Tweet media one
0
1
28
@ecyrbedev
ecyrbe
6 months
@c_horobin @BanJoeH @mattpocockuk Best solution i've seen. 🚀 I did not though about it even though i'm using something similar for the late challenges 😅 1⃣ key points, it's using unions as a way to iterate over the indexes without using Object Mapping A little simplification.
Tweet media one
4
5
29
@ecyrbedev
ecyrbe
5 months
OK, now that i have a proof of concept that one can use typescript type system to generate fully programmable typeclass signatures. Next step to do this. This will greatly simplify FP libraries creation!
Tweet media one
4
2
29
@ecyrbedev
ecyrbe
11 months
@kerematam @kadikraman @redmonkez interrestingly, using a cross browser testing, i get : chrome: switch is 30% slower edge: switch is 30% slower firefox: switch is 70% slower opera: switch is 30% slower webkit: lookup is 10% slower safari: lookup is 10% slower
1
0
25
@ecyrbedev
ecyrbe
2 years
@benecoleman @WavyBastard @Suraht @Palle_Hoffstein if you break the law (chich he did) you can be fired at will.
1
0
26
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 19 of #AdventOfTypescript ℹ️ Two steps solution that take advantage of Typescript memoization 1⃣ Build a tuple containing the same Toy N times 2⃣ Use a cyclic graph and iterate over the Tuple of numbers and build current toy for each of them
Tweet media one
6
1
28
@ecyrbedev
ecyrbe
2 years
Zodios v8 is out. Thanks to @tannerlinsley and his Narrow utility type, you no longer need to use `as const` to declare your api definitions. This greatly improves DevXP. Check migration guide : #zodios #webdev #javascript #typescript #reactjs
2
4
27
@ecyrbedev
ecyrbe
1 year
📚 Zodios / Fetch / Axios Tip Time! If you need to cancel a request, but have many different AbortControllers that can be triggered to cancel your request, you can use this nice helper to combine your signals :
Tweet media one
Tweet media two
1
2
27
@ecyrbedev
ecyrbe
1 year
@VEHOOM Chat gpt
Tweet media one
1
1
22
@ecyrbedev
ecyrbe
6 months
Tomorrow in #AdventOfTypescript , a little surprise 🥳 ⏰ Don't miss it. It's the challenge i 💖 the most!
6
1
26
@ecyrbedev
ecyrbe
2 years
@fabiospampinato @_duncanhall @lewisl9029 @oven_sh This is plain wrong. He could build it by working 40h a week on it. Bun might even be better, because he would have more time to introspect. Like kevlin henney says: "you have to slowdown, that's how you go fast" He is doing open source, there is no hurge to deliver sooner.
0
0
25
@ecyrbedev
ecyrbe
10 months
📢 List is growing, added support for valibot to typematic Here is the current list of supported schema libraries
Tweet media one
2
0
25
@ecyrbedev
ecyrbe
1 year
📈If you have an API that is slow but is idempotent, put a cache in front of it. 🖥️ Do not try to handle cache invalidation. It's too hard of a problem. you'll fail to handle every edge cases. Here's my solution 👇
1
0
24
@ecyrbedev
ecyrbe
1 year
📚 Zodios Tip Time. 🛠️ You can create helpers to simplify API definition. Should i include it in Zodios api helpers ? Would be specific to zod (not working for yup, io-ts, etc). Here a zodToParameters example with 🔗 Playground link :
Tweet media one
3
1
25
@ecyrbedev
ecyrbe
4 months
Functor Laws ✅ Applicative Laws ✅ 🔗 Link:
Tweet media one
3
1
24
@ecyrbedev
ecyrbe
7 months
@housecor You can iterate with TDD, in fact that's how it's done. Red, Green, Refactor, Repeat. In the Red phase, you can break your design In the Green phase you can rewrite the tests In the Refactor phase, you only rewrite the internals.
2
0
23
@ecyrbedev
ecyrbe
1 year
@TkDodo Would creating these labels be too harsh?
Tweet media one
0
0
24
@ecyrbedev
ecyrbe
6 months
Even simpler
Tweet media one
5
1
23
@ecyrbedev
ecyrbe
10 months
📢 I'm at minimum 6 month behind @tannerlinsley but this is cool 🤯 🚀 Typematic now detect duplicated endpoints or aliases at compile time and gives some tips to fix it. 📑 Example for duplicated endpoint (same method and path)
Tweet media one
Tweet media two
0
1
23
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 10 of #AdventOfTypescript ℹ️ This one was easier than yesterday, a simple 'extends' does the trick.
Tweet media one
1
0
22
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 23 of #AdventOfTypescript ℹ️ This challenge was a lot like tic-tac-toe one, but with more dynamic checks and less union tricks since we really need to count the number of consecutive Chips. 🔗 Link to blog post
7
2
23
@ecyrbedev
ecyrbe
10 months
@ryanflorence I can't disagree more. Client side caching and data replication is what browser is doing since forever. Round trip for api calls to server to get it from infrastructure cache still slower than taking data from browser memory with react-query. 10 µs vs 10→100ms network latency
1
0
23
@ecyrbedev
ecyrbe
1 year
@trashh_dev We bought a lot of books, read programming magazines, debug for days. That was actually fun, the accomplishment fealings where so true.
2
0
22
@ecyrbedev
ecyrbe
1 year
@pkozlowski_os There is , that has a layer above react query, and simplify api calls and adds more typesafety
1
2
22
@ecyrbedev
ecyrbe
1 year
Effect is is an underrated piece of engineering. The amount of crafting that goes inside so users don't have to worry is incredible. And the code is so clean. 🚀 A masterpiece
@EffectTS_
Effect | TypeScript at Scale
1 year
Tweet media one
2
4
14
3
2
21
@ecyrbedev
ecyrbe
6 months
📢 Typescript tip Day 5: we saw Tuple concatenation 1⃣ Tuples are a powerfull way to ensure typesafety access in typescript 2⃣ If you know an array has a fixed number of items at compile time, prefer using Tuples to describe them It's safer and garanty no out of bound access
Tweet media one
@ecyrbedev
ecyrbe
6 months
I've completed Day Five - Advent of TypeScript 2023 #AdventOfTypescript
0
0
7
1
2
22
@ecyrbedev
ecyrbe
8 months
Can we talk about why everyone is using regex to validate emails when emails are not parsable by a regex ? Why nodejs or Browser api does not provide an email parser out of the box like they do for URL parser ? If you know a good email validation lib, please comment.
8
4
21
@ecyrbedev
ecyrbe
1 year
@TkDodo - edge computing: execute workloads near users location to reduce latency - edge functions: edge computing + serverless + cache = CDN v2.0 - edge runtime: JavaScript + edge functions
2
2
21
@ecyrbedev
ecyrbe
6 months
I've completed Day Fourteen - Advent of TypeScript 2023 #AdventOfTypescript ⌛️A bit late today, was busy working 1⃣ The solution is to use recursive, no other way that i know of for strings 2⃣ Bonus, using type level regex from @didavid61202
Tweet media one
4
0
22
@ecyrbedev
ecyrbe
1 year
@atcb So just to sum this up. Am i getting this right ?
Tweet media one
5
1
22
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 13 of #AdventOfTypescript ℹ️Using HotScript it's pretty straighforward by using number arithmetics ⏰ Later today i'll show a native solution without using HotScript
Tweet media one
7
0
22
@ecyrbedev
ecyrbe
6 months
I think that tomorrow #AdventOfTypescript will be WTF all around. Don't be surprised, i had to make you work for the badges, they cost a lot to @trashh_dev team to make. But i believe you can do it!
10
0
21
@ecyrbedev
ecyrbe
6 months
📢 Typescript solution for day 18 of #AdventOfTypescript 1⃣ We recusively add items to an accumulator when they match the searched items 2⃣ When they don't match we discard the item and continue with the Tail ℹ️ Bonus, it can count many different items by just using unions
Tweet media one
2
0
20
@ecyrbedev
ecyrbe
1 year
@t3dotgg We are creating a lib of it, but it will be targeting heavy typescript library authors to make their typescript libraries easier to maintain (like zod, trpc, tanstack, zodios). Users of those libs will just profit from it indirectly :
1
9
20
@ecyrbedev
ecyrbe
1 year
@GabrielVergnaud This means you can now implement a parse safe implementation like @arktypeio in just a few lines of code. Ideas: - typesafe @GraphQL without code generation - typesafe SQL based on your schemas - typesafe router like @tan_stack router it's endless
3
0
18
@ecyrbedev
ecyrbe
1 year
Zodios just got 800⭐️ on github. Thanks! 🙏 Adoption is also growing pretty fast and that's actually the most relevant metric to tell if it is actually usefull. More Zodios status info 🧵👇
Tweet media one
1
0
20
@ecyrbedev
ecyrbe
1 year
@ryanflorence There are two aspects : - show appreciation to the library author since there is a gihub trend feature based on stars - have bookmark and notifications on updates on your "for you" tab :
Tweet media one
1
0
19
@ecyrbedev
ecyrbe
6 months
This reads like a For Loop!
@ecyrbedev
ecyrbe
6 months
Even simpler
Tweet media one
5
1
23
1
0
19
@ecyrbedev
ecyrbe
9 months
Bun does esm/cjs right. It solves every issue we have with nodejs approach. You can mix esm and cjs import styles in the same file, bun don't care, it just works! 🚀 @nodejs now you know what to do. Way to go @jarredsumner and congrats on 1.0 release.
0
1
18
@ecyrbedev
ecyrbe
4 months
I dwelved in this problem a lot. Error codes are not the only information you can return There is Status text and also HTTP json body If you are concerned about Analytics you can also add tags to your Open Telemetry Spans to distinguish them in your dashboards
Tweet media one
@simas_ch
Simon Martinelli
4 months
The inconvenience of REST is that you get a 404 error regardless of whether the URL is wrong or the correct URL is called, but the resource does not exist. How do you handle that?
86
14
165
0
1
19
@ecyrbedev
ecyrbe
1 year
I know TS team is discouraging this. But since there are multiples uses cases where you actually need it. Here yet another an example of where object keys to tuple is needed and key order is not an issue.
@ecyrbedev
ecyrbe
1 year
Tweet media one
3
0
11
1
0
19
@ecyrbedev
ecyrbe
8 months
Like promised here a demo of how to make valibot having dot notation like zod. Completely opt-in solution:
@FabianHiller
Fabian Hiller
8 months
With this post I publish my bachelor thesis. 🧑‍🎓 As part of the research I looked at @zodtypes , @arktypeio and Typia and investigated how the bundle size of JavaScript libraries can be reduced. Thank you @mhevery and @RyanCarniato for your support.
11
30
323
1
0
19