solidjs / solidjs/solid

Merge adjacent sibling templates in a fragment into one template

Open
#3,055 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
36.1k
Forks
1.1k
Avg merge
9h 18m
Merged PRs (30d)
195

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the linked Solid playground example as the starting reproduction and inspect the compilation path that produces the shown _$template calls. Done means adjacent static sibling roots produce one template and one clone, while dynamic content remains separated.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.