From a7d0a6c409850b3603abb162fa6fd22d2dfd0177 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 20 May 2026 17:29:28 +0200 Subject: frontend: add comptime bundler --- src/frontend/z-component.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/frontend/z-component.js (limited to 'src/frontend/z-component.js') diff --git a/src/frontend/z-component.js b/src/frontend/z-component.js new file mode 100644 index 0000000..e9b63ff --- /dev/null +++ b/src/frontend/z-component.js @@ -0,0 +1,17 @@ +customElements.define( + "z-component", + class extends HTMLElement { + constructor() { + super(); + this.attachShadow({ mode: 'open' }) + } + + connectedCallback() { + const type = this.getAttribute('type'); + const template = document.getElementById(`--${type}`); + const node = document.importNode(template.content, true); + this.shadowRoot.id = 'root'; + this.shadowRoot.appendChild(node); + } + } +); -- cgit v1.2.3-70-g09d2