1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-21 23:39:37 +01:00
A library expanding the capabilities of the native DOM API with the aim of offering the possibility of writing reactive UI templates/components declaratively directly in JavaScript. https://jaandrle.github.io/deka-dom-el/
Go to file
2023-11-08 19:09:39 +01:00
bs docs + readme 2023-11-07 21:58:48 +01:00
dist 💥 WC 2023-11-08 19:09:39 +01:00
docs 🔨 mainly types + 💥 ddePublicElementTagNameMap 2023-11-08 18:53:22 +01:00
docs_src 🔨 mainly types + 💥 ddePublicElementTagNameMap 2023-11-08 18:53:22 +01:00
examples 💥 WC 2023-11-08 19:09:39 +01:00
src 💥 WC 2023-11-08 19:09:39 +01:00
.gitignore dev-package (#15) 2023-09-05 09:25:47 +02:00
index-with-signals.d.ts Bundle DTS files 2023-10-19 15:01:54 +02:00
index-with-signals.js ♻️ 🔨 🐛 e.g. better namespace #18 2023-09-19 09:30:21 +02:00
index.d.ts 💥 WC 2023-11-08 19:09:39 +01:00
index.js 💥 append, elNS, el.mark, el.later 2023-11-08 13:44:37 +01:00
jsdom.d.ts 🚚 2023-09-13 21:06:13 +02:00
jsdom.js 💥 append, elNS, el.mark, el.later 2023-11-08 13:44:37 +01:00
LICENSE Initial commit 2023-08-22 16:29:37 +02:00
package-lock.json docs + readme 2023-11-07 21:58:48 +01:00
package.json 💥 WC 2023-11-08 19:09:39 +01:00
README.md 💥 append, elNS, el.mark, el.later 2023-11-08 13:44:37 +01:00
signals.d.ts 🔨 mainly types + 💥 ddePublicElementTagNameMap 2023-11-08 18:53:22 +01:00
signals.js ♻️ 🔨 🐛 e.g. better namespace #18 2023-09-19 09:30:21 +02:00
tsconfig.json Bundle DTS files 2023-10-19 15:01:54 +02:00

WIP (the experimentation phase) | source code on GitHub | mirrored on Gitea

Vanilla by default — steroids if needed …use simple DOM API by default and library tools and logic when you need them

const value= S("");
document.body.append(
	el("span", { style: { fontWeight: "bold" }, textContent: value }),
	el("input", { type: "text" },
		on("change", event=> value(event.target.value)))
);

Deka DOM Elements

Creating reactive elements, components and Web components using IDL/JavaScript DOM API and signals (Signals — whats going on behind the scenes | by Ryan Hoffnan | ITNEXT or The Evolution of Signals in JavaScript - DEV Community).

Inspiration and suggested alternatives

Why an another one?

This library should lies somewhere between van/hyperscript and solid-js (S). In the meaning of size, complexity and usability.

An another goal is making clear library logic. Starting from pure native JavaScript (DOM API), then using small utils (assign, S, …, el, …) and end up with way to write complex code. Therefore, you can use any „internal” function to make live with native JavaScript easier (assign, classListDeclarative, on, dispatchEvent, …, S, …) regarding if you need complex library/framework.

As consequence of that, it shouldnt be hard to incorporate the library into existing projects. That can make potecial migration easier.

To balance all requirements above, lots of compromises have been made. To sumarize:

  • library size 1015kB minified (10kB originaly)
  • allow using signals optionaly and allow registering own signals implementation
  • no build step required
  • prefer a declarative/functional approach
  • prefer zero/minimal dependencies
  • support/enhance custom elements (web components)
  • support SSR (jsdom)
  • WIP provide types

First steps

  • Guide
  • Documentation
  • Instalation
    • npm
    • dist/ (https://cdn.jsdelivr.net/gh/jaandrle/deka-dom-el/dist/…)