Skip to content

upgrade: controlled-props package upgrade for Solid 2.0#934

Merged
davedbase merged 7 commits into
solidjs-community:nextfrom
davedbase:update/v2/controlled-props
Jun 9, 2026
Merged

upgrade: controlled-props package upgrade for Solid 2.0#934
davedbase merged 7 commits into
solidjs-community:nextfrom
davedbase:update/v2/controlled-props

Conversation

@davedbase

@davedbase davedbase commented Jun 8, 2026

Copy link
Copy Markdown
Member

Migrates @solid-primitives/controlled-props to Solid.js 2.0 beta.14, fixes several pre-existing bugs uncovered during the migration, adds new utilities, and adds Storybook stories.


Breaking Changes

  • Peer deps bumped — requires solid-js@^2.0.0-beta.14 and @solidjs/web@^2.0.0-beta.14
  • JSX type moved from solid-js to @solidjs/web
  • Batched writescreateControlledProp setters are now batched; call flush() from solid-js before reading updated values in tests
  • ownedWrite: true on the internal signal — required so setters can be called from within reactive scopes (component bodies, effects) without the SIGNAL_WRITE_IN_OWNED_SCOPE error

Bug Fixes

  • min/max/step silently ignoredNumberProp and RangeProp were constructed without forwarding options; fixed by extracting them before the return
  • SelectProp stale after setValue — the selected index was computed once with untrack at render time, so calling setValue after render had no visible effect; replaced with a reactive createMemo that tracks props.value()
  • createSignal type error — initial value now cast to Exclude<T, Function> to satisfy Solid 2.0's new function-form overload for derived signals

New Features

  • RangeProp — new exported component that renders a range slider (<input type="range">) with a live value readout; also accessible as a standalone component
  • step optionTestPropOptions now exposes step and forwards it to both NumberProp and `RangeProp

Summary by CodeRabbit

Release Notes

  • New Features

    • Added RangeProp component for range slider controls
    • Added step option to createControlledProp for discrete increments
  • Documentation

    • Updated README with structured examples, control type inference table, and component documentation
    • Added exported field components section
  • Tests

    • Extended test coverage for range slider and numeric option handling
  • Chores

    • Updated dependency versions for compatibility
    • Added Storybook stories for feature demonstrations

@davedbase davedbase added this to the Solid 2.0 Migration milestone Jun 8, 2026
@davedbase davedbase marked this pull request as ready for review June 8, 2026 22:37
@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a202c71

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/controlled-props 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

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

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: d877a8b5-4283-43ff-91b7-18e9fd444c93

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@packages/controlled-props/src/index.tsx`:
- Around line 113-122: The onChange handler can throw if options() is empty
because options()[ev.currentTarget.selectedIndex] may be undefined; update the
select's onChange in this component to guard that lookup (use a local const item
= options()[ev.currentTarget.selectedIndex]; if (!item) return or call
props.setValue with a safe default), so references to item[1] never access
undefined; touch the onChange closure that currently calls
props.setValue(options()[...][1]) and perform the existence check before
accessing the tuple element.
🪄 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: 0cba0acd-5d41-4574-ad25-061ee6b62d7b

📥 Commits

Reviewing files that changed from the base of the PR and between 48f3bbb and 0cdc2d5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .changeset/controlled-props-solid2-migration.md
  • packages/controlled-props/README.md
  • packages/controlled-props/dev/index.tsx
  • packages/controlled-props/package.json
  • packages/controlled-props/src/index.tsx
  • packages/controlled-props/stories/controlled-props.stories.tsx
  • packages/controlled-props/test/testProps.test.tsx
💤 Files with no reviewable changes (1)
  • packages/controlled-props/dev/index.tsx

Comment thread packages/controlled-props/src/index.tsx Outdated

@brenelz brenelz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@davedbase davedbase merged commit ce32f63 into solidjs-community:next Jun 9, 2026
@davedbase davedbase deleted the update/v2/controlled-props branch June 9, 2026 02:30
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.

2 participants