I have no idea who at Google is advocating for this, but it’s a half-baked idea that goes against 20 years of web standard work. At least put this under the `window` or `navigator` global, goddamn.
839 karma · joined April 7, 2019
I have no idea who at Google is advocating for this, but it’s a half-baked idea that goes against 20 years of web standard work. At least put this under the `window` or `navigator` global, goddamn.
https://github.com/bikeshaving/revise https://revise.js.org https://revise.js.org/blog/introducing-revise/
https://www.amnesty.org/en/latest/news/2025/02/meta-new-poli... https://www.amnesty.org/en/latest/news/2023/10/meta-failure-...
let resolveRef;
const promise = new Promise((res) => { resolveRef = res; });
const callback = (data) => {
// Do work...
resolveRef(data); // This "triggers" the await
};
Object.assign(callback, promise);
There’s a real performance cost to awaiting a fake Promise though, like `await regularPromise` bypasses the actual thenable stuff. import { Repeater } from "@repeaterjs/repeater";
const keys = new Repeater(async (push, stop) => {
const listener = (ev) => {
if (ev.key === "Escape") {
stop();
} else {
push(ev.key);
}
};
window.addEventListener("keyup", listener);
await stop;
window.removeEventListener("keyup", listener);
});
const konami = ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"];
(async function() {
let i = 0;
for await (const key of keys) {
if (key === konami[i]) {
i++;
} else {
i = 0;
}
if (i >= konami.length) {
console.log("KONAMI!!!");
break; // removes the keyup listener
}
}
})();
https://github.com/repeaterjs/repeaterIt’s one of those abstractions that’s feature complete and stable, and looking at NPM it’s apparently getting 6.5mil+ downloads a week for some reason.
Lately I’ve just taken the opposite view of the author, which is that we should just use streams, especially with how embedded they are in the `fetch` proposals and whatever. But the tee critique is devastating, so maybe the author is right. It’s exciting to see people are still thinking about this. I do think async iterables as the default abstraction is the way to go.
Adding the staff is 37 codepoints versus 36, but I think using ZWJ would at least have each numeral independently renderable so it degrades gracefully. I’m not too sure about how combining characters degrade.
Essentially it boils down to whether you think the staff and the digit flag part of the numeral are independent or not.
The 4-stave system is interesting but can almost certainly be done using ZWJ hacks maybe.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetails...
I’ve been heads-down on publishing a JavaScript full-stack metaframework before the end of the year. However, in the past two weeks I’ve been goaded by Claude Code to extract and publish a separate database client because my vision includes Django-style admin/forms. The idea is to use Zod to define tables, and then use raw SQL fragments with JavaScript template tags. The library adds a tiny bit of magic for the annoying parts of SQL like normalizing join objects, taking care of SELECT clauses and validating writes.
I’m only using it internally right now, but I think this approach is promising. Zod is fantastic for this use-case, and I’m sad I’ve only just discovered it.
It’s actually a feature, not a bug.