Skip to content

Releases

v2.0.1

Choose a tag to compare

@github-actions github-actions released this 26 Oct 12:19
8e8ba7a

A patch release. No public item and no rendered output changed, so there is nothing to migrate.

Changed

  • GETTING_STARTED.md and its Portuguese edition list the constructors whose name is not the
    tag, main_tag(), html_tag() and label_for(id), with the reason for each and a doctest
    that renders them (#151). Documentation only: no public item or output changed.
  • The release pipeline's pinned actions moved to crates-io-auth-action 1.0.6,
    install-action 2.87.30 and rust-cache 2.9.3 (#148, #149, #150), and Dependabot now opens
    its pull requests against develop (#152). None of this is in the published crate.

Fixed

  • A doc comment of Debug for Element linked to a private constant, which broke the rustdoc
    build for GitHub Pages (-D warnings). The published crate and docs.rs were not affected,
    but the 2.0.0 source still carried the comment; 2.0.1 is the first release without it
    (#147). scripts/verify.sh now builds the rustdoc the same way.

Install

[dependencies]
molt-framework = "2.0.1"

The library is imported as molt: use molt::prelude::*;

What's Changed

Full Changelog: v2.0.0...v2.0.1

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 23:50
5bb7d4e

A major release. The public API only grows: no public item was removed or changed, and the
new ones are listed under Added. The rendered output and the runtime behaviour change in
three places, on purpose: text() and raw_text() append in call order, clean() needs the
.molt-output marker, and Debug stops at 128 levels. Each is under Breaking, Security or
Fixed below, with its row in MIGRATION.md (1.x to 2.0.0).

Breaking

  • Element::text and Element::raw_text append at the position of the call instead of
    replacing a content slot that always rendered before the children. p().child(x).text(y)
    now renders y after x, and calling text twice renders both (#110). A row in
    MIGRATION.md's Output changes table.
  • StaticSiteGenerator::clean only empties a directory that is missing, empty, or holds the
    .molt-output marker. Writing a page or an asset leaves the marker, so a site Molt built
    keeps working; a dist made before 2.0.0, or by anything else, is refused once with
    SsgError::UnsafeCleanTarget (#115). A row in MIGRATION.md.

Security

  • clean() with a relative path no longer empties the ./dist of whatever directory the
    process runs from: the output directory has to carry the marker. A symbolic link as the
    output directory is refused too (#115).

Added

  • scripts/check-changelog.sh, step 8 of scripts/verify.sh: fails when a public item
    added since the last release tag is not named in [Unreleased]. The CI verify job now
    fetches the tags for it (#134).
  • Document::html_attr and Document::html_attrs: attributes on <html> after lang
    (data-theme, dir, class), written the same by render, render_compact, render_to
    and root(). Document gains the public field html_attributes (#111).
  • SeoBuilder setters robots, viewport, canonical, alternate (repeatable, x-default
    included), locale, locale_alternate, image_size, image_alt, theme_color and
    color_scheme. Each tag is written only when its setter is called, in a fixed order, so
    a builder that does not call them renders what it did before (#112).
  • StaticSiteGenerator::copy_dir and copy_dir_where: copy a directory tree into the output
    directory, atomically per file, with a name filter. Symbolic links in the source are skipped
    and the output directory is never copied into itself. Returns the number of files (#113).
  • ssg::OUTPUT_MARKER, the name of that file.
  • SitemapUrl::alternate(hreflang, href) and the public field alternates: other-language
    versions written as <xhtml:link rel="alternate">. xmlns:xhtml is declared only when one
    is written; a pair with a non-http(s) URL or a malformed language tag is left out (#114).
  • Element::find, Element::find_all and Node::find, Node::find_all: search a tree for
    elements by tag, in document order, with an explicit stack and without cloning; and
    Element::attribute(name), the value as written into the markup. For asserting on a built
    tree in a test. There is no text_content: text is stored escaped, so it would have to
    return markup, and find(..).render() already says that (#116).
  • preload_font(href): <link rel="preload" as="font" …> that always carries crossorigin
    (per the web platform, without it the font is fetched twice; not exercised by the tests)
    and takes type from the extension (#128).
  • Element::csp_hash: the sha256-… hash of what a <script> or <style> holds, for a
    Content-Security-Policy that lists inline content instead of allowing 'unsafe-inline'.
    SHA-256 and base64 are written in the crate, so there is still no dependency (#127).
  • StaticSiteGenerator::copy_asset_hashed(from, dir): copies a file to dir/name.<hash>.ext
    (64-bit FNV-1a of the content) and returns the URL, so CSS and JS can be cached for a year
    without serving a stale copy after a rebuild. It renames one file and rewrites no import
    or url(...); the doc says how to work with that (#126).
  • .github/workflows/fuzz.yml: the four fuzz targets run every night and on demand, on
    nightly Rust with a pinned cargo-fuzz, with the corpus kept between runs and a crashing
    input uploaded as an artifact. It is outside the pull-request gate, so a red run never blocks
    a merge. scripts/fuzz.sh now runs every target even after one fails (#91).

Fixed

  • Debug for Node and Element no longer aborts the process on a deeply nested tree. It
    was a derive that recursed once per level, so {:?} and the failure message of
    assert_eq! on a 100,000-level tree overflowed the stack. It is now written by hand, prints
    what the derive printed down to 128 levels, and writes ... below that (#79).

Documentation

  • The official Claude Code skill, using-molt-framework, is documented in the README (and its
    pt-BR copy), docs/agents.md and llms.txt: its repository is
    molt-framework-skill, installed with
    /plugin marketplace add and /plugin install, or with npx skills add. It is submitted to
    Anthropic's plugin directory and waiting for review.
  • The README, its pt-BR copy, the getting-started guides, SECURITY.md, CONTRIBUTING.md
    and ROADMAP.md describe 2.0: install lines say "2.0", the feature lists name the new
    APIs, 1.x stops receiving fixes, and the roadmap is the 2.x line. MIGRATION.md has one
    section for 1.x to 2.0.0 (output changes, clean() and the marker, what is new).
  • docs/capabilities.md, docs/pitfalls.md, docs/agents.md and llms.txt, which ship in
    the published crate (the .claude/ notes do not): is there an API for X by version and what
    is out of scope on purpose, the symptom-to-fix tables, a block to paste into a project's
    AGENTS.md, and an index in the llmstxt.org format. scripts/check-knowledge-base.sh checks
    that they are in cargo package --list and that their links resolve (#135).
  • The official site, https://www.molt-framework.io, is linked from Cargo.toml (homepage,
    so crates.io shows it), the READMEs, the getting-started guides and the crate documentation
    (#117).
  • docs/performance.md (and docs/pt-BR/performance.md): a checklist for shipping a fast
    site built with Molt. Each item says whether it was measured by the site's author, is
    general web behaviour, or is run as a doc test here (#129).

Install

[dependencies]
molt-framework = "2.0.0"

The library is imported as molt: use molt::prelude::*;

What's Changed

Full Changelog: v1.1.1...v2.0.0

v1.1.1

Choose a tag to compare

@github-actions github-actions released this 22 Oct 03:39
8f8db91

A documentation release. The public API and the rendered output do not change; the
README on crates.io and the guides on docs.rs do.

Documentation

  • docs/new-to-rust.md: a walkthrough for someone who has never used Rust (install, cargo new,
    cargo add, cargo run, writing a page to disk and opening it), with a table of the errors a
    newcomer hits. GETTING_STARTED.md and README.md now cover a new project and an existing
    one separately, and say how to run the snippets. The Axum example in README.md is now a
    complete program (it was missing the Document import and the axum/tokio dependencies).
  • Portuguese (pt-BR) translations of README.md, GETTING_STARTED.md and
    docs/new-to-rust.md in docs/pt-BR/. The English files stay the reference; the translated
    GETTING_STARTED.md is a doc test too, so its snippets cannot drift from the API.

Install

[dependencies]
molt-framework = "1.1.1"

The library is imported as molt: use molt::prelude::*;

What's Changed

Full Changelog: v1.1.0...v1.1.1

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 03:20
22dbdab

A minor release: new form helpers. Nothing in the existing public API or in rendered output
changes.

Added

  • Form helpers, the low-level shapes for form-heavy pages: select_named, select_from,
    select_multiple_from, options_from (one <option> per (value, label) pair from any
    iterator, with the selected value marked), option_valued, optgroup_labeled,
    textarea_named, checkbox_named, radio_named, hidden_input (the shape of a CSRF
    field, with whatever name the framework expects) and fieldset_legend. Values and labels
    are escaped on entry like everything else.
    (#94)

Security

  • crates.io now requires Trusted Publishing for every new version of molt-framework, and the
    CARGO_REGISTRY_TOKEN repository secret is deleted. 1.0.1 was the first release published
    through the OIDC path (#77).

Documentation

  • The repository is organised as a Claude Code project. AGENTS.md is the map; the rules
    live in .claude/rules/, one file per topic and scoped to the files they govern, with
    code-style.md and git-workflow.md loaded in every session; the recipes are slash
    commands in .claude/commands/ (/verify, /add-element, /fix-bug, /review,
    /security-audit, /golden, /lesson, /release); three read-only reviewers live in
    .claude/agents/. scripts/check-knowledge-base.sh also checks the links, the paths:
    globs and the tables in AGENTS.md. Nothing in the crate changes.
  • A new logo: an isometric paper stack shedding its top sheet, with the feather, on the
    paper tile of the design system (molt-logo.png). It replaces molt-logo.jpg in the
    README and is now the rustdoc logo and favicon (html_logo_url, html_favicon_url).

Install

[dependencies]
molt-framework = "1.1.0"

The library is imported as molt: use molt::prelude::*;

What's Changed

  • Docs: estado final da publicação (Trusted Publishing obrigatório, sem secret) by @micheltlutz in #102
  • Docs: organiza o repositório como projeto Claude (rules, commands, agents) by @micheltlutz in #103
  • Add: helpers de formulário (select, options, textarea, hidden input, checkbox, radio, fieldset) by @micheltlutz in #104
  • Release 1.1.0 by @micheltlutz in #105
  • Release 1.1.0 para main by @micheltlutz in #106

Full Changelog: v1.0.1...v1.1.0

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 19 Oct 15:26
04c2997

A patch release: nothing in the public API or in rendered output changes.

Security

  • The release workflow publishes through crates.io Trusted Publishing
    (rust-lang/crates-io-auth-action, OIDC, id-token: write on the publish job only). The
    token exists for one job and is revoked at its end; the long-lived CARGO_REGISTRY_TOKEN
    repository secret is no longer read and is being retired (#77).

Documentation

  • The html! syntax table shows the string-key form for hyphenated attribute names
    ("data-id" = x, "hx-post" = …), which the macro already accepted; a test pins its parity
    with the builder (#93).
  • README gains Serving the output: how to return a page from Axum or any other framework
    without a feature or a dependency in the crate. ROADMAP.md records that framework
    integrations and async streaming are deliberately not planned (#92, #95).

Install

[dependencies]
molt-framework = "1.0.1"

The library is imported as molt: use molt::prelude::*;

What's Changed

Full Changelog: v1.0.0...v1.0.1

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 19:32
c18f33c

The 1.0.0 hardening release. Everything under Breaking needs a change in code that
calls the API; MIGRATION.md shows each one, before and after. Issue
numbers are in micheltlutz/molt.

Breaking

  • Node is #[non_exhaustive], and Node::Text, Node::Raw and Node::Comment hold a
    Markup, a string with no public constructor. Node::Text("<script>".into()) no longer
    compiles; build nodes with Node::text (escapes), Node::comment (neutralises) and
    Node::raw (the greppable hatch). A match on Node needs a _ arm.
    (#13,
    #14)
  • #[non_exhaustive] on Role, A11yIssue, RenderOptions, Document, SitemapUrl,
    RssItem and RssGenerator: build them with their constructors, not struct literals.
  • RenderOptions::indent is private. Read it with indent(); with_indent keeps only
    spaces and tabs, at most 16. (#28)
  • Layout::render and Layout::render_many are wrap and wrap_many, because they
    collided with Render::render. (#18)
  • escape_text, escape_text_with_slashes, escape_attribute and escape_xml return
    Cow<str>
    , borrowed when nothing needed escaping.
    (#21)
  • VOID_TAGS and WHITESPACE_SENSITIVE_TAGS are &[&str], not arrays with a length.
    (#16)
  • SitemapUrl::changefreq takes a ChangeFreq instead of text; priority is clamped to
    0.0..=1.0. (#20)
  • StaticSiteGenerator returns SsgError, not io::Error. It converts into
    io::Error, so ? in a function returning io::Result still works.
    (#19)
  • WASM: child, addHead and addBody take their element by value, which consumes
    the JavaScript handle; using it afterwards throws null pointer passed to rust.
    (#23)
  • The parallel feature implies ssg. (#22)

Security

Output now differs in the cases below, on purpose; each is also a row in the Output changes
table of MIGRATION.md.

  • Comments can no longer close early. Node::comment("x--->") used to leave a -->
    that ended the comment and let the rest through as markup. (#2)
  • Tag names are validated. Element::new("img src=x onerror=alert(1)") was written
    verbatim, also from JavaScript through new WElement(str). An element whose tag is not a
    letter followed by letters, digits, -, _, . or : is not rendered.
    (#3)
  • < and > in attribute values are escaped under raw-text ancestors (noscript,
    iframe, xmp, noembed, noframes, script, style, plaintext), where
    </noscript> inside an alt ended the parent. Elsewhere the byte-for-byte output is
    unchanged. (#5)
  • meta_name, meta_property, meta_charset and meta_http_equiv escape their
    values.
    (#4)
  • StaticSiteGenerator: refuses symlinks on the way, paths that name no file ("",
    ., a/) and Windows drive prefixes; writes through unique temporary files (two pages
    with the same stem used to share one); copy_asset no longer deletes before it copies;
    clean refuses ., the working directory and its ancestors, $HOME and top-level
    directories. (#6,
    #7,
    #8)
  • URL policy: also covers ping, manifest, longdesc and, per candidate, srcset;
    srcdoc is written empty unless trusted_url; on iframe, frame, embed and object
    a data: URL passes only if it is a raster image. is_blocked_in(tag, …) is the new
    tag-aware form. (#25)
  • XML: escape_xml drops the characters XML 1.0 cannot hold; a sitemap <loc> or feed
    <link> that is not an absolute http(s) URL is left out; isPermaLink="true" is written
    only for an http(s) guid. (#27)
  • RenderOptions::with_max_depth drops elements nested deeper than a limit, which is what
    bounds pretty output (quadratic in depth). (#28)
  • CI and release: every action pinned to a commit SHA, read-only default token,
    persist-credentials: false, job timeouts, and a release that refuses a tag that is not
    on main or has no green CI run. (#29)

Fixed

  • Document::render, accessibility::audit, Node::is_empty, Clone, PartialEq and
    Hash recursed once per level and aborted the process on a deep tree that the renderer
    handled. All are iterative now, tested at 100,000 levels.
    (#9,
    #10,
    #11) Debug is still recursive.
  • SECURITY.md and the WASM docs described a 256-level limit and a function name that did
    not exist. (#12)

Added

  • Markup, SsgError, ChangeFreq and ParseChangeFreqError.
  • seo::json_ld, seo::script_json and escape_json_script: JSON that is safe inside a
    <script>, where HTML escaping would corrupt it and no escaping would let </script>
    through. WASM jsonLd. (#26)
  • Element::from_static, RenderOptions::{indent, with_max_depth},
    core::tags::is_valid_tag_name, core::url_policy::{is_http_url, is_blocked_in},
    sitemap::{MAX_URLS, MAX_BYTES, SitemapGenerator::chunks}.
  • Trait impls: Display for Node, Element and Document ({:#} pretty-prints);
    Hash; Default for Document; FromIterator for Node; Extend for Element;
    From<Vec<Node>>, From<Option<T>> and From<char> for Node; Render for &T,
    Box<T> and Option<T>. (#17)
  • WASM: WDocument.addSeo, WDocument.renderWithOptions, and on WElement addClasses,
    rawChild, selfClosing, renderWithOptions and renderBytes.
    (#24)
  • .claude/skills/molt: a knowledge base for agents (security, Rust practice, performance,
    design patterns, governance, a decision log) whose lessons name the tests that guard them;
    scripts/check-knowledge-base.sh checks that those still exist.
  • tests/allocations.rs pins allocation counts and type sizes; the benchmarks run at
    opt-level = 3 and no longer time the Drop.

Changed

  • Tag names and attribute keys are Cow<'static, str> internally; div() makes no
    allocation. Element::new and Attribute::new still take impl Into<String>.
    (#15)

  • html! formats interpolated values straight into their escaped form: 40% faster to
    build, with the same tree.

  • Escapers copy the clean stretches between special characters in one step: prose-like text
    is about twice as fast, and text where every other character needs escaping about 2.8×
    slower (still ~400 MB/s).

  • Attribute::raw is documented as one of the three escape hatches, with the reason.

  • The published crate leaves out development tooling: rust-toolchain.toml (it made rustup
    install a wasm target and extra components for anyone building inside the unpacked tarball),
    AGENTS.md, CLAUDE.md, clippy.toml, rustfmt.toml, deny.toml and codecov.yml. The
    tests run from the extracted tarball: 480 pass.

  • core::url_policy::is_http_url no longer ignores leading whitespace. It is an allow list
    used to decide what a sitemap or feed may link to, and a reader that does not trim would
    read "\thttps://…" as a relative path.

  • CI builds the documentation the way docs.rs does (nightly, every feature, --cfg docsrs).

  • CI now tests the minimum supported Rust version for real. The 1.85 legs of the test
    matrix had been running on stable: the repository's rust-toolchain.toml overrides the
    toolchain the setup action installs. They now set RUSTUP_TOOLCHAIN and fail if rustc is
    not the version asked for. The claim held (all tests pass on 1.85.1), but nothing had proved it.

  • tests/invariants.rs: property tests that run the escapers, the URL policy, the tag and
    attribute writers, the XML generators and the static site generator on tens of thousands of
    hostile inputs per run, from a fixed seed, on every platform.

Not changed, deliberately

panic = "abort", the three HTML/XML escapers, escape_attribute leaving < and > alone
outside raw-text ancestors, and the golden fixtures. Four tests were added after the fact
because they were claimed but missing (#57).

Install

[dependencies]
molt-framework = "1.0.0"

The library is imported as molt: use molt::prelude::*;

What's Changed

  • Docs: README linka o crates.io, remove Brand e cita o port 3.0.1 by @micheltlutz in #43
  • Fix: comentário não fecha mais com ---> (S1) by @micheltlutz in #44
  • Fix: nome de tag inválido não é mais escrito no HTML (S2) by @micheltlutz in #45
  • Fix: < e > em atributos são escapados sob ancestrais raw-text (S4) by @micheltlutz in htt...
Read more

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 15:40

Renamed

  • winged-rust is now Molt. The crate is published as molt-framework (molt on
    crates.io is an unrelated project) and imported as molt::. The WebAssembly files are
    molt.js / molt_bg.wasm, and the repository moved to
    micheltlutz/molt. WINGED_UPDATE_FIXTURES is now
    MOLT_UPDATE_FIXTURES and WINGED_WASM_BUDGET_KB is MOLT_WASM_BUDGET_KB. Issue links
    below still point to the winged-rust repository, where those issues live.

Removed

  • The npm package. The wasm feature and scripts/build-wasm.sh stay; the build now goes
    to pkg/{web,node,bundler} and is not published.

Added

  • URL policy, checked when the tree is written. href, src, action, formaction,
    poster, cite, background, xlink:href and data render as # when the value is a
    javascript:, vbscript: or data:text/html URL. The check decodes character references
    once, so Attribute::raw("href", "javascript&#58;alert(1)") is blocked, while a value
    passed through Attribute::new keeps its escaped &amp;. Attribute::trusted_url,
    Element::trusted_url and WElement.trustedUrl opt out. An attribute name that contains
    a space, quote, =, <, >, / or a control character is not emitted.
  • Element::self_closing(true) closes a non-void tag with > or /> and drops its
    children, so a self-closing tag does not have to be built as Node::Raw (which would
    skip the URL policy).
  • Document::render_to writes the same bytes as render_with, one body section at a time.
    StaticSiteGenerator::generate uses it, into the existing temporary file.
  • overflow-checks in the release profile, cargo deny, and a libFuzzer script
    (scripts/fuzz.sh) that is outside the pull-request gate. unwrap and expect are
    denied in library code.

Changed

  • The release workflow verifies (including cargo publish --dry-run) in a job with no
    registry token, then publishes from a fresh build with cargo publish --locked --no-verify, reading the CARGO_REGISTRY_TOKEN repository secret. CI runs the same
    dry run on every push.

Install

[dependencies]
molt-framework = "0.1.0"

The library is imported as molt: use molt::prelude::*;

What's Changed

  • Bump codecov/codecov-action from 6 to 7 by @dependabot[bot] in #1

New Contributors

Full Changelog: https://github.com/micheltlutz/molt/commits/v0.1.0