The Loki Theme project includes various packages - each package carrying out its own task. Modularity is high. But because this project is currently ongoing, the architecture sounds heavy at first. This document explains things in simple terms.
The first goal that this theme is to remove the Luma JavaScript stack, period. No more RequireJS, KnockoutJS, jQuery, jQuery UI. Each of these libraries is old, slow and hard to deal with compared to modern-day solutions. We should not keep this alive. We should kill it.
Replacing old JavaScript is just one step in modernizing Luma. Other steps would include improving SEO, rewrite HTML to remove cluster, increase accessibility, add a proper CSS framework, etcetera. Those are all good goals to have. But the first goal is to remove JavaScript.
The second goal is to carefully add JavaScript again, but only where it is needed: Native HTML and CSS solutions are preferred instead. When JavaScript is added, vanilla JavaScript is preferred instead. When needed, an Alpine component or store could be used instead.
This is a harder point: The aim for Loki is to allow for flexibility in CSS - simply because frontend developers are not alike: Luma LESS, Snowdog SASS, Tailwind CSS, UIkit, Fylgja, Bootstrap - it should all be an option to frontend developers.
To make this possible, ideally, the JavaScript solution should be disconnected from the CSS solution. Moving over JS logic from one JS framework to another is much harder than changing CSS solution.
And ideally, all of this is done without making PHTML templates. Or by having a base with PHTML templates that are flexible enough to allow further changes without template overrides. Or by simply keeping the templates themselves very small.
From this point onwards, things get a bit uglier. Each individual PHTML template might need an override. Think about this carefully — we don't want a mess.