Skip to content

Commit 913ffac

Browse files
JeanMechekirjs
authored andcommitted
docs: add parallel execution chart for route resources
Add a Mermaid Gantt chart illustrating sequential data resolvers vs. parallel route resources in the routing data fetching guide, along with light/dark theme styling for Mermaid Gantt charts.
1 parent ef7ae1f commit 913ffac

3 files changed

Lines changed: 128 additions & 1 deletion

File tree

‎adev/shared-docs/styles/docs/_mermaid.scss‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,100 @@
8686
font-weight: 800 !important;
8787
}
8888
}
89+
90+
// Gantt chart theming
91+
&[aria-roledescription='gantt'] {
92+
max-width: 100% !important;
93+
}
94+
95+
.titleText,
96+
.sectionTitle,
97+
.grid .tick text,
98+
.taskTextOutsideRight,
99+
.taskTextOutsideLeft,
100+
.milestoneText {
101+
fill: var(--primary-contrast) !important;
102+
}
103+
104+
text.taskText,
105+
text.activeText0,
106+
text.activeText1,
107+
text.activeText2,
108+
text.activeText3,
109+
text.doneText0,
110+
text.doneText1,
111+
text.doneText2,
112+
text.doneText3 {
113+
fill: var(--primary-contrast) !important;
114+
font-weight: 500;
115+
}
116+
117+
.section0,
118+
.section2 {
119+
fill: var(--septenary-contrast) !important;
120+
opacity: 1 !important;
121+
}
122+
123+
.section1,
124+
.section3 {
125+
fill: var(--page-background) !important;
126+
opacity: 1 !important;
127+
}
128+
129+
.grid .tick text {
130+
font-size: 13px;
131+
}
132+
133+
.grid .tick line {
134+
stroke: var(--senary-contrast) !important;
135+
}
136+
137+
.task {
138+
rx: 6px;
139+
ry: 6px;
140+
stroke-width: 1.5px;
141+
}
142+
143+
.task0,
144+
.task2 {
145+
fill: color-mix(in srgb, var(--bright-blue) 18%, var(--page-background)) !important;
146+
stroke: var(--bright-blue) !important;
147+
}
148+
149+
.active0,
150+
.active2 {
151+
fill: color-mix(in srgb, var(--electric-violet) 18%, var(--page-background)) !important;
152+
stroke: var(--electric-violet) !important;
153+
}
154+
155+
.done0,
156+
.done2 {
157+
fill: color-mix(in srgb, var(--vivid-pink) 18%, var(--page-background)) !important;
158+
stroke: var(--vivid-pink) !important;
159+
}
160+
161+
.task1,
162+
.task3 {
163+
fill: color-mix(in srgb, var(--symbolic-cyan) 18%, var(--page-background)) !important;
164+
stroke: var(--symbolic-cyan) !important;
165+
}
166+
167+
.active1,
168+
.active3 {
169+
fill: color-mix(in srgb, var(--symbolic-green) 18%, var(--page-background)) !important;
170+
stroke: var(--symbolic-green) !important;
171+
}
172+
173+
.done1,
174+
.done3 {
175+
fill: color-mix(in srgb, var(--symbolic-teal) 18%, var(--page-background)) !important;
176+
stroke: var(--symbolic-teal) !important;
177+
}
178+
179+
.milestone {
180+
fill: var(--hot-pink) !important;
181+
stroke: var(--hot-pink) !important;
182+
rx: 2px;
183+
ry: 2px;
184+
}
89185
}

‎adev/src/content/guide/routing/BUILD.bazel‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ generate_guides(
1010
"//adev/src/assets/images:routing.svg",
1111
"//adev/src/content/examples",
1212
],
13+
mermaid_blocks = True,
1314
visibility = ["//adev:__subpackages__"],
1415
)
1516

‎adev/src/content/guide/routing/data-fetching-with-resources.md‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,40 @@ TIP: Read specific properties, such as `ctx.params()['id']`, instead of returnin
129129

130130
## Parallel execution
131131

132-
Data resolvers execute sequentially from parent route to child route. If a parent route resolver takes 200ms and a child route resolver takes 300ms, the navigation is blocked for 500ms.
132+
Data resolvers execute sequentially from parent route to child route. If a parent route resolver takes 200ms, a child route resolver takes 300ms, and a grandchild route resolver takes 200ms, the navigation is blocked for 700ms.
133133

134134
Route resources across the matched route hierarchy run concurrently, so the same navigation completes in 300ms, the time of the slowest resource. Resources that depend on data from an ancestor route also set up immediately instead of waiting; see [Chaining a resource off an ancestor resource](#chaining-a-resource-off-an-ancestor-resource).
135135

136+
```mermaid
137+
---
138+
displayMode: compact
139+
config:
140+
gantt:
141+
useWidth: 860
142+
leftPadding: 195
143+
rightPadding: 40
144+
barHeight: 34
145+
barGap: 4
146+
fontSize: 14
147+
sectionFontSize: 14
148+
---
149+
gantt
150+
dateFormat x
151+
axisFormat %Lms
152+
tickInterval 100millisecond
153+
todayMarker off
154+
section Data resolvers (700ms)
155+
Parent (200ms) : 0, 200
156+
Child (300ms) : active, 200, 500
157+
Grandchild (200ms) : done, 500, 700
158+
Route activates : milestone, 699, 699
159+
section Route resources (300ms)
160+
Parent (200ms) : 0, 200
161+
Child (300ms) : active, 0, 300
162+
Grandchild (200ms) : done, 0, 200
163+
Route activates : milestone, 300, 300
164+
```
165+
136166
## Resource inheritance
137167

138168
Every route inherits the resources of its ancestor routes. Angular exposes those inherited resources in two forms:

0 commit comments

Comments
 (0)