Skip to content

fix(solid-query): allow both create/use syntax#10260

Merged
birkskyum merged 3 commits intomainfrom
allow-either-create/use-syntax
Mar 12, 2026
Merged

fix(solid-query): allow both create/use syntax#10260
birkskyum merged 3 commits intomainfrom
allow-either-create/use-syntax

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Mar 12, 2026

Query transitioned from create* to use* here:

It helped a lot with solid maintenance by aligning docs / api surface to vue/svelte/react, and ease of migration between frameworks. Unfortunately this is in some cases less solid-idiomatic (useIsFetching, useMutationState, useIsMutating, useIsRestoring - these return accessors), and even worse it ended up being breaking, because the type forwarding wasn't correctly configured, so some libraries had to pin query versions. Type forwarding since fixed here (thanks!), but deprecation warnings remained:

To make things just work, this PR allow both the use* syntax for ease of maintenance and migration from react, and the idiomatic create* syntax for existing users and for the idiomatic preference The PR drops the deprecation warnings so that both will work just fine, and add a few extra exports of create*.

cc @2wheeh

Summary by CodeRabbit

  • New Features
    • Solid Query now exposes both "create*" and "use*" naming for hooks and types, making APIs available under either convention for consistency and flexibility.
  • Documentation
    • Added a changeset entry noting a small fix to allow both create/use usage.

@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: e8ecdba

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

This PR includes changesets to release 3 packages
Name Type
@tanstack/solid-query Patch
@tanstack/solid-query-devtools Patch
@tanstack/solid-query-persist-client Patch

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
Contributor

coderabbitai bot commented Mar 12, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 924b510c-adc6-41b1-ba8f-e6adedb88e22

📥 Commits

Reviewing files that changed from the base of the PR and between d046865 and e8ecdba.

📒 Files selected for processing (1)
  • packages/solid-query/src/index.ts

📝 Walkthrough

Walkthrough

Adds a changeset and extends packages/solid-query/src/index.ts with numerous Create* type aliases for existing Use* types and runtime create* function aliases (including createQueryClient and createIsRestoring), plus export of IsRestoringProvider; removes deprecation-style comments.

Changes

Cohort / File(s) Summary
Changeset
.changeset/shiny-mails-help.md
New patch changeset entry noting support for both create and use naming conventions.
Solid Query index exports
packages/solid-query/src/index.ts
Added multiple Create* type aliases mapping to existing Use* types (e.g., CreateQueryOptions, CreateMutationResult, DefinedCreateQueryResult); added runtime aliases createIsFetching, createIsMutating, createMutationState, createQueryClient, createIsRestoring; exported IsRestoringProvider; removed deprecated-style comments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I dug a little tunnel in code so neat,

Now create and use both share the seat.
Aliases hopping, tidy and bright,
I nibble on bugs and nap in the light. 😊

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides comprehensive context about the change, including historical background and motivation, but lacks required checklist items from the template. Complete the required checklist items (Contributing guide confirmation and test verification) and explicitly confirm changeset generation status.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: allowing both create and use syntax in solid-query, which directly corresponds to the PR's objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch allow-either-create/use-syntax

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.

@nx-cloud
Copy link

nx-cloud bot commented Mar 12, 2026

View your CI Pipeline Execution ↗ for commit e8ecdba

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 59s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-12 11:56:18 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 12, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10260

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10260

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10260

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10260

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10260

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10260

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10260

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10260

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10260

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10260

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10260

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10260

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10260

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10260

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10260

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10260

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10260

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10260

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10260

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10260

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10260

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10260

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10260

commit: d39953e

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

size-limit report 📦

Path Size
react full 11.92 KB (0%)
react minimal 8.95 KB (0%)

@birkskyum birkskyum merged commit 5303191 into main Mar 12, 2026
5 of 6 checks passed
@birkskyum birkskyum deleted the allow-either-create/use-syntax branch March 12, 2026 11:57
@github-actions github-actions bot mentioned this pull request Mar 12, 2026
@github-actions
Copy link
Contributor

🎉 This PR has been released!

Thank you for your contribution!

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