1
0
Преглед на файлове

internal/index.html: Later start of loading of dev-only packages.

To improve load time by allowing amber loader start earlier
and process base classes (Kernel-*, Compiler-*, Platform-*) earlier.
Herbert Vojčík преди 8 години
родител
ревизия
078a18ccd4
променени са 1 файла, в които са добавени 18 реда и са изтрити 12 реда
  1. 18 12
      internal/index.html

+ 18 - 12
internal/index.html

@@ -14,6 +14,7 @@
             }}
         };
     </script>
+    <script type='text/javascript' src='../node_modules/es6-promise/dist/es6-promise.js'></script>
     <script type='text/javascript' src='../node_modules/requirejs/require.js'></script>
     <script type='text/javascript' src='../config.js'></script>
 </head>
@@ -27,18 +28,23 @@
     startLegacy.parentNode.removeChild(startLegacy);
     var startHelios = document.getElementById("starthelios");
     startHelios.parentNode.removeChild(startHelios);
-    require(
-        ["amber/devel", "amber/legacy/IDE", "amber/web/Web", "amber/legacy/Benchfib", "helios/all", "amber_cli/AmberCli"],
-        function (amber) {
-            amber.initialize({'transport.defaultAmdNamespace': "amber_core"})
-                    .then(function () {
-                        var loading = document.getElementById("loading");
-                        loading.parentNode.appendChild(startLegacy);
-                        loading.parentNode.appendChild(startHelios);
-                        loading.parentNode.removeChild(loading);
-                    });
-        }
-    );
+    var loadHelpers = new Promise(function (resolve, reject) {
+        setTimeout(function () {
+            require(["amber/legacy/IDE", "amber/web/Web", "amber/legacy/Benchfib", "helios/all", "amber_cli/AmberCli"], resolve, reject);
+        }, 250);
+    });
+    require(["amber/devel"], function (amber) {
+        loadHelpers
+                .then(function () {
+                    return amber.initialize({'transport.defaultAmdNamespace': "amber_core"})
+                })
+                .then(function () {
+                    var loading = document.getElementById("loading");
+                    loading.parentNode.appendChild(startLegacy);
+                    loading.parentNode.appendChild(startHelios);
+                    loading.parentNode.removeChild(loading);
+                });
+    });
 </script>
 </body>
 </html>