that's a wrap for today (around this topic)
https://webreflection.medium.com/some-service-worker-absurdity-344fca5ecdea
Web, Mobile, IoT: all JS things since 00's - opinions are my own ™
that's a wrap for today (around this topic)
https://webreflection.medium.com/some-service-worker-absurdity-344fca5ecdea
Biggest milestone? A round trip worker to main and back of 2MB ArrayBuffer inside F32 went down from 150ms to just 2ms 🤯
Everything else is 0.x time 🍻
I am factoring out coincident/window (soon to be updated) to fully separate concerns and provide a standalone sub-project to nail that part of the stack.
If interested, I started explaining what's behind the scene here 👋
https://github.com/WebReflection/reflected-ffi?tab=readme-ov-file#reflected-ffi
@mauve Babel, Firefox, Chrome/ium, all there already and it's an official proposal I believe advanced to stage 2 or 3 https://github.com/tc39/proposal-explicit-resource-management ... JSC/Safari will hopefully come soon!
nice and clean via Explicit Resource Management 🥳
if interested, this is the related "bug" filed at WHATWG:
… and just like that, turns out that Error cause is cloned in Chromium and ignored in WebKit (or at least Bun) 🤦
It’s always the same: I find a cool/elegant way to solve issues via native APIs … native APIs are not the same across engines 😭
Here is WHATWG specs to blame 😢
@_O we already do that, coincident project handles everything but the ad-hoc crawling to resolve the same issue everyone else has in similar projects is extremely annoying, redundant, slow … and unless there is a standard way to do that (my proposal) we’ll all look like fools 😢
hopefully I've explained it all in this post ... please help me out landing this proposal, the polyfill is already code-covered 100% and it works shamelessly workers to NodeJS or main thread context 🥳
https://webreflection.medium.com/surviving-the-structured-clone-algorithm-130608b69f47
@rbuckton yes, because nobody can use Proxies or other user-land classes right now and Structs won't solve that neither
for the time being this proposal landed in my own repo but if it lands in WHATWG and TC39 it would be **HUGE** 🥳
https://github.com/WebReflection/serialization-registry#readme
Hey, 90s kids! Your bedroom is now in a museum!
(Prague's National Museum, if you want to make a complaint.)
a utility to safely invoke?
before 2016:
const { call } = Function;
const apply = call.bind(call, Function.apply);
apply(callback, context, args);
after 2016:
const { apply } = Reflect;
apply(callback, context, args);
I often forget myself I can just trap Reflect utilities🤦
my ugly workaround is similar to:
let name=($,_={}.toString.call($).slice(8,-1))=>(_ in self)?_:name(Object.getPrototypeOf($));
and then
if (name(ref) === 'Object') ... loop props to do things
does anyone has a better/faster way around? 🤔
there is one particular dance JS engines do on structured-clone algorithm to understand if a reference is a plain object (or degraded as such) or an instance of a native class (also degraded, but less so) and I wonder where on earth is that API to know if an object is "literal" !
I am tired of working around this simple requirement that is mandatory for anyone dealing with proxies and `postMessage` related dances so that, at least until Symbol.toStructuredClone won't exist on the JS/Web platform, here's my solution:
https://github.com/WebReflection/is-proxy
this is just beautiful ... goodbye clunky JS based carousels 🥳
https://chrome.dev/carousel-configurator/
TIL Atomics.pause() ... which erased 10 seconds (!!!) from CI in testing PyScript and Pyodide from a worker 😱
the feature detected fast-path landed already in coincident, works with sabayon polyfill around, forces Firefox to not use it or it dies forever🤦but it's a good news 🥳
is *I* can polyfill SAB, Atomics.wait and Atomics.waitAsync for all browsers I wonder what is it that's holding Browsers' vendors to actually ship something able to provide that same SharedArrayBuffer feature w/out Spectre and Meltdown paranoia behind 🤔
I can see already every single npm module being updated with
//# allFunctionsCalledOnLoad
on top of it 😅