LearnNewsExamplesServices
Frontmatter
id2142
titleAdd a micro loader to the index.html files
stateClosed
labels
enhancement
assigneestobiu
createdAtMay 24, 2021, 10:54 PM
updatedAtMay 25, 2021, 7:31 PM
githubUrlhttps://github.com/neomjs/neo/issues/2142
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 25, 2021, 7:31 PM

Add a micro loader to the index.html files

Closed v8.1.0 enhancement
tobiu
tobiu commented on May 24, 2021, 10:54 PM

before:

<!DOCTYPE HTML>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <title>COVID-19 IN NUMBERS</title>
</head>
<body>
    <script>
        Neo = self.Neo || {}; Neo.config = Neo.config || {};

        Object.assign(Neo.config, {
            appPath         : 'apps/covid/app.mjs',
            basePath        : '../../',
            environment     : 'development',
            mainThreadAddons: ['AmCharts', 'DragDrop', 'MapboxGL', 'Stylesheet'],
            themes          : ['neo-theme-dark', 'neo-theme-light']
        });
    </script>

    <script src="../../src/Main.mjs" type="module"></script>
</body>
</html>

new version:

<!DOCTYPE HTML>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <title>COVID-19 IN NUMBERS</title>
</head>
<body>
    <script src="../../src/MicroLoader.mjs" type="module"></script>
</body>
</html>

neo-config.json:

{
    "appPath"         : "apps/covid/app.mjs",
    "basePath"        : "../../",
    "environment"     : "development",
    "mainPath"        : "./Main.mjs",
    "mainThreadAddons": ["AmCharts", "DragDrop", "MapboxGL", "Stylesheet"],
    "themes"          : ["neo-theme-dark", "neo-theme-light"]
}

MicroLoader.mjs:

fetch('./neo-config.json').then(response => response.json()).then(data => {
    self.Neo = {config: {}};
    Object.assign(Neo.config, data);
    import(data.mainPath);
});

It is a tiny bit slower, but feels much cleaner.

