We've just released Relay 3.0.0! This is the one without Relay Classic.⚰
Doing so will allow us to experiment and iterate more quickly to bring you new APIs, like the ones with hooks, suspense and concurrent support. 🙃
github.com/facebook/relay/re…
By imposing the constraint of some leaf-parts of apps not relying on props (or context?) from outside components, could these in theory be hydrated first?
Would this improve TTI more for parts of sites users expect faster feedback from?
The now being worked on partial hydration which aims to improve TTI by making hydration async necessarily hydrates top-down. The reason for this is that parents can send props to children.
These two things feels like a clash.
Thought I'm toying with: For many server rendered React sites, much of the component-related initial JS-payload is there for preparing for later and rarer big-scale changes to the DOM.
The fast changes where virtual DOM shines are often limited to smaller leaf-parts of sites.
I was wrong. While this did seem to work very well, it turns out it's a lot more complex than that. Replacing preload with prefetch can cause double fetching and other issues. This is a great writeup of all the nuance involved.
medium.com/reloading/preload…
PSA: link preload starts downloading the resource right away at high priority, make sure you only use it for critical resources or you might be bandwidth-constrained.
JS should usually use prefetch instead, download ahead of time, but at low priority.
Disclaimer: I have no idea what I'm talking about, or if it's at all possible..
This is just a fuzzy idea in my head, very hard to express in a tweet-format. 🙃
Then imagine combining that into a single declarative component-tree, where you can declare what gets included where (or determined by heuristic?). This gets built and optimised for all targets automatically.
Goal is comparable DX to current component-based frameworks.
Imagine having several small React-apps at leaf-positions but with less overhead, and a templating-based approach above that, that can be rendered by either server or SW. React apps render on client, templates are rendered by server/SW.
* Kind of: Events that only redraw a smaller part of the DOM can get included as client-js and uses virtual DOM-diffing, events that redraw larger parts of DOM gets handled by server or SW (can be prerendered by SW)
* Extremely light initial JS, fast transitions when SW is loaded
* The JS is compiled down Svelte-style
* If events affect parts of DOM not included in client js-bundle, load from SW/server
* From one component-tree, build and bundle for server, client and service worker
My wishlist for a trisomorphic-first framework:
* Familiar component-model
* Granular component-based routing, where some (leaf-)routes/components can be declared to be included for client
* Only JS that gets output to client is event handlers and the above declared components
Trisomorphic rendering is such an interesting concept. Very underexplored as of yet, but I think we’ll see more of it in the future, including abstractions.
A bit simplified it comes down to taking a server+client-rendered app and also rendering it in a service worker.
I was just leaving @sthlmjs when I realised that the guy looking like my close friend from long dead wargames.unix.se / Dievo from 10 years back actually WAS him.
Pretty fitting we’d run into each other at a security themed event after all this time..