正在加载视频...
视频加载失败
📢Introducing ArkRegex📢 a drop in replacement for new RegExp() with types ⬇️
733,454 次观看 • 11 个月前 •via X (Twitter)
45 条评论

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:

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

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

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

This is insane

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

typesafe eval() wen?

how is this even possible in typescript?

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

wait! you can run DOOM in ts?

cool!

Plz stop kidding 🙏

🔮 and thank you!

readable regex for the masses✊

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

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.

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

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

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

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

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

holy shit this is amazing

jesus

This is black magic. Crazy work.

typesafe regex is craazy (・o・;)

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

type-level AGI

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

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

love it, proving my point here👍

insanee

woah 😮

This is so good and useful

rust port?

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

cracked shit.

@amosavian

Oh my days… @ssalbdivad you crazy scientist.

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

Really cool stuff.

Nah this is crazy wth..

actual wizardry

god this is a banger ! congrats

HUH?

Amazing!
相关视频
Sensitive content
⚜️ Direct Collections ⚜️ Get ur ticket to Full scale collections at good rates 📢LIFETIME ACCESS 📢NO Monthly Charges or Rejoining Fees 📢Backup Ready & Payment Proofs provided 📢Consistent Updates 📢15+ types grps 💯Trusted Saller Check Profile for Telegram Channl link
Sonal
83,598 次观看 • 2 个月前
Sensitive content
𝗕𝗟𝗨𝗘 𝗭𝗨𝗦𝗛𝗜 🥶 Limited Drop 📢 Small Batch ⭐️ Crazy Exotics 🤪 Leave a Comment ⬇️ We will choose a couple random comments to win free packs of our new Blue Zushi
DIESEL DISPENSARY
60,643 次观看 • 1 年前
