Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
286731e
feat(html): Metadata alias on Context + Responsive.Add with media-que…
Snider Apr 14, 2026
09b48e0
chore(html): swap errors.Is for core.Is in codegen CLI, document WASM…
Snider Apr 14, 2026
61adbd5
fix(html): align left slot with navigation semantics
Snider Apr 14, 2026
7679d2d
feat(html): support count context in Text
Snider Apr 14, 2026
0c19ccf
fix(html): honour Metadata alias for text counts
Snider Apr 14, 2026
f6bdc09
feat(html): add RFC block-path rendering
Snider Apr 14, 2026
480a645
fix(html): preserve responsive layout paths
Snider Apr 14, 2026
2d8ddb4
fix(html): preserve each item paths through wrappers
Snider Apr 14, 2026
fc4bae0
feat(responsive): surface media hints on variant containers
Snider Apr 14, 2026
fb13048
fix(html): share pluralisation args across builds
Snider Apr 15, 2026
bfecee9
fix: preserve context map aliasing
Snider Apr 15, 2026
066bb8e
Implement dotted block coordinates
Snider Apr 15, 2026
ebbd050
Stabilize repeated layout block IDs
Snider Apr 15, 2026
0020f26
test(html): add helper coverage and refresh docs
Snider Apr 15, 2026
b08a226
feat(html): keep Each layout paths unique
Snider Apr 15, 2026
691d504
fix: retain wasm callback and normalize codegen class names
Snider Apr 15, 2026
4e5c3fd
fix(layout): stabilise block id numbering
Snider Apr 15, 2026
7013cc3
docs: sync session brief with current html implementation
codex Apr 15, 2026
7dd14c7
fix: align layout validation with RFC
Snider Apr 15, 2026
5fa28ca
docs: sync html docs with RFC examples
Snider Apr 15, 2026
b1ff334
fix: preserve comparison operators in strip tags
Snider Apr 15, 2026
4bbdb10
Harden StripTags against stray angle brackets
Snider Apr 15, 2026
871b295
fix(codegen): render template content safely
Snider Apr 15, 2026
dc5edcf
fix(path): tighten block id parsing
Snider Apr 15, 2026
1c2b2c5
feat(html): recurse attr through layout trees
Snider Apr 15, 2026
6369ec4
fix(codegen): align custom element validation with spec
Snider Apr 15, 2026
a02843a
fix(wasm): render empty slot content
Snider Apr 15, 2026
e95c059
Harden HTML tag stripping
Snider Apr 15, 2026
dd68c6d
feat(html): canonicalize compare variant keys
Snider Apr 15, 2026
57952b8
feat(html): harden recursive attr coverage
Snider Apr 15, 2026
9757d66
Harden Attr against typed nil wrappers
Snider Apr 15, 2026
3b29008
fix(html): stabilize nested layout block ids
codex Apr 15, 2026
0d361e5
fix(html): restore full tree and stabilize nested layout block ids
codex Apr 15, 2026
6e254de
Fix locale forwarding for translators
Snider Apr 15, 2026
2e7559b
chore(html): record RFC verification
Snider Apr 15, 2026
3a9a52d
chore: go mod tidy (module path migration)
Snider Apr 24, 2026
5747b62
fix(go-html): replace testify with stdlib testing patterns (AX-6)
Snider Apr 24, 2026
66ac5c5
chore(go-html): migrate module path to dappco.re/go/html
Snider Apr 24, 2026
f2ad72b
fix(go-html): remove banned reflect from context.go and node.go (AX-6)
Snider Apr 24, 2026
d58f1a1
chore(go-html): annotate html + strconv in node.go per AX-6
Snider Apr 24, 2026
2b9353e
chore(go-html): migrate stale core/{i18n,io,log,...} deps per AX-6
Snider Apr 24, 2026
b881d66
chore(go-html): migrate forge.lthn.ai indirect deps per AX-6
Snider Apr 24, 2026
91e935c
feat(ax-10): bring go-html to v0.8.0-alpha.1 + CLI test scaffold
Snider Apr 24, 2026
bf62c93
fix(html): purge banned os/os-signal/flag imports from cmd/codegen/ma…
Snider Apr 25, 2026
627a5b3
fix(html): AX-6 banned-import purge of strings in text_translate_args…
Snider Apr 25, 2026
80291a0
fix(html): AX-6 sweep on layout.go
Snider Apr 25, 2026
29c3c18
docs(html): document WASM/server boundary on shared package files (#372)
Snider Apr 25, 2026
6fc68dd
chore(go-html): close stale-fixed Mantis #615 — RFC.models.md not needed
Snider Apr 25, 2026
69d1cb1
chore(go-mlx): close stale-fixed Mantis #1026 — mlxlm section already…
Snider Apr 25, 2026
69ed7cd
fix(go-html): remove 4 banned imports from cmd/codegen/main.go
Snider Apr 25, 2026
57647a3
feat(go-html/api+wasm): scaffold provider + WASM build target (#1019)
Snider Apr 25, 2026
6152c55
feat(go-html): Entitled() gate per RFC §6 — pluggable EntitlementChec…
Snider Apr 25, 2026
860b5a2
feat(go-html): Shadow DOM codegen per RFC §5 — Web Component class em…
Snider Apr 25, 2026
28dd465
feat(go-html): GrammarImprint structural classifier per RFC §4 (#731 §4)
Snider Apr 25, 2026
e9ec57c
feat(go-html): WASM renderToString export per RFC §8 (#731 §8)
Snider Apr 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .core/build.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions .core/release.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.vscode/
*.log
.core/
dist/
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[![Go Reference](https://pkg.go.dev/badge/forge.lthn.ai/core/go-html.svg)](https://pkg.go.dev/forge.lthn.ai/core/go-html)
[![Go Reference](https://pkg.go.dev/badge/dappco.re/go/core/html.svg)](https://pkg.go.dev/dappco.re/go/core/html)
[![License: EUPL-1.2](https://img.shields.io/badge/License-EUPL--1.2-blue.svg)](LICENSE.md)
[![Go Version](https://img.shields.io/badge/Go-1.26-00ADD8?style=flat&logo=go)](go.mod)

# go-html

HLCRF DOM compositor with grammar pipeline integration for server-side HTML generation and optional WASM client rendering. Provides a type-safe node tree (El, Text, Raw, If, Each, Switch, Entitled, AriaLabel, AltText), a five-slot Header/Left/Content/Right/Footer layout compositor with deterministic `data-block` path IDs and ARIA roles, a responsive multi-variant wrapper, a server-side grammar pipeline (StripTags, GrammarImprint via go-i18n reversal, CompareVariants), a build-time Web Component codegen CLI, and a WASM module (2.90 MB raw, 842 KB gzip) exposing `renderToString()`.
HLCRF DOM compositor with grammar pipeline integration for server-side HTML generation and optional WASM client rendering. Provides a type-safe node tree (El, Text, Raw, If, Each, Switch, Entitled, AriaLabel, AltText, TabIndex, AutoFocus, Role), a five-slot Header/Left/Content/Right/Footer layout compositor with deterministic `data-block` path IDs and ARIA roles, a responsive multi-variant wrapper, a server-side grammar pipeline (StripTags, GrammarImprint via go-i18n reversal, CompareVariants), a build-time Web Component codegen CLI with optional TypeScript declarations, and a WASM module (2.90 MB raw, 842 KB gzip) exposing `renderToString()`.

**Module**: `forge.lthn.ai/core/go-html`
**Module**: `dappco.re/go/core/html`
**Licence**: EUPL-1.2
Comment on lines +1 to 10
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README still references dappco.re/go/core/html (badge + module line), but go.mod declares module dappco.re/go/html. Update README to the correct module path to avoid broken pkg.go.dev links and copy/paste imports.

Copilot uses AI. Check for mistakes.
**Language**: Go 1.25
**Language**: Go 1.26

## Quick Start

```go
import "forge.lthn.ai/core/go-html"
import html "dappco.re/go/core/html"

Comment on lines 15 to 17
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick Start import uses dappco.re/go/core/html, but the module path in go.mod is dappco.re/go/html. This example won't compile as written; update the import path (and any other occurrences) to match go.mod.

Copilot uses AI. Check for mistakes.
page := html.NewLayout("HCF").
H(html.El("nav", html.Text("i18n.label.navigation"))).
Expand Down
28 changes: 7 additions & 21 deletions SESSION-BRIEF.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Repo**: `forge.lthn.ai/core/go-html` (clone at `/tmp/core-go-html`)
**Module**: `forge.lthn.ai/core/go-html`
**Status**: 19 Go files, 1,591 LOC, 53 tests ALL PASS
**Status**: Current tests pass; WASM build is within budget and codegen emits JS plus TypeScript defs
**Wiki**: https://forge.lthn.ai/core/go-html/wiki (6 pages)

## What This Is
Expand All @@ -12,19 +12,19 @@ HLCRF DOM compositor with grammar pipeline. Renders semantic HTML from composabl
- **HLCRF Layout**: Header/Left/Content/Right/Footer with ARIA roles
- **Responsive**: Multi-variant breakpoint rendering
- **Pipeline**: Render → strip tags → tokenise via go-i18n/reversal → GrammarImprint
- **WASM target**: `cmd/wasm/` exposes renderToString() and registerComponents() to JS
- **Codegen**: Web Component classes with closed Shadow DOM
- **WASM target**: `cmd/wasm/` exposes `renderToString()` to JS
- **Codegen**: Web Component classes with closed Shadow DOM plus `.d.ts` generation

## Current State

| Area | Status |
|------|--------|
| Core (node, layout, responsive, pipeline) | SOLID — all tested, clean API |
| Tests | 53/53 pass, excellent coverage ratios |
| Tests | Passing |
| go vet | Clean |
| TODOs/FIXMEs | None |
| WASM build | FAILS1.58 MB gzip exceeds 1 MB Makefile limit |
| Codegen | Working — generates WC classes |
| WASM build | PASSwithin the 1 MB gzip gate |
| Codegen | Working — generates WC classes and `.d.ts` definitions |

## Dependencies

Expand All @@ -34,21 +34,7 @@ HLCRF DOM compositor with grammar pipeline. Renders semantic HTML from composabl

## Priority Work

### High (blockers)
1. **Fix WASM size** — Move `buildComponentJS()` / JSON parsing to server-side. WASM should only do `Render()`. Current: 6.0 MB raw / 1.58 MB gzip.
2. **WASM integration tests** — No `cmd/wasm/main_test.go` exists. Can't test JS↔Go round-trip.

### Medium (completeness)
3. **Performance benchmarks** — No `BenchmarkRender()` or `BenchmarkImprint()`. Add them.
4. **TypeScript type definitions** — Codegen only produces JS. Add `.d.ts` generation for WC bundle.
5. **Accessibility helpers** — Layout has semantic HTML + ARIA roles, but no aria-label builder or alt text helpers.
6. **Layout variant validation** — `NewLayout("XYZ")` silently produces empty output. Could warn.

### Low (hardening)
7. **Unicode/RTL edge cases** — Test emoji, RTL text in Text nodes
8. **Deep nesting stress test** — Circular or very deep Layout nesting
9. **Large Each[T]** — Test with thousands of items
10. **Browser polyfill docs** — Closed Shadow DOM support matrix
No active blockers recorded here. See `docs/history.md` for the remaining design choices and deferred ideas that were captured during earlier implementation phases.

## File Map

Expand Down
11 changes: 11 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'

tasks:
wasm:build:
desc: Build the browser/Node/Deno render WASM module.
env:
GOWORK: off
GOFLAGS: -mod=readonly
cmds:
- mkdir -p dist
- GOOS=js GOARCH=wasm go build -o dist/render.wasm ./cmd/wasm/
2 changes: 1 addition & 1 deletion bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package html
import (
"testing"

i18n "dappco.re/go/core/i18n"
i18n "dappco.re/go/i18n"
)

func init() {
Expand Down
Loading
Loading