diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2019-10-11 12:49:38 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2019-10-11 12:49:38 +0000 |
| commit | 07fc2ef73e372e7ce274f191d7a6202a74d0702f (patch) | |
| tree | 78fb1c801d47668a2b45e8fdf331903d693511bc /root | |
| parent | change ?interactive pseudofacet to text/html+interactive pseudo-type (diff) | |
| download | mmm-07fc2ef73e372e7ce274f191d7a6202a74d0702f.tar.gz mmm-07fc2ef73e372e7ce274f191d7a6202a74d0702f.zip | |
add ba_log entry 2019-10-10
Diffstat (limited to 'root')
| -rw-r--r-- | root/articles/mmmfs/ba_log/2019-10-10/text$markdown.md | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/root/articles/mmmfs/ba_log/2019-10-10/text$markdown.md b/root/articles/mmmfs/ba_log/2019-10-10/text$markdown.md new file mode 100644 index 0000000..bfecbeb --- /dev/null +++ b/root/articles/mmmfs/ba_log/2019-10-10/text$markdown.md @@ -0,0 +1,47 @@ +Today I moved the static resources needed by the web-frontend into the content of the mmmfs itself: +The server doesn't make an exception for static files anymore (as described in [a previous update][2019-10-08]), +but rather the files are just in a fileder called `static` now, and properly typed, here: + +- [`/static/style/`](/static/style/:%20text/html+interactive#inspect) +- [`/static/mmm/`](/static/mmm/:%20text/html+interactive#inspect) +- [`/static/fengari-web/`](/static/fengari-web/:%20text/html+interactive#inspect) + +This removed a big exception and left the server implementation much cleaner and shorter, as can be seen in the corresponding commit [`005cc9b`][005cc9b]. + +I also changed the route syntax introduced in [`2019-10-08`][2019-10-08] for getting the fileder index, +now instead of being hard-coded to return a JSON value at `?index` \[[`b36a1a6`][b36a1a6]\]. +`?index` is treated as a pseudo-facet that can be requested in different types, just like real facets. +I also added a second pseudo-facet `?tree`, which works like `?index`, except that it recurses and includes +all content below the current fileder, rather than just including the child-fileders. + +Here are some example links for viewing these: + +- [`/?index`](/?index) +- [`/articles/mmmfs/ba_log/?index: text/html`](/articles/mmmfs/ba_log/?index:%20text/html) + +Finally I added a third pseudo-facet called `?interactive` that renders the Inspector that the old page ran on, +allowing to inspect raw facets, and bringing back the navbar \[[`9ab2f0f`][9ab2f0f]\]. + +Now that there was a way to serve the Browser to the client again, I got to work on fixing it there. +This involved a bigger changes in the shared mmm internals: + +Up to this point, for each request to render a fileder, the server would load that fileder, +with all its facets and their values, as well as all children and their facets and children recursively. +That means that when the root fileder is rendered, currently 120MB of data have to be loaded from disk (or a database). +Now that the client can render content within the web browser again, that would be even worse due to the network delay. + +To solve this, the Fileder implementation now lazy-loads \[[`9632233`][9632233]\]. +When a Fileder is created, it initially knows only its path, but doesn't know which factes or children it contains. +As soon as that data is attempted to be accessed, the fileder loads in the list of its children and facets from the datastore. +The facet contents are loaded only when they are actually needed to fulfill a data request or conversion. + +With this need for optimization taken care of, I added a new datastore (`web`) \[[`91546d1`][91546d1]\], that can run on the client. +Instead of directly accessing a database or physical file system, like the `sql` and `fs` stores, the `web` store delegates all +requests to the server APIs I have been building, such as the new `?index` pseudo-facet. + +[2019-10-08]: /articles/mmmfs/ba_log/2019-10-08/ +[005cc9b]: https://git.s-ol.nu/mmm/commit/005cc9b3914128267017620984aee921999e173f/ +[b36a1a6]: https://git.s-ol.nu/mmm/commit/b36a1a6c61a6e8bff156ce4e2dc66fe8ed8cd95e/ +[9ab2f0f]: https://git.s-ol.nu/mmm/commit/9ab2f0fe3a1a043300536a057bafe5058d987d7f/ +[9632233]: https://git.s-ol.nu/mmm/commit/9632233c16a26f017c648faf36a6b26833e62f2e/ +[91546d1]: https://git.s-ol.nu/mmm/commit/91546d12919736b08567d7174bf1063cab0838f0/ |
