laghu 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,66 @@
1
+ # Changelog
2
+
3
+ All notable changes to laghu are recorded here. Versioning follows
4
+ semver: patch for fixes, minor for backwards-compatible additions,
5
+ major for breaking changes.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.1.0]
10
+
11
+ Security baseline (breaking only for attack patterns):
12
+
13
+ - Default HTML sanitizer: `data-html` and swaps strip scripts,
14
+ frames, event-handler attributes, and scriptable URLs out of the
15
+ box. Override with `Laghu.sanitize` (DOMPurify recommended for
16
+ untrusted content).
17
+ - URL policy: `data-bind:href/src/action/...` refuses
18
+ `javascript:`, `data:text/html`, and `vbscript:` values.
19
+ - Prototype pollution guards in path reads, writes, and action
20
+ strings (`__proto__`, `constructor`, `prototype` blocked).
21
+ - `DEV` now defaults off (`__LAGHU_DEV__ === true` enables). Error
22
+ visibility moves to events that always fire: `laghu:error`,
23
+ `laghu:request-error`, `laghu:unknown-action`.
24
+
25
+ Reliability:
26
+
27
+ - One throwing binding no longer kills the page; failures report
28
+ `laghu:error` and the scan continues.
29
+ - Effects unsubscribe on stop and prune stale deps on re-run;
30
+ nested effects compose through a stack.
31
+ - Swapped content keeps the requesting element's actions;
32
+ `morph:outer` forwards its mode.
33
+ - Fetch overlap uses a controller set (correct `queue:all`),
34
+ `data-timeout` aborts hung requests, GET arrays repeat params,
35
+ `+json` content types merge, failures record `state.$error`
36
+ with `data-pending` on the element.
37
+ - `onUnmount` setup hooks now run on disconnect.
38
+ - Row scopes own their variables; keyed lists use item-relative
39
+ `data-key` and rebind only on identity change; the observer
40
+ treats intra-batch moves as moves, not removals.
41
+
42
+ Expressions (still no `new Function`, still CSP-safe):
43
+
44
+ - Ternary (`a ? b : c`), arithmetic (`+ - * / %` with precedence),
45
+ parenthesized groups, calls with evaluated arguments,
46
+ bracket indexes (`list[0]`, `map["key"]`).
47
+ - Plain kebab-case action names stay literal; hyphens mean
48
+ subtraction only inside larger expressions.
49
+
50
+ New API:
51
+
52
+ - `Laghu.computed(fn)`, `Laghu.watch(scope, expr, cb)`,
53
+ `Laghu.persist(name, opts)` (localStorage, versioned).
54
+ - `LaghuRouter` opt-in plugin (`dist/router.min.js`): hash routes
55
+ with params, guards, notfound, programmatic navigate.
56
+ - Late-added state keys wake readers (miss tracking); `$error`
57
+ seeded at hydrate.
58
+
59
+ Docs: full JSDoc with examples on all public API, TSDoc
60
+ declarations, 17-section README with linked contents.
61
+
62
+ ## [1.0.0]
63
+
64
+ Initial release: zero-build IIFE core, Light-DOM components, Proxy
65
+ reactivity, HTML-first templates, JSON/HTML fetch, morph plugin,
66
+ 9 examples, 2 demo apps, 5-way benchmark.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 prosubodh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.