Skip to content

Commit 361cc4a

Browse files
committed
Add app-load doc
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 332be9b commit 361cc4a

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

‎docs/app-load.md‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# App load order
2+
3+
Old slow flow:
4+
![image](https://user-images.githubusercontent.com/2403652/73848963-00a2a080-4821-11ea-97d4-1200fc2638f3.png)
5+
6+
Current more parallel flow:
7+
![image](https://user-images.githubusercontent.com/2403652/83146440-303a2900-a0ee-11ea-806b-4f53f039b957.png)
8+
9+
<details><summary>Code</summary>
10+
<p>
11+
<pre><code>
12+
digraph G {
13+
node [shape=box];
14+
15+
subgraph cluster_0 {
16+
color=orange;
17+
node [style=filled];
18+
label = "index.ts";
19+
20+
entrypoint, s0, ready [shape=point];
21+
rageshake, config, i18n, theme, skin, olm [shape=parallelogram];
22+
mobile [shape=diamond, label="mobile"];
23+
modernizr [shape=diamond];
24+
redirect, incompatible [shape=egg];
25+
26+
entrypoint -> rageshake;
27+
rageshake -> mobile [color=blue];
28+
mobile -> s0 [label="No"];
29+
mobile -> redirect [label="Yes"];
30+
31+
s0 -> platform;
32+
s0 -> olm;
33+
platform -> config;
34+
35+
config -> i18n [color=blue];
36+
config -> theme [color=blue];
37+
config -> skin [color=blue];
38+
39+
i18n -> modernizr [color=blue];
40+
theme -> modernizr [color=blue];
41+
skin -> modernizr [color=blue];
42+
43+
modernizr -> ready [label="Yes"];
44+
modernizr -> incompatible [label="No"];
45+
incompatible -> ready [label="user ignore"];
46+
47+
olm -> ready [color=red];
48+
config -> ready [color=red];
49+
skin -> ready [color=red];
50+
theme -> ready [color=red];
51+
i18n -> ready [color=red];
52+
}
53+
54+
subgraph cluster_1 {
55+
color = green;
56+
node [style=filled];
57+
label = "init.tsx";
58+
59+
ready -> loadApp;
60+
loadApp -> matrixchat;
61+
}
62+
}
63+
</code></pre>
64+
</p>
65+
</details>
66+
67+
Key:
68+
+ Parallelogram: async/await task
69+
+ Box: sync task
70+
+ Diamond: conditional branch
71+
+ Egg: user interaction
72+
+ Blue arrow: async task is allowed to settle but allowed to fail
73+
+ Red arrow: async task success is asserted
74+
75+
Notes:
76+
+ The success of setting up rageshake is never asserted, riot-web has a fallback path for running without IDB (and thus rageshake).
77+
+ Everything is awaited to be settled before the Modernizr check, to allow it to make use of things like i18n if they are successful.
78+
79+
Underlying dependencies:
80+
![image](https://user-images.githubusercontent.com/2403652/73848977-08624500-4821-11ea-9830-bb0317c41086.png)

0 commit comments

Comments
 (0)