Split facet-html-dom from facet-html (issue #1529) - #1580
Merged
Conversation
fasterthanlime
force-pushed
the
split-html-dom-1529
branch
from
January 3, 2026 06:42
0b0d220 to
a825a59
Compare
Due to Rust limitation rust-lang/rust#52234, macro-exported attributes cannot be referenced from the same crate. This meant facet-html's DOM types had to use `#[facet(xml::elements)]` instead of `#[facet(html::elements)]`. This commit splits the DOM types into a new `facet-html-dom` crate that depends on `facet-html`, allowing proper use of the `html::` namespace: - Created `facet-html-dom` crate with all HTML element types - DOM types now use `#[facet(html::elements)]`, `#[facet(html::attribute)]`, and `#[facet(html::text)]` instead of the xml:: equivalents - Updated facet-html to remove the elements module - Updated all tests to use `facet_html_dom` directly Users should now use `facet_html_dom::{Html, Div, ...}` for typed HTML elements.
fasterthanlime
force-pushed
the
split-html-dom-1529
branch
from
January 3, 2026 06:43
a825a59 to
098307a
Compare
fasterthanlime
enabled auto-merge
January 3, 2026 06:46
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
Splits the HTML DOM element types into a new
facet-html-domcrate so they can properly use the#[facet(html::elements)]attribute namespace instead of falling back to#[facet(xml::elements)].Fixes #1529
Changes
facet-html-dom: Contains all typed HTML5 element definitions (Html,Head,Body,Div,Span, etc.)html::attributes:#[facet(html::elements)]for child element collections#[facet(html::attribute)]for HTML attributes#[facet(html::text)]for text contentfacet-html: Now contains only the parser, serializer, and attribute grammarfacet_html_domdirectlyWhy the split?
Due to Rust limitation rust-lang/rust#52234, macro-exported attributes cannot be referenced by absolute path from within the same crate. By moving DOM types to a separate crate that depends on
facet-html, they can properly use thehtml::namespace.Migration
Users should update imports:
Test plan
html::attributes (129 occurrences, 0xml::references)