Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

📢Introducing ArkRegex📢 a drop in replacement for new RegExp() with types ⬇️

733,454 görüntüleme • 11 ay önce •via X (Twitter)

45 Yorum

ArkType profil fotoğrafı
ArkType11 ay önce

arkregex is a standalone, type-only package that adds types to RegExp. if you prefer... 🔎 clarity over opacity 🔒 safety over crashing using it should be the easiest win of your life. announcement:

colinhacks profil fotoğrafı
colinhacks11 ay önce

david if you keep going down this path I won't be able to help you

phong profil fotoğrafı
phong11 ay önce

we devs were so preoccupied with whether we could, that we didn't stop to think if we should this is amazing though

ArkType profil fotoğrafı
ArkType11 ay önce

we thought about it and concluded that if you haven't already installed arkregex your project is garbage

Rhys profil fotoğrafı
Rhys11 ay önce

This is insane

Maurice Kleine profil fotoğrafı
Maurice Kleine11 ay önce

there's Doom in Typescript, and juuuuuust below that is ArkRegex

kenneth profil fotoğrafı
kenneth11 ay önce

typesafe eval() wen?

Salman Shaikh profil fotoğrafı
Salman Shaikh11 ay önce

how is this even possible in typescript?

ArkType profil fotoğrafı
ArkType11 ay önce

unironically same strategy used to run DOOM (but highly optimized)

Salman Shaikh profil fotoğrafı
Salman Shaikh11 ay önce

wait! you can run DOOM in ts?

Salman Shaikh profil fotoğrafı
Salman Shaikh11 ay önce

cool!

Aman profil fotoğrafı
Aman11 ay önce

Plz stop kidding 🙏

Ray profil fotoğrafı
Ray11 ay önce

🔮 and thank you!

ArkType profil fotoğrafı
ArkType11 ay önce

readable regex for the masses✊

Maximilian profil fotoğrafı
Maximilian11 ay önce

can I safely use this and not have my lsp blow up?

ArkType profil fotoğrafı
ArkType11 ay önce

Generally, yes. A lot of effort went into optimizing the parser including dozens of type-level benchmarks. Of course eventually you'll hit the limits of TypeScript eventually with enough unions but it's pretty easy to just not use it for those extreme cases.

ArkType profil fotoğrafı
ArkType11 ay önce

There's a fallback for declaring the type or you can just use `new RegExp()` for those cases.

Maximilian profil fotoğrafı
Maximilian11 ay önce

just for reference how many instantiations would a regular type be or a zod object - and at what number does the lsp start falling apart? I understand that these numbers are probably sensible for you (and I understand lower = better) but it’s like a currency I never used very grateful if you feel like you have the energy to explain but totally understandable if not Library is pure magic no matter what but lsp performance has burnt me completely

ArkType profil fotoğrafı
ArkType11 ay önce

Most of these cases are less expensive than a simple zod schema. 1-10k instantiations is pretty standard for that sort of thing.

ArkType profil fotoğrafı
ArkType11 ay önce

You just have to be careful if your expression is combinatorial, but there's a ceiling on what TS will do before complaining anyways. A good heuristic would be to look at the number of branches in the union of the result type. If you see >10k, you may want to declare the type

Sameer profil fotoğrafı
Sameer11 ay önce

how?? how?? you're making things typesafe, which I never even thought of could be possible?

Matt Popovich profil fotoğrafı
Matt Popovich11 ay önce

holy shit this is amazing

Steve Ruiz profil fotoğrafı
Steve Ruiz11 ay önce

jesus

Arian profil fotoğrafı
Arian11 ay önce

This is black magic. Crazy work.

Shounak Ghosh profil fotoğrafı
Shounak Ghosh11 ay önce

typesafe regex is craazy (⁠・⁠o⁠・⁠;⁠)

dev profil fotoğrafı
dev11 ay önce

this is insane, what's next on the horizon ?

ArkType profil fotoğrafı
ArkType11 ay önce

type-level AGI

ArkType profil fotoğrafı
ArkType11 ay önce

(actually though [email protected] which will integrate this syntax natively)

Seb profil fotoğrafı
Seb11 ay önce

I'm about to switch from a python stack to a Typescript one. I can't wait to use this!

ArkType profil fotoğrafı
ArkType11 ay önce

love it, proving my point here👍

vinay profil fotoğrafı
vinay11 ay önce

insanee

tanpreet 🌂 profil fotoğrafı
tanpreet 🌂11 ay önce

woah 😮

Jasper 張 🟠 profil fotoğrafı
Jasper 張 🟠11 ay önce

This is so good and useful

Hamza Mateen profil fotoğrafı
Hamza Mateen11 ay önce

rust port?

Wahyu profil fotoğrafı
Wahyu11 ay önce

holy shit, i feel like TypeScript template literal types need to file a restraining order against you

Odii profil fotoğrafı
Odii11 ay önce

cracked shit.

Pooria Faramarzian profil fotoğrafı
Pooria Faramarzian11 ay önce

@amosavian

Georges Haidar profil fotoğrafı
Georges Haidar11 ay önce

Oh my days… @ssalbdivad you crazy scientist.

Beardo Schmidt 🦗 profil fotoğrafı
Beardo Schmidt 🦗11 ay önce

Whoa. Didn’t expect this to come standalone!! Sold

harsh profil fotoğrafı
harsh11 ay önce

Really cool stuff.

boidu profil fotoğrafı
boidu11 ay önce

Nah this is crazy wth..

Liam Monaghan profil fotoğrafı
Liam Monaghan11 ay önce

actual wizardry

Nikoemme profil fotoğrafı
Nikoemme11 ay önce

god this is a banger ! congrats

Savvas Papageorgiadis profil fotoğrafı
Savvas Papageorgiadis11 ay önce

HUH?

Yash Kandalkar profil fotoğrafı
Yash Kandalkar11 ay önce

Amazing!

Benzer Videolar