|
| 1 | +# App load order |
| 2 | + |
| 3 | +Old slow flow: |
| 4 | + |
| 5 | + |
| 6 | +Current more parallel flow: |
| 7 | + |
| 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 | + |
0 commit comments