Thread Reader
Twitter

As developers, we know how to serialize: - Data => JSON - Code => file.js But how do you serialize closure (Code + Data)? Qwik's key innovation, which enables all other magic, is that it knows how to serialize closures on servers and invoke them on clients, key to Resumability!

For example, the server can register a DOM listener closure as part of SSR, and then only materialize (download and resume) the closure if the user actually triggers that event.
Serializing closures require that both the bundler and runtime cooperate. In all existing FWs, the FW runtime does not care about bundling. Hence they can't serialize closure, and the FW can't be resumable.
Adding bundling information to runtime after the fact is extremely difficult, which is why I predict that it is unlikely for any FW to retroactively gain true resumability.
Miško Hevery (Builder.io/Qwik)
CTO at @builderio, creator of @QwikDev, @angular, @angularjs, co-creator of #karmajs
Follow on Twitter
Missing some tweets in this thread? Or failed to load images or videos? You can try to .