Skip to content

Heddle v2.0#29

Merged
multiarc merged 1 commit into
mainfrom
feature/lang_asmt
Jul 19, 2026
Merged

Heddle v2.0#29
multiarc merged 1 commit into
mainfrom
feature/lang_asmt

Conversation

@multiarc

Copy link
Copy Markdown
Owner

Heddle 2.0

Forms the 2.0.0 release: the full v2 language and tooling effort, merged as a single
breaking window per the breaking-windows policy.
Merge to main, tag v2.0.0, release. Full details in the CHANGELOG;
the as-shipped window record is in docs/spec/records.md.

Highlights

  • Native expression tier — a sandbox-safe, Roslyn-free expression language in call
    parens (@if(Count > 0), @(Price * Quantity)), compiled to
    System.Linq.Expressions; new TemplateOptions.ExpressionMode
    (MemberPathsOnly / Native (default) / FullCSharp).
  • Safe-by-default HTML outputOutputProfile.Html encodes the unnamed @(...);
    @raw opts out, @profile flips mid-document; pluggable TemplateOptions.Encoder
    with byte-identical default; context encoders @attr / @js / @url.
  • Declarative branching@elif / @else / @ifnot via the public
    Scope.Publish/TryRead channel and [BranchRole]; custom extensions can join
    branch sets.
  • Loop & directive ergonomics@for(5) / @for(range(...)), @list,
    TrimDirectiveLines.
  • Named props & slots — typed definition parameters with defaults, parameterized
    @out() slots, abstract composition and narrowing; positioned compile errors.
  • Streaming & UTF-8 sinksTextWriter and IBufferWriter<byte> render overloads
    with O(1)-allocation transcoding; render budgets for untrusted templates.
  • Build-time precompilationHeddle.Generator compiles .heddle templates at
    build time, byte-identical to the dynamic engine; positioned HED70xx build
    diagnostics; version-locked with the engine.
  • Tooling — stable HEDxxxx diagnostic IDs, LSP server + VS Code extension, v2 Ace
    grammar with in-browser demo, the heddle CLI (T4 successor), ten golden-asserted
    samples doubling as CI coverage.

Breaking changes (the 2.0 window)

  • OutputProfile default: TextHtml.
  • TrimDirectiveLines default: falsetrue.
  • Generator MSBuild defaults follow the engine (Html / true).
  • Heddle.Models.ForModel deleted → immutable Heddle.Models.Range struct; only
    rendered-byte effect is range stringification.
  • Legacy @import() removed — positioned HED4003 error naming @<< / @partial
    replacements.
  • AllowCSharp is [Obsolete] (still functional) — use ExpressionMode.
  • 1.x precompiled assemblies are rejected by the engine-version gate and fall back per
    PrecompiledMismatchPolicy; rebuild with the 2.0 generator.

Signed-off-by: Aliaksandr Kukrash <multiarc@gmail.com>
@multiarc
multiarc merged commit 8c57aaa into main Jul 19, 2026
27 checks passed
@multiarc
multiarc deleted the feature/lang_asmt branch July 20, 2026 08:55
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