Especially when we are moving folders around (e.g. copying the docs app & examples into a workspace, we do not have to deal with string manipulations.

tobiu added the enhancement label on May 24, 2021, 10:54 PM
tobiu assigned to @tobiu on May 24, 2021, 10:54 PM
tobiu referenced in commit 2af4a98 - "Add a micro loader to the index.html files #2142 PoC" on May 24, 2021, 11:14 PM
tobiu referenced in commit e731a3e - "#2142 real world app" on May 24, 2021, 11:23 PM
tobiu referenced in commit 2a88d13 - "#2142 real world 2 app" on May 24, 2021, 11:26 PM
tobiu referenced in commit 1c0f22f - "#2142 real world 2 sharedcovid" on May 24, 2021, 11:28 PM
tobiu referenced in commit b289d03 - "#2142 real world 2 sharedcovidchart" on May 24, 2021, 11:30 PM
tobiu referenced in commit c0b88ea - "#2142 real world 2 sharedcovidgallery" on May 24, 2021, 11:33 PM
tobiu referenced in commit 24096ec - "#2142 real world 2 sharedcovidhelix" on May 24, 2021, 11:36 PM
tobiu referenced in commit a3faa6b - "#2142 sharedcovidmap" on May 24, 2021, 11:37 PM
tobiu referenced in commit c0f0a29 - "#2142 shareddialog" on May 24, 2021, 11:40 PM
tobiu referenced in commit 3cd8369 - "#2142 shareddialog2" on May 24, 2021, 11:41 PM
tobiu referenced in commit 28d1068 - "#2142 website" on May 24, 2021, 11:45 PM
tobiu referenced in commit 1d695c4 - "#2142 docs" on May 24, 2021, 11:54 PM
tobiu referenced in commit 682f8b6 - "#2142 smarter check for Main" on May 24, 2021, 11:58 PM
tobiu referenced in commit c04c2d6 - "#2142 DomEvents - Main initialisation" on May 25, 2021, 12:15 AM
tobiu referenced in commit f3d92c7 - "#2142 examples/button/base" on May 25, 2021, 12:24 AM
tobiu referenced in commit ff320af - "#2142 examples/button/split" on May 25, 2021, 12:26 AM
tobiu referenced in commit 637fd60 - "#2142 examples/calendar/basic" on May 25, 2021, 12:31 AM
tobiu referenced in commit 6d39348 - "#2142 examples/charts" on May 25, 2021, 12:39 AM
tobiu referenced in commit b2394cc - "#2142 examples/component/chip" on May 25, 2021, 12:49 AM
tobiu referenced in commit f228752 - "#2142 examples/component/circle" on May 25, 2021, 12:51 AM
tobiu referenced in commit 5021c52 - "#2142 examples/component/coronaGallery" on May 25, 2021, 12:56 AM
tobiu referenced in commit e18cd4f - "#2142 examples/component/coronaHelix" on May 25, 2021, 1:05 AM
tobiu cross-referenced by #2143 on May 25, 2021, 10:42 AM
tobiu
tobiu May 25, 2021, 10:45 AM

updated the top level post to include the micro loader getting moved into an own file.

tobiu referenced in commit 7606913 - "#2142 => examples/component/dateSelector" on May 25, 2021, 10:49 AM
tobiu referenced in commit 44707ee - "#2142 => examples/component/gallery (plus adding the count deltas header)" on May 25, 2021, 10:58 AM
tobiu referenced in commit 399e690 - "#2142 => examples/component/helix" on May 25, 2021, 11:02 AM
tobiu referenced in commit 9e46abe - "#2142 => examples/container" on May 25, 2021, 11:09 AM
tobiu referenced in commit 8b0f7fd - "#2142 => examples/core/config" on May 25, 2021, 11:16 AM
tobiu referenced in commit 117edb3 - "#2142 => examples/dialog" on May 25, 2021, 11:21 AM
tobiu referenced in commit a29b661 - "#2142 => examples/fields" on May 25, 2021, 11:25 AM
tobiu referenced in commit 8f7b844 - "#2142 => examples/form/field/chip" on May 25, 2021, 11:30 AM
tobiu referenced in commit f743a58 - "#2142 => examples/form/field/date" on May 25, 2021, 12:53 PM
tobiu referenced in commit ea6f9dc - "#2142 => examples/form/field/email" on May 25, 2021, 12:55 PM
tobiu referenced in commit 9bdcf87 - "#2142 => examples/form/field/number" on May 25, 2021, 12:56 PM
tobiu referenced in commit 4947c5e - "#2142 => examples/form/field/picker" on May 25, 2021, 1:00 PM
tobiu referenced in commit 7637241 - "#2142 => examples/form/field/select" on May 25, 2021, 1:05 PM
tobiu referenced in commit 7cc1a6a - "#2142 => examples/form/field/text" on May 25, 2021, 1:08 PM
tobiu referenced in commit da9676c - "#2142 => examples/form/field/textarea" on May 25, 2021, 1:11 PM
tobiu referenced in commit 1d10642 - "#2142 => examples/form/field/time" on May 25, 2021, 1:14 PM
tobiu referenced in commit 39347b1 - "#2142 => examples/form/field/trigger/copyToClipboard" on May 25, 2021, 1:18 PM
tobiu referenced in commit f90a649 - "#2142 => examples/form/field/trigger/url" on May 25, 2021, 1:20 PM
tobiu referenced in commit 5ec0d6e - "#2142 => examples/form/fieldset" on May 25, 2021, 1:24 PM
tobiu referenced in commit 9bc2c47 - "#2142 => examples/list/base" on May 25, 2021, 1:28 PM
tobiu referenced in commit 6916733 - "#2142 => examples/list/chip" on May 25, 2021, 1:32 PM
tobiu referenced in commit a173e9a - "#2142 => examples/model/advanced" on May 25, 2021, 2:16 PM
tobiu referenced in commit 5dc405f - "#2142 => examples/model/dialog" on May 25, 2021, 2:21 PM
tobiu referenced in commit 301190c - "#2142 => examples/model/extendedClass" on May 25, 2021, 2:24 PM
tobiu referenced in commit e4d329e - "#2142 => examples/model/inline" on May 25, 2021, 3:01 PM
tobiu referenced in commit cf642f9 - "#2142 => examples/model/inlineNoModel" on May 25, 2021, 3:04 PM
tobiu referenced in commit 9c9e65c - "#2142 => examples/model/multiWindow" on May 25, 2021, 3:07 PM
tobiu referenced in commit a0672fa - "#2142 => examples/model/multiWindow2" on May 25, 2021, 3:12 PM
tobiu referenced in commit efe8006 - "#2142 => examples/model/nestedData" on May 25, 2021, 3:16 PM
tobiu referenced in commit 708f2ce - "#2142 => examples/model & list: removed the DD main thread addon where possible" on May 25, 2021, 3:22 PM
tobiu referenced in commit 374c9e5 - "#2142 => examples/model/table" on May 25, 2021, 3:26 PM
tobiu referenced in commit 838c590 - "#2142 => examples/panel" on May 25, 2021, 3:28 PM
tobiu referenced in commit e660be4 - "#2142 => examples/tab/container" on May 25, 2021, 3:33 PM
tobiu referenced in commit cb9177e - "#2142 => examples/table/container" on May 25, 2021, 3:37 PM
tobiu referenced in commit 22ba38e - "#2142 => examples/tableFiltering" on May 25, 2021, 3:41 PM
tobiu referenced in commit e9369e7 - "#2142 => examples/tablePerformance" on May 25, 2021, 4:24 PM
tobiu referenced in commit af6fbd8 - "#2142 => examples/tableStore" on May 25, 2021, 4:29 PM
tobiu referenced in commit 34522b1 - "#2142 => examples/tabs" on May 25, 2021, 4:33 PM
tobiu referenced in commit af590f1 - "#2142 => examples/todoList/version1" on May 25, 2021, 4:37 PM
tobiu referenced in commit ab3dc71 - "#2142 => examples/todoList/version2" on May 25, 2021, 4:42 PM
tobiu referenced in commit d5495ff - "#2142 => examples/tree" on May 25, 2021, 4:47 PM
tobiu referenced in commit 30ec588 - "#2142 => examples/viewport" on May 25, 2021, 4:51 PM
tobiu
tobiu May 25, 2021, 7:31 PM

all index files inside the main repo are adjusted now. will create follow up tickets for the build scripts.

tobiu closed this issue on May 25, 2021, 7:31 PM