Skip to content

new: vibrate primitive for Solid 2.0#886

Open
davedbase wants to merge 1 commit intosolidjs-community:nextfrom
davedbase:v2/vibrate
Open

new: vibrate primitive for Solid 2.0#886
davedbase wants to merge 1 commit intosolidjs-community:nextfrom
davedbase:v2/vibrate

Conversation

@davedbase
Copy link
Copy Markdown
Member

New packages/vibrate package wrapping the Vibration API with six exports following the repo's make*/create* conventions

  • All primitives are SSR-safe (no-ops on server), peer-dependent on solid-js@^2.0.0-beta.10 and @solidjs/web@^2.0.0-beta.10
  • 31 tests passing (28 browser + 3 SSR), ESLint and tsc clean
  • createPulseuses a ~1000 ms multi-cycle chunk strategy: builds a pattern array covering ~1 second and re-queues it withsetInterval` at the exact chunk duration, so patterns join seamlessly without gaps
  • Both reactive primitives use the createEffect(compute, apply) split form and a plain boolean mirror (isVibrating / isPulsing) to avoid STRICT_READ_UNTRACKED warnings in Solid 2.0's dev mode
  • dutyCycle option (default 0.5) controls the on/off ratio within each pulse cycle — higher values produce longer buzzes, lower values produce shorter taps

@davedbase davedbase added enhancement New feature or request solid-2.0 labels May 8, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: fb1e4ad

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

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

@davedbase davedbase changed the base branch from main to next May 8, 2026 22:39
@davedbase davedbase marked this pull request as ready for review May 8, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request solid-2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant