docs: document trailing-apostrophe DSL naming (html', class', type')#77
Open
IvanTheGeek wants to merge 1 commit into
Open
docs: document trailing-apostrophe DSL naming (html', class', type')#77IvanTheGeek wants to merge 1 commit into
IvanTheGeek wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
type html()inFun.Blazor/DslCore.fs— clarifies that thestatic class does not represent the
<html>element and cross-referenceshtml'. Surfaces in IntelliSense on hover.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.[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 draftinga fork plan around adding one — before noticing that
html'already ships atDslElementBuilder.generated.fs:799. The convention is well-establishedinternally (
class',type') andhtml'is even already used inDocs/40 Advanced/80 Htmx/README.md, but it isn't surfaced on the obviousdiscovery paths: the top-level README, or the doc summary on the static
htmlclass that a new user first encounters via
html.inject/html.raw. Thispatch 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 acrossnet6.0 / net8.0 / net9.0, 0 warnings, 0 errors.
🤖 Generated with Claude Code