The best way to play with this example is to enable "Slow 3G" and "Disable cache" in Chrome Network panel, and to keep an eye on the Waterfall column.
-
-
Prikaži ovu nit
-
There are some interesting patterns this example hints at. Note how link cursor changes after 500ms of waiting for the transition, or how there's a global top-left corner spinner when a Back transition takes too long. (They're meant to give you an idea of what's possible.)
Prikaži ovu nit -
Note how UserPage has child sections that don't block it from rendering (it's ok to load them later) but we kick off their data fetching on link click anyway. We could go a step further, and load *their* code on demand too — I haven't tried to do that yet. Maybe you will?
Prikaži ovu nit -
Btw I haven't actually gotten any feedback on this from
@sebmarkbage or@en_JS yet so maybe this demo is all wrong. But I think it works.
Prikaži ovu nit -
Turns out that I missed the Relay demo is already more complete while the routing layer is agnostic of Relay. We're going to merge these two demos to use common infra later so it's easier to compare them. For now, I'm linking to it from README!https://github.com/relayjs/relay-examples/tree/master/issue-tracker/ …
Prikaži ovu nit -
-
Here’s something
@sebmarkbage brought up that’s worth noting. With this approach of taking to REST APIs from the client you can still hit a waterfall if one request requires data from another. So it doesn’t scale ideally. GraphQL is one possible solution to this.Prikaži ovu nit -
Another possible solution is to move this “data dependency” tree to the *server*. Then the logic would stay colocated with components, but latency would be minimal. The client would hit a server endpoint that fetches everything (code and data) for a particular navigation.
Prikaži ovu nit -
If you’re curious, that’s what the ongoing Flight experiment we’ve been working on is about.
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
-
-
So it kinda looks we're flipping back to react-router 2/3 way of data fetching? Keep the fetching logic in the router, not the component cDM / effect.
-
This example shows the fetching logic colocated with the components. In parallel files.
- Još 4 druga odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.

