Problem/Motivation
All Project Browser instances on a single page, should use the same query manager so that we can display the same project consistently across multiple PB instances.
Steps to reproduce
Proposed resolution
- Handle all project data fetching by moving the load() function from ProjectBrowser.svelte to QueryManager.load().
- Cache results in-memory
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | flickering.mp4 | 1.06 MB | chrisfromredfin |
Issue fork project_browser-3508631
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
narendrarComment #4
narendrarComment #5
phenaproximaThat's pretty much exactly what I imagined! I have a couple of questions, and I think we need to be sure we're documenting this design properly, or it won't be clear to anyone why we have this window-scoped singleton.
Comment #6
narendrarThanks for the review, @phenaproxima! I’ve addressed the feedback and made some refinements.
Comment #7
phenaproximaComment #8
phenaproximaOkay - tentatively RTBCing. I think this is the final step before we need to do the bigger front-end lift, which is...somehow make all project objects react automatically to changes in the centralized cache. That's going to take some thinking and probably a fair amount of refactoring.
But, once this lands, all the other pieces are in place.
Comment #9
phenaproximaI analyzed this a bit more and decided to proceed with turning QueryManager into a store (i.e., it fulfills Svelte's "store contract" by implementing a
subscribe()method in a particular way). The idea is that it should invoke callbacks whenever project data in the centralized cache has changed.Comment #10
chrisfromredfinA few comments:
Comment #11
phenaproximaOK, I think this will improve things.
Comment #13
tim.plunkettReverted my commit, will address in follow-up. This is good to go
Comment #14
tim.plunkettSaving credit
Comment #16
tim.plunkettMerged !747