Repository navigation
Releases
v2.0.1
A patch release. No public item and no rendered output changed, so there is nothing to migrate.
Changed
GETTING_STARTED.mdand its Portuguese edition list the constructors whose name is not the
tag,main_tag(),html_tag()andlabel_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-action1.0.6,
install-action2.87.30 andrust-cache2.9.3 (#148, #149, #150), and Dependabot now opens
its pull requests againstdevelop(#152). None of this is in the published crate.
Fixed
- A doc comment of
Debug for Elementlinked 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.shnow 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
- Merge main em develop (após a 2.0.0) by @micheltlutz in #144
- Fix: link de rustdoc para item privado quebrava o build do GitHub Pages by @micheltlutz in #145
- Fix: rustdoc do GitHub Pages (develop em main) by @micheltlutz in #146
- Build(deps): Bump rust-lang/crates-io-auth-action from 1.0.5 to 1.0.6 by @dependabot[bot] in #148
- Build(deps): Bump taiki-e/install-action from 2.87.29 to 2.87.30 by @dependabot[bot] in #149
- Build(deps): Bump Swatinem/rust-cache from 2.9.2 to 2.9.3 by @dependabot[bot] in #150
- Change: Dependabot passa a abrir PRs contra develop by @micheltlutz in #152
- Docs: guia lista os construtores cujo nome não é a tag by @micheltlutz in #153
- Update: versão 2.0.1 by @micheltlutz in #154
- Release 2.0.1 (develop em main) by @micheltlutz in #155
Full Changelog: v2.0.0...v2.0.1
v2.0.0
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::textandElement::raw_textappend at the position of the call instead of
replacing a content slot that always rendered before the children.p().child(x).text(y)
now rendersyafterx, and callingtexttwice renders both (#110). A row in
MIGRATION.md's Output changes table.StaticSiteGenerator::cleanonly empties a directory that is missing, empty, or holds the
.molt-outputmarker. Writing a page or an asset leaves the marker, so a site Molt built
keeps working; adistmade before 2.0.0, or by anything else, is refused once with
SsgError::UnsafeCleanTarget(#115). A row inMIGRATION.md.
Security
clean()with a relative path no longer empties the./distof 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 ofscripts/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_attrandDocument::html_attrs: attributes on<html>afterlang
(data-theme,dir,class), written the same byrender,render_compact,render_to
androot().Documentgains the public fieldhtml_attributes(#111).SeoBuildersettersrobots,viewport,canonical,alternate(repeatable,x-default
included),locale,locale_alternate,image_size,image_alt,theme_colorand
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_dirandcopy_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 fieldalternates: other-language
versions written as<xhtml:link rel="alternate">.xmlns:xhtmlis 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_allandNode::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 notext_content: text is stored escaped, so it would have to
return markup, andfind(..).render()already says that (#116).preload_font(href):<link rel="preload" as="font" …>that always carriescrossorigin
(per the web platform, without it the font is fetched twice; not exercised by the tests)
and takestypefrom the extension (#128).Element::csp_hash: thesha256-…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 todir/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 noimport
orurl(...); 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 pinnedcargo-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.shnow runs every target even after one fails (#91).
Fixed
DebugforNodeandElementno 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.mdandllms.txt: its repository is
molt-framework-skill, installed with
/plugin marketplace addand/plugin install, or withnpx 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
andROADMAP.mddescribe 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.mdhas 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.mdandllms.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.shchecks
that they are incargo package --listand 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(anddocs/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
- Update: back-merge da 1.1.1 em develop by @micheltlutz in #109
- Fix: text() e raw_text() anexam na ordem da chamada by @micheltlutz in #118
- Add: Document::html_attr e html_attrs by @micheltlutz in #119
- Add: setters do SeoBuilder para site multilíngue by @micheltlutz in #120
- Add: StaticSiteGenerator::copy_dir e copy_dir_where by @micheltlutz in #121
- Fix: clean() só esvazia um diretório que o Molt fez by @micheltlutz in #123
- Add: SitemapUrl::alternate para hreflang no sitemap by @micheltlutz in #122
- Add: Element::find, find_all, attribute e Node::find, find_all by @micheltlutz in #124
- Docs: citar o site oficial www.molt-framework.io by @micheltlutz in #125
- Add: preload_font, o preload de fonte que já sai com crossorigin by @micheltlutz in #130
- Add: Element::csp_hash para <script> e <style> sob CSP estrita by @micheltlutz in #131
- Add: StaticSiteGenerator::copy_asset_hashed by @micheltlutz in #132
- Docs: guia de desempenho para sites feitos com o Molt by @micheltlutz in #133
- Fix: Debug de Node e Element não aborta mais em árvore muito funda by @micheltlutz in #136
- Add: workflow noturno de fuzzing by @micheltlutz in #137
- Fix: restaura as entradas perdidas do CHANGELOG e checa que não se percam by @micheltlutz in #138
- Docs: o que um projeto consumidor lê vai dentro do pacote publicado by @micheltlutz in #139
- Docs: README, ROADMAP, MIGRATION e demais documentos para a 2.0.0 by @micheltlutz in #140
- Docs: a skill oficial do Molt (molt-framework-skill) e como instalá-la by @micheltlutz in #141
- Update: versão 2.0.0 by @micheltlutz in #142
- Release 2.0.0: develop em main by @micheltlutz in #143
Full Changelog: v1.1.1...v2.0.0
v1.1.1
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.mdandREADME.mdnow cover a new project and an existing
one separately, and say how to run the snippets. The Axum example inREADME.mdis now a
complete program (it was missing theDocumentimport and theaxum/tokiodependencies).- Portuguese (pt-BR) translations of
README.md,GETTING_STARTED.mdand
docs/new-to-rust.mdindocs/pt-BR/. The English files stay the reference; the translated
GETTING_STARTED.mdis 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
- Docs: guia para quem nunca usou Rust, exemplo Axum completo e tradução pt-BR by @micheltlutz in #107
- Update: versão 1.1.1 by @micheltlutz in #108
Full Changelog: v1.1.0...v1.1.1
v1.1.0
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) andfieldset_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_TOKENrepository 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.mdis the map; the rules
live in.claude/rules/, one file per topic and scoped to the files they govern, with
code-style.mdandgit-workflow.mdloaded 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.shalso checks the links, thepaths:
globs and the tables inAGENTS.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 replacesmolt-logo.jpgin 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
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: writeon the publish job only). The
token exists for one job and is revoked at its end; the long-livedCARGO_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.mdrecords 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
- Docs: README objetivo, integração com Axum sem acoplamento, atributos com hífen no html! by @micheltlutz in #97
- Docs: roadmap registra #78 como não planejada by @micheltlutz in #98
- Change: release publica no crates.io via Trusted Publishing (#77) by @micheltlutz in #99
- Release 1.0.1 by @micheltlutz in #100
- Release 1.0.1 para main by @micheltlutz in #101
Full Changelog: v1.0.0...v1.0.1
v1.0.0
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
Nodeis#[non_exhaustive], andNode::Text,Node::RawandNode::Commenthold a
Markup, a string with no public constructor.Node::Text("<script>".into())no longer
compiles; build nodes withNode::text(escapes),Node::comment(neutralises) and
Node::raw(the greppable hatch). AmatchonNodeneeds a_arm.
(#13,
#14)#[non_exhaustive]onRole,A11yIssue,RenderOptions,Document,SitemapUrl,
RssItemandRssGenerator: build them with their constructors, not struct literals.RenderOptions::indentis private. Read it withindent();with_indentkeeps only
spaces and tabs, at most 16. (#28)Layout::renderandLayout::render_manyarewrapandwrap_many, because they
collided withRender::render. (#18)escape_text,escape_text_with_slashes,escape_attributeandescape_xmlreturn
Cow<str>, borrowed when nothing needed escaping.
(#21)VOID_TAGSandWHITESPACE_SENSITIVE_TAGSare&[&str], not arrays with a length.
(#16)SitemapUrl::changefreqtakes aChangeFreqinstead of text;priorityis clamped to
0.0..=1.0. (#20)StaticSiteGeneratorreturnsSsgError, notio::Error. It converts into
io::Error, so?in a function returningio::Resultstill works.
(#19)- WASM:
child,addHeadandaddBodytake their element by value, which consumes
the JavaScript handle; using it afterwards throwsnull pointer passed to rust.
(#23) - The
parallelfeature impliesssg. (#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 throughnew 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 analtended the parent. Elsewhere the byte-for-byte output is
unchanged. (#5)meta_name,meta_property,meta_charsetandmeta_http_equivescape 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_assetno longer deletes before it copies;
cleanrefuses., the working directory and its ancestors,$HOMEand top-level
directories. (#6,
#7,
#8)- URL policy: also covers
ping,manifest,longdescand, per candidate,srcset;
srcdocis written empty unlesstrusted_url; oniframe,frame,embedandobject
adata:URL passes only if it is a raster image.is_blocked_in(tag, …)is the new
tag-aware form. (#25) - XML:
escape_xmldrops the characters XML 1.0 cannot hold; a sitemap<loc>or feed
<link>that is not an absolutehttp(s)URL is left out;isPermaLink="true"is written
only for anhttp(s)guid. (#27) RenderOptions::with_max_depthdrops 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
onmainor has no green CI run. (#29)
Fixed
Document::render,accessibility::audit,Node::is_empty,Clone,PartialEqand
Hashrecursed 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)Debugis still recursive.SECURITY.mdand the WASM docs described a 256-level limit and a function name that did
not exist. (#12)
Added
Markup,SsgError,ChangeFreqandParseChangeFreqError.seo::json_ld,seo::script_jsonandescape_json_script: JSON that is safe inside a
<script>, where HTML escaping would corrupt it and no escaping would let</script>
through. WASMjsonLd. (#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:
DisplayforNode,ElementandDocument({:#}pretty-prints);
Hash;DefaultforDocument;FromIteratorforNode;ExtendforElement;
From<Vec<Node>>,From<Option<T>>andFrom<char>forNode;Renderfor&T,
Box<T>andOption<T>. (#17) - WASM:
WDocument.addSeo,WDocument.renderWithOptions, and onWElementaddClasses,
rawChild,selfClosing,renderWithOptionsandrenderBytes.
(#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.shchecks that those still exist.tests/allocations.rspins allocation counts and type sizes; the benchmarks run at
opt-level = 3and no longer time theDrop.
Changed
-
Tag names and attribute keys are
Cow<'static, str>internally;div()makes no
allocation.Element::newandAttribute::newstill takeimpl 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::rawis 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.tomlandcodecov.yml. The
tests run from the extracted tarball: 480 pass. -
core::url_policy::is_http_urlno 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.85legs of the test
matrix had been running on stable: the repository'srust-toolchain.tomloverrides the
toolchain the setup action installs. They now setRUSTUP_TOOLCHAINand fail ifrustcis
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...
v0.1.0
Renamed
- winged-rust is now Molt. The crate is published as
molt-framework(molton
crates.io is an unrelated project) and imported asmolt::. The WebAssembly files are
molt.js/molt_bg.wasm, and the repository moved to
micheltlutz/molt.WINGED_UPDATE_FIXTURESis now
MOLT_UPDATE_FIXTURESandWINGED_WASM_BUDGET_KBisMOLT_WASM_BUDGET_KB. Issue links
below still point to the winged-rust repository, where those issues live.
Removed
- The npm package. The
wasmfeature andscripts/build-wasm.shstay; the build now goes
topkg/{web,node,bundler}and is not published.
Added
- URL policy, checked when the tree is written.
href,src,action,formaction,
poster,cite,background,xlink:hrefanddatarender as#when the value is a
javascript:,vbscript:ordata:text/htmlURL. The check decodes character references
once, soAttribute::raw("href", "javascript:alert(1)")is blocked, while a value
passed throughAttribute::newkeeps its escaped&.Attribute::trusted_url,
Element::trusted_urlandWElement.trustedUrlopt 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 asNode::Raw(which would
skip the URL policy).Document::render_towrites the same bytes asrender_with, one body section at a time.
StaticSiteGenerator::generateuses it, into the existing temporary file.overflow-checksin the release profile,cargo deny, and a libFuzzer script
(scripts/fuzz.sh) that is outside the pull-request gate.unwrapandexpectare
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 withcargo publish --locked --no-verify, reading theCARGO_REGISTRY_TOKENrepository 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
- @dependabot[bot] made their first contribution in #1
Full Changelog: https://github.com/micheltlutz/molt/commits/v0.1.0