D1 is awesome but its API a bit "outdated" to me ... so I've written and tested template literals tags for it and I am pretty pleased with the result (and ergonomics).
github.com/WebReflectio...
Posts by Andrea Giammarchi
am I the only one seeing a repeatable pattern out of this story?
AI is awesome if you know what to ask and what to build, it still requires knowledge around that "what", right?
undark.org/2026/04/01/s...
It shouldn’t happen ever again but glad you didn’t post that, I was on vacation around that time, it wouldn’t have helped me 👋
if one liner is hard to read I bet one would struggle more with a lengthy loop surrounded by logic that’s possibly error prone, ask AI what gum does and learn recursion for simple tasks?
what's to maintain in:
[2, 3, 4, 5].reduce(lcm);
[12, 18, 36].reduce(gcd);
???
if you pay attention that works also as:
[2, 3, 4, 5].reduce(lcm);
[12, 18, 36].reduce(gcd);
🥳
whenever I read posts like "don't us JS Array reduce" I'm like:
const gcd = (a, b) => (b ? gcd(b, a % b) : a);
const lcm = (a, b) => (a * b) / gcd(a, b);
[2, 3, 4, 5].reduce((p, c) => lcm(p, c)); // 60
[12, 18, 36].reduce((p, c) => gcd(p, c)); // 6
I mean ... 🤷
apparently my account has been compromised on bsky ... it's honestly the only service out there that never offered me (until today), or enforced, 2FA, it was kinda inevitable, yet my deepest apologies if my account spam/scammed you by any mean 🙏
in case anyone is interested, I am documenting what I am working on regularly (each week) with links and every other detail needed to understand where I come from and where I am heading.
This is OSS to me, nobody can blame me for not being transparent 😇
github.com/WebReflectio...
in today "nobody asked for it, thanks!" news, the recent issue filed against flatted module (333M downloads per months) kinda "scared" me to the point I rewrote the whole thing in a binary friendly format: flatted-view: please test it, thank you 🙏
github.com/WebReflectio...
flatted is out with a tiny yet important update for the JS variant: if you stringify 50K objects that point to each other you no longer have call stack recursion error on parse, it just works 🥳
in today "good morning OSS" news,
@golang
receives its first *flatted* implementation, making flatted now usable in JS, TS, Python, PHP and, ultimately Go 🥳
Huge thank to
Harald Fielker
for helping out (writing everything), lets' go beyond 300M Downloads!
github.com/WebReflectio...
or let's do it the other way around ... show me a single case where Shadow DOM and slots are better than anything I can do with that library and let's compare
Vue, React, Svelte, everything built with these + Tailwind CSS are the examples ... anything built with Shadow DOM is the counter example. I prefer the former, not sure what you are asking exactly
if the channel is *message*, you're all good, if it's *broadcast* you're still good!
if it's *xhr* you are on the slow path but it should still work, if it states *async* please let me know what platform/target/OS/device is it so I can investigate/rule that out of the project: 🙏
dear followers, I need to ask you a little favor: I am trying to fix the Web around SharedArrayBuffer and the ability to synchronize any task from a never blocking Worker, I need you to tell me if this page is blank or shows "async" as channel, thank you!
webreflection.pythonanywhere.com
the innerHTML is a (arguably lame) example of anything else you can do, there just to prove the live test page is working anywhere you can try.
the advantage of not having ShadowDOM is:
* all CSS reset/libraries work out of the box
* no JS is needed to render components (ignore innerHTML)
* easier
there's one primitive missing on the Web and that's the ability to synchronously make a Worker busy while querying the main thread ... in coincident I've solved that but the missing primitive is hurting a lot (for debugging reasons) so ... here I am again:
github.com/WebReflectio...
even with shadow dom *SOME* style cascades anyway, it's misleading and bloat prone since its appearance on the Web, here you just style components contents like you would style any regular element on the web because ... those are real elements of the web
I’ve fixed a few hiccups here and there, mostly related to the ability to style [is=“ce-name”] even if created at runtime + ability to automatically create regular custom elements that extend HTML.Element.
The /auto variant on CDN lazy load for Safari in less than blink too 🥳
today I’ve quickly glued together two libraries that makes custom elements without shadow dom as fast and as simple as it can get and for every browsers … after reading the N post about ShadowDOM issues with CSS.
You can stop that madness already 👋
github.com/WebReflectio...
JS Proxy are wonderful, penalized by TS inability to actually understand/deal with these but the things that these unlock are incredible!
It might be a niche use case but if you need cached results, here my next go-to library:
github.com/WebReflectio...
live demo on codepen:
codepen.io/WebReflectio...
try to compare its code with the original one 😉
this might be handy for any "forever waiting" pattern that requires instant reactivity + it doesn't leak compared to the original post that inspired it 😇
github.com/WebReflectio...
a common complain about our minimalistic TOML parser is that it wouldn't support trailing commas ... well, v0.4.0 does now, keeping it ~540bytes after brotli 🥳
github.com/WebReflectio...
> I would probably only replace partial parts of the document and not a nav with a search input in it.
agreed, but that's *not* how specs work ... these need to address all edge cases too or ... good luck
this is *very* close to a SSR hydration concept and while I welcome this feature as I think it's awesome for HN or X like streams (or chats or list-items, or ...) I wonder what happens if the page had an input in that <nav>, somebody started typing in it (a11y tools too) and that gets replaced ... 🤔