Reduce request for patch view
Adds the same previousLoadedRoute strategy used in source views to
individual patches.
Since we where re-fetching a lot of diffs on patch view load and in between tags, this patch adds a svelte store that stores those diffs in memory (indexed by base and head commit and RID) and avoids refetching them since they are immutable.
6 files changed
+148
-35
5174cda6
→
98857582
modified package-lock.json
@@ -22,6 +22,7 @@
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -3377,6 +3378,14 @@
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified package.json
@@ -68,6 +68,7 @@
|
|
|
|
|
|
| + | |
|
|
|
|
|
added src/lib/cache.ts
@@ -0,0 +1,21 @@
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
modified src/views/projects/Cob/Revision.svelte
@@ -11,6 +11,7 @@
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -104,7 +105,12 @@
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified src/views/projects/DiffStatBadgeLoader.svelte
@@ -1,7 +1,7 @@
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -12,17 +12,9 @@
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/views/projects/router.ts
@@ -13,21 +13,24 @@ import type {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| - | |
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -225,6 +228,15 @@ function isOid(input: string): boolean {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -269,7 +281,7 @@ export async function loadProjectRoute(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -291,7 +303,7 @@ export async function loadProjectRoute(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -386,25 +398,31 @@ async function loadTreeView(
|
|
|
|
|
|
| + | |
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -508,15 +526,39 @@ async function loadBlob(
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
@@ -534,9 +576,22 @@ async function loadHistoryView(
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -590,6 +645,7 @@ async function loadIssueView(
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -597,14 +653,40 @@ async function loadPatchView(
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -626,7 +708,8 @@ async function loadPatchView(
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -643,7 +726,8 @@ async function loadPatchView(
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -661,9 +745,9 @@ async function loadPatchView(
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|