solidjs / solidjs/solid

insert() should accept iterable collections, not only arrays

Open
#3,054 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#294.

insert only walks arrays. A custom iterable of nodes (anything with Symbol.iterator that is not an array) is skipped with Unrecognized value. Skipped inserting. That shows up from non-JS producers (e.g. Squint) that hand JSX a collection rather than Array.from(...).

This is still real. It was never taken because walking general iterables on the insert hot path has a cost, and For / other list helpers would need the same treatment to be consistent.

Leaving it here as an enhancement for 2.x rather than a 1.x fix.

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

Start at the insert implementation and compare its handling with For and other list helpers. Trace how a custom Symbol.iterator collection reaches insertion, then define completion as consistent iterable handling without regressing array behavior or overlooking the hot-path performance concern.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
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.