Me, sitting behind a cuddly toy of a fox. Ok it's obviously Firefox.
Starting my new role on Monday. Could be anywhere.
31.07.2025 12:57 โ ๐ 363 ๐ 14 ๐ฌ 42 ๐ 4@surma.dev.bsky.social
DX at Shopify. Web Platform Advocate. Craving simplicity, finding it nowhere. Internetrovert ๐ณ๏ธโ๐ He/him.
Me, sitting behind a cuddly toy of a fox. Ok it's obviously Firefox.
Starting my new role on Monday. Could be anywhere.
31.07.2025 12:57 โ ๐ 363 ๐ 14 ๐ฌ 42 ๐ 4let arr = new Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]); console.log(arr.toBase64()); // 'SGVsbG8gV29ybGQ=' console.log(arr.toHex()); // '48656c6c6f20576f726c64' let string = 'SGVsbG8gV29ybGQ='; console.log(Uint8Array.fromBase64(string)); // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]) string = '48656c6c6f20576f726c64'; console.log(Uint8Array.fromHex(string)); // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100])
ECMAScript excitement ๐
Congrats to @bakkot.com on advancing UInt8Array โ๏ธ Base64/Hex to Stage 4 at TC39 this week ๐
UInt8Array.prototype.
toBase64
toHex
UInt8Array.
fromBase64
fromHex
It lets you convert directly between binary data and Base64/Hex strings ๐
Super happy with hyperoptic
24.07.2025 21:26 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0Oh that's interesting. I wonder if this is from the merge of ChromeOS and Android.
Let me see if I can install nix :3
I spent hours and hours trawling through the sites of some of the world's best web developers, and despite the horrors I regularly experience in my daily work in Big JavaScript Territory, what I saw left me hopeful:
infrequently.org/2025/07/links/
No, I'd want `x.a` to still be an error, which would not be the case with `any`. With `?.` I feel like I'm opting in to props that TS is not aware of
11.07.2025 14:29 โ ๐ 1 ๐ 0 ๐ฌ 1 ๐ 0Hm... Haven't thought about this nuance too much, but I suppose whenever it is allowed in JS (and behaves by returning undefined) it should be allowed in TS.
10.07.2025 21:36 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0You are prescribing intent that isnโt here. I know what I am checking.
The question boils down to: Should `o?.x` be a *type error* if `x` does not exist on the type of `o`. I claim โnoโ.
Checking/using properties that TS is unaware is often required, especially at an API boundary.
I'm proposing that `o?.x` is not a *type error* if `x` does not exist on o's type.
10.07.2025 18:08 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0Yes. I know how typescript currently works. I'm claiming that TS should change it's behavior here (hence why I said "this should not be a type error, right?"). I thought you were saying that what I was doing here is wrong at the type theory level, which I don't think is the case.
10.07.2025 17:20 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0Why not?
10.07.2025 16:24 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0Right, I know how to work around it. But I am asking: Shouldnโt this be accepted by the type checker (because `null?.a` is perfectly valid)
10.07.2025 16:07 โ ๐ 1 ๐ 0 ๐ฌ 2 ๐ 0Yes, but I specifically donโt want to use any because then you get to access any property without it being an error.
10.07.2025 14:08 โ ๐ 0 ๐ 0 ๐ฌ 2 ๐ 0Convince me I am wrong: This should not be a type error, right?
- I asserted itโs an object
- I am using `?.` for property access
www.typescriptlang.org/play/#code/G...
๐คฆ Iโm a professional engineer, fyi.
Should be fixed now ๐
CSS uses a complex algorithm to decide how to animate transforms. If you get it wrong, as many folks do, you end up with an unnatural animation.
Here's how it works, and how to avoid the pitfalls.
jakearchibald.com/2025/animati...
Should be fixed <3
17.06.2025 19:52 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0Oh how weird! Chrome doesnโt render it like that at all.
Thanks mate, will fix that later today!
๐ First blog in a long time!
I always like โflow-basedโ programming, and itโs a very powerful paradigm. LangGraph lets you codify complex workflows as graphs, and also integrates really well with LangChain, if your workflow is LLM-driven.
surma.dev/things/langg...
Unexpected dangers of vibe coding:
Somehow git ended up tracking its own .git folder and now I can't commit anymore :3
This is IRC. Let's do IRC. I miss IRC
17.03.2025 10:48 โ ๐ 6 ๐ 0 ๐ฌ 3 ๐ 0I did consider this, but it presumes that every type parameter is only used as a function parameter type. It will get very cumbersome for more complex type signatures (like nested generic). This work has already been done in `mapper`, just not exposed :S
21.01.2025 13:48 โ ๐ 0 ๐ 0 ๐ฌ 1 ๐ 0Folks who know their way around the TypeScript type checker, I need help:
gist.github.com/surma/be14ca...
How do I figure out what types the type parameters have been bound to given a `CallExpression`? I know the answer is in `resolvedSignature.mapper`, but thatโs not a public API.
Wait, am I dumb? What does NodeJS' WASI implementation only accept file descriptor numbers for stdio? Why don't they allow a Readables/Writables? How are you supposed to capture the output of a WASI module?
nodejs.org/api/wasi.htm...
๐ It's new OTMT time! Me and @surma.dev chat through some newer View Transitions features that have recently landed in browsers, and some things that might land this year.
โฌ๏ธ Pop this in your ears โฌ๏ธ
offthemainthread.tech/episode/new-...
Ooh just caught this #OTMT episode on customizable select ๐ Always love to hear @surma.dev and @jakearchibald.com chat about the web and especially the features Iโve been working on for the past few years ๐ฅฐ
offthemainthread.tech/episode/styl...
I apologize for splitting the last OTMT episode into two parts. It was sincerely unplanned.
๐ง Part II of the TC39 Drama ๐ถ๏ธ Roundup is now out!
In this one, I talk to @jakearchibald.com about JS0, which proposes to split JavaScript into two specifications.
offthemainthread.tech/episode/tc39...
I apologize for splitting the last OTMT episode into two parts. It was sincerely unplanned.
๐ง Part II of the TC39 Drama ๐ถ๏ธ Roundup is now out!
In this one, I talk to @jakearchibald.com about JS0, which proposes to split JavaScript into two specifications.
offthemainthread.tech/episode/tc39...
I should have known and clarified this, but I got flustered during recording because of the research break that was necessary
03.12.2024 18:32 โ ๐ 2 ๐ 0 ๐ฌ 1 ๐ 0๐ง A brand-new OTMT episode should be in your podcast players by now:
The TC39 Roundup ๐ถ๏ธ Drama Edition โ Part I
I talk to @jakearchibald.com about the TC39 Structs proposal and how it is a big step towards shared-data multithreading in JS.
offthemainthread.tech/episode/tc39...