Merge adjacent sibling templates in a fragment into one template
Author: ryansolidCreated Aug 25, 2026Updated Sep 10, 2026
Labelsenhancement
Moved from ryansolid/dom-expressions#458.
A fragment of adjacent static siblings compiles to one template() per root:
<>
<div />
<button type="button">hi</button>
</>var _tmpl$ = _$template(`<div>`),
_tmpl$2 = _$template(`<button type=button>hi`);Those could be a single template string (and one clone) when nothing dynamic sits between them. Reported by @milomg; playground: https://playground.solidjs.com/anonymous/6f9638af-453b-4841-b8cd-76ea1c4fc15a
Source: solidjs/solid