Commit graph

17 commits

Author SHA1 Message Date
Virgil
f543f02cc1 feat(html): add layout variant validation helper
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 16:19:30 +00:00
Virgil
60d8225a83 feat(html): preserve layout paths in iterators
All checks were successful
Security Scan / security (push) Successful in 11s
Test / test (push) Successful in 59s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 20:27:50 +00:00
Virgil
4a3a69e8b7 fix(html): preserve switch wrapper paths
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 59s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 20:07:35 +00:00
Virgil
1f98026d04 feat(html): add layout variant validation sentinel
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 55s
Expose VariantError() on Layout and ErrInvalidLayoutVariant for invalid variant strings while preserving current render behaviour.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 20:01:28 +00:00
Virgil
8386c7e57d fix(html): preserve block paths through conditional wrappers
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 56s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:58:38 +00:00
Virgil
65c0dd3e27 fix(html): default nil render contexts
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 48s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:22:02 +00:00
Virgil
911071d2b0 fix(core): harden layout and responsive nil chains
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 31s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 00:28:03 +00:00
Virgil
0318d73a12 fix(core): harden nil-safe rendering paths
All checks were successful
Security Scan / security (push) Successful in 15s
Test / test (push) Successful in 43s
- guard nil receivers and nodes in core render flows
- make Render() safe for nil input
- add compile-time Node contract for Responsive

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:10:48 +00:00
Virgil
3616ad3a76 chore: polish ax v0.8.0 conventions
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 18:12:06 +00:00
Virgil
b8d06460d6 refactor(core): upgrade to v0.8.0-alpha.1
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 15:24:16 +00:00
Snider
2d16ce9d69 fix(conventions): alias stdlib io, add interface checks, use go-log
All checks were successful
Security Scan / security (push) Successful in 7s
Test / test (push) Successful in 1m34s
- Alias stdlib `io` as `goio` in cmd/codegen/main.go to follow project conventions
- Add compile-time Node interface checks for all node types in node.go
  and Layout in layout.go
- Replace fmt.Fprintf stderr logging with go-log in cmd/codegen/main.go
- Replace fmt.Println with go-log in cmd/wasm/register.go

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 16:40:39 +00:00
Snider
473fda5894 security: use html.EscapeString for XSS protection in rendering
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 46s
Replace manual string-replace escaping with stdlib html.EscapeString.
Escape tag names and attribute keys in elNode and Layout rendering.
Improve Attr() to traverse wrapper nodes (If, Unless, Entitled).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:29:54 +00:00
Snider
78d5b45b0c feat: modernise to Go 1.26 — iterators, slices/maps, EachSeq
Some checks failed
Security Scan / security (push) Successful in 10s
Test / test (push) Failing after 36s
- Add EachSeq[T](iter.Seq[T], fn) for iterator-based template rendering
- Use slices.Collect(maps.Keys()) + slices.Sort for deterministic attr output
- Use strings.SplitSeq in codegen TagToClassName and path parsing
- Use range over int in layout and pipeline loops
- Refresh go.sum

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 05:11:22 +00:00
Snider
4c657377c4 fix(wasm): reduce binary from 1.56MB to 830KB gzip
Move heavyweight imports out of WASM build via //go:build !js tags:
- register.go: encoding/json + text/template (codegen)
- pipeline.go: go-i18n/reversal (grammar imprint)
- layout.go: replace fmt.Sprintf with string concat

Add cmd/codegen/ CLI as build-time replacement for in-browser
registerComponents(). Reads slot JSON from stdin, writes WC bundle
JS to stdout.

Result: 2.90MB raw / 830KB gzip (was 6.04MB / 1.56MB).
Makefile gate passes (limit 1MB gzip).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 08:29:54 +00:00
Claude
40da0d8b1d
fix: deterministic attributes and thread-safe nested layouts
Sort attribute keys for deterministic HTML output (I-1).
Clone nested layouts before mutating path in Render (I-3),
preventing data races when the same tree is rendered concurrently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:53:31 +00:00
Claude
d75988a99e feat: add nested layout path chains
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:40:40 +00:00
Claude
946ea8d0aa feat: add HLCRF Layout type with semantic elements
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:39:43 +00:00