Skip to content

sld-dom-expressions#478

Open
danielrkling wants to merge 8 commits intoryansolid:nextfrom
danielrkling:next
Open

sld-dom-expressions#478
danielrkling wants to merge 8 commits intoryansolid:nextfrom
danielrkling:next

Conversation

@danielrkling
Copy link

@danielrkling danielrkling commented Nov 18, 2025

[Discord discussion] (https://discordapp.com/channels/722131463138705510/1394408373176369202)

Overview

Goals:

  • Provide an alternative to current html tagged template literals to more closely match JSX for no-build
  • Avoid using a RegExp parser to prevent parsing edge cases.

Main Differences to html

  • Components are registered by string to an instance of the sld template.
  • Component tags are closed with instead of <//>

Future Tooling Opportunities

Development Notes

Template Setup (Cached)

  1. Templates gets parsed into JSX-like AST.
  2. Loop through AST to build template elements for any root node or component node with element children with the same tree structure. Static attributes are applied to the template and removed from AST. Holes and Components locations are marked with Comment Nodes.
  3. AST and template elements get cached per template literal.

Template Run

  1. Template is cloned.
  2. Clone is walked though in sync with the AST. (Text Nodes skipped)
  3. Dynamic properties are collected from AST and applied via spread.
  4. When insert or component Comment nodes are hit, they are applied with insert

Performance

  • 1.25 in js-framework-benchmark (Compiled Solid ~ 1.10)

@trusktr
Copy link
Contributor

trusktr commented Jan 26, 2026

Using the html5parser adds bundle size. Using DOMParser wouldn't. However html mode is case-insensitive, which requires some additional processing of templates. xml mode is case-sensitive.

I'm more in favor of leaning on the platform. But I think @ryansolid it's really up to you exactly which direction you are ok with.

@titoBouzout
Copy link
Contributor

titoBouzout commented Feb 7, 2026

ok, this is a list of every issue in solid/dom-expressions related to the tagged template feature.

Some would become obsolete/fixed by this PR, but there are a bunch that would require testing/test cases. Im dealing with some unrelated PRs right now, if nobody does it first I will eventually get to this.

@danielrkling danielrkling marked this pull request as draft February 18, 2026 01:11
@danielrkling danielrkling marked this pull request as ready for review February 18, 2026 02:04
@titoBouzout
Copy link
Contributor

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.

3 participants

Comments