Skip to content

docs: document trailing-apostrophe DSL naming (html', class', type')#77

Open
IvanTheGeek wants to merge 1 commit into
slaveOftime:masterfrom
IvanTheGeek:claude/docs-html-element-ce-naming
Open

docs: document trailing-apostrophe DSL naming (html', class', type')#77
IvanTheGeek wants to merge 1 commit into
slaveOftime:masterfrom
IvanTheGeek:claude/docs-html-element-ce-naming

Conversation

@IvanTheGeek
Copy link
Copy Markdown

Summary

Documents the trailing-apostrophe DSL naming convention so users don't mistake
it for a library gap. No behavior changes, no API additions.

Three small additions:

  • XML doc on type html() in Fun.Blazor/DslCore.fs — clarifies that the
    static class does not represent the <html> element and cross-references
    html'. Surfaces in IntelliSense on hover.
  • README subsection — covers the apostrophe convention with the document
    root as a worked example, and names the specific F# compiler error
    (FS0501: The object constructor 'html' takes 0 argument(s) but is here given 1)
    a reader will hit if they reach for the bare html.
  • CHANGELOG entry under [Unreleased].

Why

While integrating Fun.Blazor 4.1.10 into an F# app, I (and an AI pair-programmer)
spent meaningful time treating <html> as a missing element CE — even drafting
a fork plan around adding one — before noticing that html' already ships at
DslElementBuilder.generated.fs:799. The convention is well-established
internally (class', type') and html' is even already used in
Docs/40 Advanced/80 Htmx/README.md, but it isn't surfaced on the obvious
discovery paths: the top-level README, or the doc summary on the static html
class that a new user first encounters via html.inject / html.raw. This
patch fixes that.

LLM-assisted authoring benefits especially: assistants default to the bare
element name and need the convention spelled out somewhere reachable to
recover from the FS0501 dead-end.

Test plan

  • dotnet build Fun.Blazor/Fun.Blazor.fsproj -c Release — clean across
    net6.0 / net8.0 / net9.0, 0 warnings, 0 errors.
  • No behavior changes; no tests added.

🤖 Generated with Claude Code

The static html class owns html.raw/inject/fragment helpers, so the
<html> element CE is bound as html' (apostrophe-escaped). class' /
type' follow the same convention for F#-keyword attribute names.
Bare `html { ... }` produces FS0501, which can be misread as a
library gap rather than a naming collision.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant