Skip to content

upgrade: deep package upgrade for Solid 2.0#914

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

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

Conversation

@davedbase
Copy link
Copy Markdown
Member

@davedbase davedbase commented May 22, 2026

Dependencies**

  • Peer deps bumped to solid-js@^2.0.0-beta.13 and @solidjs/web@^2.0.0-beta.13
  • Store APIs (createStore, reconcile, snapshot) moved from solid-js/storesolid-js
  • isServer moved from solid-js/web@solidjs/web

trackStore — rewritten to fix two correctness bugs present in the old implementation:

  • Now correctly subscribes to getter properties by accessing values through the store proxy (previously getters were skipped, so signals read inside them were never tracked)
  • Correctly rejects plain object wrappers around stores ({ myStore: store } is not itself a store, so it's a no-op — pojo: false behaviour is preserved)

trackDeeptraverse parameter typed as unknown instead of Store<T>, which is the correct type for a function that does runtime type-checking and recurses into untyped children

store-updates

  • unwrapsnapshot; createRootrunWithOwner(null, ...) for detached lazy memos
  • DEV warning now only fires for non-store arguments client-side, not on every server-side call
  • Warning message corrected from stale name createStoreDeltacaptureStoreUpdates
  • All unnecessary type assertions removed (as Static, signal!, as any on already-any nodes)
  • Inline comments added throughout explaining the algorithm, invariants, and non-obvious implementation choices

Tests

  • All effects converted to split compute/apply form
  • batch() removed; flush() added after mutations
  • unwrapsnapshot; store setters converted to draft form
  • reconcile calls in tests replaced with direct draft mutations (beta.13 requires a key function argument, which these tests didn't need)

README — all examples updated to split createEffect, draft setters, and `snapshot

Summary by CodeRabbit

Release Notes

  • Breaking Changes

    • Migrated @solid-primitives/deep to Solid.js v2.0 (beta.13). Updated peer dependency requirements and API patterns including import sources, store utilities, and effect usage.
  • Documentation

    • Updated README examples to reflect new Solid v2 patterns and best practices for tracking and capturing store updates.

Review Change Stack

@davedbase davedbase added this to the Solid 2.0 Migration milestone May 22, 2026
@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: 33a413b0-305a-4e95-9e5d-26685ba5de6f

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
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The PR title 'upgrade: deep package upgrade for Solid 2.0' accurately describes the main changeset, which upgrades the deep package from Solid v1 to v2 across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

🦋 Changeset detected

Latest commit: 67f7efc

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/deep 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

@davedbase davedbase marked this pull request as ready for review May 22, 2026 14:45
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 (2)
.changeset/deep-solid2-migration.md (1)

17-17: 💤 Low value

Consider rephrasing for clarity.

The phrase "required split compute/apply form" is slightly awkward. Consider one of these alternatives for better readability:

  • "updated to use the split compute/apply form"
  • "updated to the required split-form compute/apply pattern"
🤖 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 @.changeset/deep-solid2-migration.md at line 17, Update the changelog line
that mentions `createEffect` to improve readability by rephrasing "updated to
required split compute/apply form" to one of the clearer alternatives, e.g.,
"updated to use the split compute/apply form" or "updated to the required
split-form compute/apply pattern"; locate the `createEffect` mention in the
.changeset entry and replace the phrase accordingly.
packages/deep/package.json (1)

64-69: ⚡ Quick win

Update Solid.js beta pins in packages/deep/package.json (beta.13 vs latest beta)

  • npm shows no stable solid-js@2.0.0/@solidjs/web@2.0.0; solid-js “next” is 2.0.0-beta.14 (and @solidjs/web next matches).
  • 2.0.0-beta.13 still exists, but 2.0.0-beta.14 is the newer 2.0 beta—consider bumping both solid-js and @solidjs/web to 2.0.0-beta.14.
  • Security advisory found for solid-js only applies to versions < 1.9.4 (patched in 1.9.4); none returned that implicates 2.0.0-beta.13 or @solidjs/web.
🤖 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/deep/package.json` around lines 64 - 69, The package.json pins for
the Solid.js packages are out of date; update both occurrences of "`@solidjs/web`"
and "solid-js" (in "dependencies" and "devDependencies") from "2.0.0-beta.13" to
"2.0.0-beta.14" so the project uses the newer 2.0 beta; ensure you change the
string values for the keys "`@solidjs/web`" and "solid-js" in
packages/deep/package.json to "2.0.0-beta.14".
🤖 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/deep/src/store-updates.ts`:
- Around line 173-180: Guard the use of the in-operator by checking that store
is a non-null object before testing $TRACK: change the condition to first verify
typeof store === "object" && store !== null (e.g. if (!(typeof store ===
"object" && store !== null && $TRACK in store))). Update the branch that
currently uses ($TRACK in store) so it only runs when that object guard passes,
leaving the DEV console.warn, init flag and the fallback return behavior
(init/[] closure) unchanged; use the same identifiers store and $TRACK to locate
the code.

In `@packages/deep/test/track.test.ts`:
- Around line 307-315: The test's compute callbacks are returning function
references instead of invoking them, so no dependencies are registered; update
the createEffect calls to invoke the functions: change the first createEffect
callback from () => fn to () => fn() (calling fn), and ensure the other compute
callback actually calls api.fn with the tracked value (use () => api.fn(a) or ()
=> { api.fn(a); } so it invokes api.fn rather than returning a reference).
Target the createEffect calls around sign.a and api.fn to make the effects
establish dependencies.

---

Nitpick comments:
In @.changeset/deep-solid2-migration.md:
- Line 17: Update the changelog line that mentions `createEffect` to improve
readability by rephrasing "updated to required split compute/apply form" to one
of the clearer alternatives, e.g., "updated to use the split compute/apply form"
or "updated to the required split-form compute/apply pattern"; locate the
`createEffect` mention in the .changeset entry and replace the phrase
accordingly.

In `@packages/deep/package.json`:
- Around line 64-69: The package.json pins for the Solid.js packages are out of
date; update both occurrences of "`@solidjs/web`" and "solid-js" (in
"dependencies" and "devDependencies") from "2.0.0-beta.13" to "2.0.0-beta.14" so
the project uses the newer 2.0 beta; ensure you change the string values for the
keys "`@solidjs/web`" and "solid-js" in packages/deep/package.json to
"2.0.0-beta.14".
🪄 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: 8a83ec67-f0f5-4d0f-92c9-45e8ef00b73a

📥 Commits

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

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .changeset/deep-solid2-migration.md
  • packages/deep/README.md
  • packages/deep/package.json
  • packages/deep/src/store-updates.ts
  • packages/deep/src/track-deep.ts
  • packages/deep/src/track-store.ts
  • packages/deep/test/track.test.ts
  • packages/deep/test/updates.test.ts

Comment thread packages/deep/src/store-updates.ts Outdated
Comment thread packages/deep/test/track.test.ts
@davedbase davedbase changed the title upgrade: match package upgrade for Solid 2.0 upgrade: deep package upgrade for Solid 2.0 May 22, 2026
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