feat(std/html): add Html.trusted and style over EmbeddedText.text() #486

Merged
argus merged 3 commits from loop/93-trusted-style into main 2026-10-26 02:20:55 +00:00
Collaborator

Part of #93 (not Closes: one acceptance item is left, see below).

What this adds, after #135 landed the compiler side of embedding:

  • std/resource: the embeddedText native and EmbeddedText.text() (the declaration was missing although the lowering generates the table).
  • std/html: Html.trusted(file: EmbeddedText) (the only way to write raw markup) and style(sheet: EmbeddedText) (the only <style>), with tests and fixtures in std/html/tests.
  • Docs: docs/standard-library/html.md (escaping table rows for <style> and raw markup, declaration), resource.md, the WEB.md slice 1 status, regenerated skills/.

Still open for #93: the measured html-render ratio in docs/PERFORMANCE.md. It needs a native benchmark run (sh benchmarks/run.sh html-render) on main, which needs a C compiler and the nightly/dispatch benchmarks workflow; the loop cannot trigger it. Everything else in the acceptance criteria is covered.

Note: torb docs declarations --check could not run locally (the available nightly torb predates the embeddedText native); the two declaration blocks were edited by hand to match the source order, forge CI is the check.

Part of #93 (not `Closes`: one acceptance item is left, see below). What this adds, after #135 landed the compiler side of embedding: - `std/resource`: the `embeddedText` native and `EmbeddedText.text()` (the declaration was missing although the lowering generates the table). - `std/html`: `Html.trusted(file: EmbeddedText)` (the only way to write raw markup) and `style(sheet: EmbeddedText)` (the only `<style>`), with tests and fixtures in `std/html/tests`. - Docs: `docs/standard-library/html.md` (escaping table rows for `<style>` and raw markup, declaration), `resource.md`, the WEB.md slice 1 status, regenerated `skills/`. Still open for #93: the measured html-render ratio in `docs/PERFORMANCE.md`. It needs a native benchmark run (`sh benchmarks/run.sh html-render`) on main, which needs a C compiler and the nightly/dispatch benchmarks workflow; the loop cannot trigger it. Everything else in the acceptance criteria is covered. Note: `torb docs declarations --check` could not run locally (the available nightly torb predates the `embeddedText` native); the two declaration blocks were edited by hand to match the source order, forge CI is the check.
Part of #93. EmbeddedText.text() declares the embeddedText native of std/resource (RESOURCES.md slice 2). Checkpoint: not yet built in CI; docs, WEB.md status and skills still to do.
docs(std/html): document Html.trusted, style and EmbeddedText.text()
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 5m12s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 5m22s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m57s
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
78c7bdae67
orion requested review from argus 2026-10-25 23:11:55 +00:00
fix(std/html): name the type argument of Html.trusted and escape the brace in the style test
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m19s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m23s
ci / every host emits the same C (pull_request) Successful in 4m52s
ci / the playground (torb as WebAssembly) (pull_request) Failing after 14s
ci / tier A (linux-x64) (pull_request) Successful in 24m56s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
5b9acdabd2
orion force-pushed loop/93-trusted-style from 5b9acdabd2
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m19s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m23s
ci / every host emits the same C (pull_request) Successful in 4m52s
ci / the playground (torb as WebAssembly) (pull_request) Failing after 14s
ci / tier A (linux-x64) (pull_request) Successful in 24m56s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to 1d9d27672d
All checks were successful
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
images / cr.torb.dev/torbscript/site:edge (main) (push) Successful in 14m10s
ci / tier A (linux-x64) (pull_request) Successful in 26m23s
ci / every host emits the same C (pull_request) Successful in 5m7s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m20s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
ci / commit messages (push) Successful in 6s
ci / what the change touches (push) Successful in 6s
pdisc / pdisc (push) Successful in 13s
ci / which runners exist (push) Successful in 1s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
ci / bootstrap (linux-x64) (push) Successful in 4m4s
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been skipped
ci / the VS Code extension (editors/vscode) (push) Successful in 13s
ci / tier A (linux-x64) (push) Successful in 24m10s
ci / tools/release-sync and tools/registry (linux-x64) (push) Successful in 2m22s
ci / tier B (linux-x64) (push) Successful in 13m40s
ci / pack the seed (push) Has been skipped
ci / the playground (torb as WebAssembly) (push) Successful in 2m16s
ci / every host emits the same C (push) Successful in 4m57s
ci / archives (push) Has been skipped
ci / gates (push) Successful in 0s
2026-10-26 00:02:33 +00:00
Compare
argus approved these changes 2026-10-26 02:20:54 +00:00
argus left a comment

Checklist on 1d9d276:

  • Tests: ok. Two new tests in std/html/tests/markup.test.trb (trusted markup passes unescaped, style writes a sheet into <style>) with fixtures; CI green for this head (tier A, bootstrap, gates, pdisc).
  • Correctness: ok. EmbeddedText.text() goes through the generated embeddedText native; Html.trusted and style only accept EmbeddedText, so a String cannot bypass escaping.
  • Scope: ok. Matches the stated part of #93; the open benchmark item is named in the body and the WEB.md status is adjusted to say so.
  • Security: ok. No secrets, no new dependencies or external requests; the raw-markup path is limited to package files read at build time.
  • Data/Release: n/a.
  • Docs: ok. html.md (escaping table, declaration), resource.md, WEB.md and regenerated skills updated; pdisc green.

Non-blocking:

  • The two hand-edited declaration blocks were not checked locally; the forge CI is green, so they match.
  • Two long lines in resource.md (the added sentence after "the next two.") are not wrapped like the rest of the paragraph.
  • Remember the html-render ratio in docs/PERFORMANCE.md to close #93.
Checklist on 1d9d276: - Tests: ok. Two new tests in `std/html/tests/markup.test.trb` (trusted markup passes unescaped, `style` writes a sheet into `<style>`) with fixtures; CI green for this head (tier A, bootstrap, gates, pdisc). - Correctness: ok. `EmbeddedText.text()` goes through the generated `embeddedText` native; `Html.trusted` and `style` only accept `EmbeddedText`, so a `String` cannot bypass escaping. - Scope: ok. Matches the stated part of #93; the open benchmark item is named in the body and the WEB.md status is adjusted to say so. - Security: ok. No secrets, no new dependencies or external requests; the raw-markup path is limited to package files read at build time. - Data/Release: n/a. - Docs: ok. html.md (escaping table, declaration), resource.md, WEB.md and regenerated skills updated; pdisc green. Non-blocking: - The two hand-edited declaration blocks were not checked locally; the forge CI is green, so they match. - Two long lines in `resource.md` (the added sentence after "the next two.") are not wrapped like the rest of the paragraph. - Remember the html-render ratio in `docs/PERFORMANCE.md` to close #93.
argus merged commit 1d9d27672d into main 2026-10-26 02:20:55 +00:00
argus deleted branch loop/93-trusted-style 2026-10-26 02:20:55 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!486
No description provided.