Skip to content

upgrade: range package upgrade for Solid 2.0#912

Open
davedbase wants to merge 4 commits into
solidjs-community:nextfrom
davedbase:update/v2/range
Open

upgrade: range package upgrade for Solid 2.0#912
davedbase wants to merge 4 commits into
solidjs-community:nextfrom
davedbase:update/v2/range

Conversation

@davedbase
Copy link
Copy Markdown
Member

@davedbase davedbase commented May 22, 2026

Solid 2.0 compatibility**

  • Bumped peer dependencies to solid-js@^2.0.0-beta.13 and @solidjs/web@^2.0.0-beta.13
  • isServer and JSX types now imported from @solidjs/web
  • indexRange internal signals marked ownedWrite: true via INTERNAL_OPTIONS — required because their setters are called from inside createMemo (the IndexRange component wrapper), which is an owned scope in Solid 2.0

Test suite updates

  • createComputed (removed in 2.0) replaced with split-form createEffect
  • Test signals created outside createRoot to avoid SIGNAL_WRITE_IN_OWNED_SCOPEcreateRoot is now an owned scope in beta.13
  • flush() added after signal writes, and again after mapped() calls in indexRange tests (internal setter writes are batched)
  • test/server.test.ts added

<Repeat> deprecation

<Repeat> is marked @deprecated in favour of the built-in <Repeat count={n}> from @solidjs/web. The README documents the migration path including the fallback and offset patterns. The underlying repeat primitive is not deprecated — it has unique incremental diffing behaviour the built-in lacks.

New: createNumericRange

A reactive number array generator modelled on Python's range():

createNumericRange(5)         // [0, 1, 2, 3, 4]
createNumericRange(2, 7)      // [2, 3, 4, 5, 6]
createNumericRange(0, 10, 2)  // [0, 2, 4, 6, 8]
createNumericRange(5, 0)      // [5, 4, 3, 2, 1]  — descending

const nums = createNumericRange(count); // reactive — pass signal, not value
<For each={nums()}>{n => <div>{n}</div>}</For>

Built on mapRange with the identity function, so it inherits incremental diffing. Designed as the idiomatic companion to Solid 2.0's built-in <For>.

Summary by CodeRabbit

  • New Features

    • Added createNumericRange helper for creating reactive numeric arrays with flexible range parameters
  • Breaking Changes

    • Updated to Solid.js v2.0-beta.13; peer dependencies now require solid-js and @solidjs/web v2.0.0-beta.13+
    • <Repeat> component deprecated; use Solid's built-in <Repeat count={n}> instead
    • Import paths updated for Solid 2 compatibility
  • Documentation

    • Updated README with Solid 2.0 API documentation and migration guidance

Review Change Stack

@davedbase davedbase added this to the Solid 2.0 Migration milestone May 22, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

🦋 Changeset detected

Latest commit: deb876c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solid-primitives/range Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cbefd81-68c1-44f0-979c-96c04e379d36

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@davedbase davedbase marked this pull request as ready for review May 22, 2026 12:54
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/range/README.md (1)

53-53: 💤 Low value

Fix heading level increment.

The #### Definition heading (h4) follows ## \createNumericRange`` (h2), skipping h3. Markdown heading levels should increment by one.

📝 Proposed fix
-#### Definition
+### Definition

Apply the same fix to other #### Definition headings at lines 77, 130, 159, 214, 250, and 304.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/range/README.md` at line 53, The README uses a level-4 heading "####
Definition" immediately after the level-2 heading "## `createNumericRange`",
skipping h3; update the heading levels so they increment by one (change each
"#### Definition" that directly follows a "## ..." section to "### Definition")
and apply the same fix to the other occurrences of "#### Definition" noted in
the file (any "#### Definition" headings that should be a subheading of the
preceding "## ..." section).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/range-solid2-migration.md:
- Line 16: The changeset text incorrectly marks both repeat and <Repeat> as
deprecated; update the sentence so only <Repeat> is described as deprecated
while making clear that the repeat primitive remains supported for incremental
child creation/disposal (keep the pointer to the README for migration guidance).
Locate the sentence that mentions both "repeat" and "<Repeat>" and rewrite it to
deprecate only "<Repeat>" and explicitly state that "repeat" continues to be
supported for cases requiring incremental child creation/disposal.

In `@packages/range/README.md`:
- Line 15: The TOC entry for `<Repeat>` points to `#repeat-1` which doesn't
match the actual heading `## \`<Repeat>\` ⚠️ Deprecated` (which GitHub will turn
into a different fragment); fix by either updating the TOC link to the actual
fragment for that heading or change the heading to a predictable fragment (e.g.,
`## \`<Repeat>\`` or `## Repeat — Deprecated` removing the emoji/extra
characters) and keep the deprecation note in the section body so the anchor
becomes `#repeat` (or update the link to the exact generated fragment) to
restore the broken link.

---

Nitpick comments:
In `@packages/range/README.md`:
- Line 53: The README uses a level-4 heading "#### Definition" immediately after
the level-2 heading "## `createNumericRange`", skipping h3; update the heading
levels so they increment by one (change each "#### Definition" that directly
follows a "## ..." section to "### Definition") and apply the same fix to the
other occurrences of "#### Definition" noted in the file (any "#### Definition"
headings that should be a subheading of the preceding "## ..." section).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d788ff95-5a4b-45a8-a147-75dc7f2bc528

📥 Commits

Reviewing files that changed from the base of the PR and between 8e8ff1e and aadd223.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .changeset/range-solid2-migration.md
  • packages/range/README.md
  • packages/range/package.json
  • packages/range/src/createNumericRange.ts
  • packages/range/src/index.ts
  • packages/range/src/indexRange.ts
  • packages/range/src/mapRange.ts
  • packages/range/src/repeat.ts
  • packages/range/test/createNumericRange.test.ts
  • packages/range/test/indexRange.test.ts
  • packages/range/test/mapRange.test.ts
  • packages/range/test/repeat.test.ts
  • packages/range/test/server.test.ts

Comment thread .changeset/range-solid2-migration.md Outdated
Comment thread packages/range/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant