From 361cc4ab5ca016b5d8c37ea0de2db5cb50318adc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 28 May 2020 14:26:51 +0100 Subject: [PATCH 1/2] Add app-load doc Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- docs/app-load.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 docs/app-load.md diff --git a/docs/app-load.md b/docs/app-load.md new file mode 100644 index 00000000..865d46cc --- /dev/null +++ b/docs/app-load.md @@ -0,0 +1,80 @@ +# App load order + +Old slow flow: +![image](https://user-images.githubusercontent.com/2403652/73848963-00a2a080-4821-11ea-97d4-1200fc2638f3.png) + +Current more parallel flow: +![image](https://user-images.githubusercontent.com/2403652/83146440-303a2900-a0ee-11ea-806b-4f53f039b957.png) + +
Code +

+


+digraph G {
+  node [shape=box];
+
+  subgraph cluster_0 {
+    color=orange;
+    node [style=filled];
+    label = "index.ts";
+
+    entrypoint, s0, ready [shape=point];
+    rageshake, config, i18n, theme, skin, olm [shape=parallelogram];
+    mobile [shape=diamond, label="mobile"];
+    modernizr [shape=diamond];
+    redirect, incompatible [shape=egg];
+
+    entrypoint -> rageshake;
+    rageshake -> mobile [color=blue];
+    mobile -> s0 [label="No"];
+    mobile -> redirect [label="Yes"];
+
+    s0 -> platform;
+    s0 -> olm;
+    platform -> config;
+
+    config -> i18n [color=blue];
+    config -> theme [color=blue];
+    config -> skin [color=blue];
+
+    i18n -> modernizr [color=blue];
+    theme -> modernizr [color=blue];
+    skin -> modernizr [color=blue];
+
+    modernizr -> ready [label="Yes"];
+    modernizr -> incompatible [label="No"];
+    incompatible -> ready [label="user ignore"];
+
+    olm -> ready [color=red];
+    config -> ready [color=red];
+    skin -> ready [color=red];
+    theme -> ready [color=red];
+    i18n -> ready [color=red];
+  }
+
+  subgraph cluster_1 {
+    color = green;
+    node [style=filled];
+    label = "init.tsx";
+
+    ready -> loadApp;
+    loadApp -> matrixchat;
+  }
+}
+
+

+
+ +Key: ++ Parallelogram: async/await task ++ Box: sync task ++ Diamond: conditional branch ++ Egg: user interaction ++ Blue arrow: async task is allowed to settle but allowed to fail ++ Red arrow: async task success is asserted + +Notes: ++ The success of setting up rageshake is never asserted, riot-web has a fallback path for running without IDB (and thus rageshake). ++ Everything is awaited to be settled before the Modernizr check, to allow it to make use of things like i18n if they are successful. + +Underlying dependencies: +![image](https://user-images.githubusercontent.com/2403652/73848977-08624500-4821-11ea-9830-bb0317c41086.png) From af8fb33b833a56f8b880283ef93fffd17c3c3500 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 28 May 2020 14:28:14 +0100 Subject: [PATCH 2/2] add line Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- docs/app-load.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/app-load.md b/docs/app-load.md index 865d46cc..bdc0243c 100644 --- a/docs/app-load.md +++ b/docs/app-load.md @@ -73,6 +73,7 @@ Key: + Red arrow: async task success is asserted Notes: ++ A task begins when all its dependencies (arrows going into it) are fulfilled. + The success of setting up rageshake is never asserted, riot-web has a fallback path for running without IDB (and thus rageshake). + Everything is awaited to be settled before the Modernizr check, to allow it to make use of things like i18n if they are successful.