mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-04 22:35:08 +00:00
feat(web): ES-module page lifecycle and one schema field model (stage 1) (#703)
Adds a native ES-module layer to the web UI (core/boot, registry, api, facade; window.LEDMatrix as the one global), a page lifecycle that the Cache tab is converted to as the reference, text/javascript serving and revalidation for unversioned module requests, and src/plugin_system/field_model.py with a parity test against the render_field macro. Also: the cache page toggles its grey 'Not configured' style instead of only adding it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -228,6 +228,9 @@
|
||||
el.setAttribute('data-loaded', 'true');
|
||||
if (typeof htmx !== 'undefined') htmx.process(el);
|
||||
if (window.Alpine) window.Alpine.initTree(el);
|
||||
// No htmx swap events here, so start converted pages
|
||||
// (data-page roots) directly; see js/core/registry.js.
|
||||
if (window.LEDMatrix && window.LEDMatrix.pages) window.LEDMatrix.pages.refresh();
|
||||
if (id === 'plugins-content' && window.initPluginsPage) {
|
||||
if (window.pluginManager) {
|
||||
window.pluginManager.initialized = false;
|
||||
@@ -948,7 +951,15 @@
|
||||
or when a card is clicked, so it must follow all of them. No other
|
||||
script defines the same globals. -->
|
||||
<script src="{{ url_for('static', filename='v3/plugins_manager.js') }}" defer></script>
|
||||
|
||||
|
||||
<!-- ES modules: window.LEDMatrix and the page lifecycle (js/core/), and
|
||||
the converted tab pages (js/pages/), loaded on first use. Module
|
||||
scripts are deferred like the scripts above and run after them; they
|
||||
rely on none of them at load time, and a tab partial that arrived
|
||||
first is started when the registry starts. Served as-is, no bundler:
|
||||
see docs/WEB_FRONTEND_ARCHITECTURE.md. -->
|
||||
<script type="module" src="{{ url_for('static', filename='v3/js/core/boot.js') }}"></script>
|
||||
|
||||
<!-- Custom feeds table helpers live in js/widgets/custom-feeds.js (the
|
||||
deferred widget's window assignments always shadowed the inline
|
||||
copies that used to sit here, so the duplicates were removed) -->
|
||||
|
||||
Reference in New Issue
Block a user