A few weeks ago Facebook rolled out its new desktop design.
One of the many improvements they are experimenting with is
lazy loading where they prefetch both the
code and the
data needed by a view.
What draw my attention is the introduction of
"files that wrap a code-split point and transform inputs into queries.
These files are very small and are downloaded in advance for any
reachable code-split point."
entry points unify the fetching of
data a view needs in one single GraphQL query:
that contains all the data-fetching needs for any given point in the
app, which can be used for the server preloading discussed earlier."
The new approach leverages GraphQL's ability to unity request and minimizes network usage in a way I have never seen before.
I cannot wait for further releases of their performance improvements and will try to use this in my future projects.
What do you think?
Have you ever seen code and data fetching done simultaneously?
More on Facebook's engineering blog here.