Request-scoped data loading

Components load their own data, but the same user is only queried once per request: a small loader on this remembers what it has loaded.

The page below asks for the same four users 17 times: the header, every activity and every team member each load the user they show. The loader keeps the promise of each query, so later calls for the same user share it. A higher-order component, withLoader, wraps the page and creates the loader on this for each request, so visitors never share data and nothing goes stale. Async components render one after another, so every query saved also saves time.

Team dashboardSigned in as Ada

Activity

  • Grace opened issue #42: “Stream the sidebar, too”
  • Ada commented on #42
  • Linus merged pull request #41
  • Grace closed issue #39
  • Ada pushed 3 commits to main
  • Margaret approved the release plan
  • Linus commented on #42
  • Grace tagged release 2.4.0
Queries
17
Waiting for the database
1020 ms
  1. users #1
  2. users #2
  3. users #1
  4. users #3
  5. users #2
  6. users #1
  7. users #4
  8. users #3
  9. users #2
  10. users #1
  11. users #1
  12. users #2
  13. users #2
  14. users #3
  15. users #3
  16. users #4
  17. users #4