emission icon indicating copy to clipboard operation
emission copied to clipboard

Use relay pre-caching to warm up the root view controllers

Open orta opened this issue 8 years ago • 4 comments

Aim: We use background fetch to keep an up-to-date cache of the initial home and user creds.

How: On the fetch, we download a query then store the details to the FS, then we can use the new prefetching in Relay Modern to fill the cache before the JS runtime is up and running.

Tricky: There's no docs we can find so far

orta avatar Nov 19 '17 14:11 orta

There's a lot of useful discussion in https://github.com/facebook/relay/issues/676#issuecomment-290476329 and this diagram of what it looks like.

This comment: https://github.com/facebook/relay/issues/676#issuecomment-325214249 shows that maybe we can execute the query through relay, persist the store and then reload with on launch?

orta avatar Nov 19 '17 14:11 orta

The context of that thread is rehydration and the linked to comment also very much seems to be about serializing/deserializing a full Relay store, i.e. one that has data loaded on the server-side and then continues to use that on the client-side.

alloy avatar Nov 19 '17 14:11 alloy

Ah shame, here's some more related tidbits: http://taiki-t.hatenablog.com/entry/2017/09/05/181931 and https://github.com/facebook/relay/pull/2121/files

orta avatar Nov 19 '17 14:11 orta

Apollo are getting into this game too: https://dev-blog.apollodata.com/the-future-of-state-management-dd410864cae2

orta avatar Dec 22 '17 18:12 orta