diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000000..0e32a8b571 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", + "changelog": [ + "@svitejs/changesets-changelog-github-compact", + { "repo": "TanStack/query" } + ], + "commit": false, + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "fixed": [], + "linked": [] +} diff --git a/.changeset/wise-numbers-double.md b/.changeset/wise-numbers-double.md new file mode 100644 index 0000000000..cd87bca9b1 --- /dev/null +++ b/.changeset/wise-numbers-double.md @@ -0,0 +1,5 @@ +--- +'@tanstack/query-core': patch +--- + +fix: allow partial query keys in `QueryFilters` diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 922ccaf298..0000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,46 +0,0 @@ -'package: angular-query-devtools-experimental': - - 'packages/angular-query-devtools-experimental/**/*' -'package: angular-query-experimental': - - 'packages/angular-query-experimental/**/*' -'package: eslint-plugin-query': - - 'packages/eslint-plugin-query/**/*' -'package: query-async-storage-persister': - - 'packages/query-async-storage-persister/**/*' -'package: query-broadcast-client-experimental': - - 'packages/query-broadcast-client-experimental/**/*' -'package: query-codemods': - - 'packages/query-codemods/**/*' -'package: query-core': - - 'packages/query-core/**/*' -'package: query-devtools': - - 'packages/query-devtools/**/*' -'package: query-persist-client-core': - - 'packages/query-persist-client-core/**/*' -'package: query-sync-storage-persister': - - 'packages/query-sync-storage-persister/**/*' -'package: react-query': - - 'packages/react-query/**/*' -'package: react-query-devtools': - - 'packages/react-query-devtools/**/*' -'package: react-query-next-experimental': - - 'packages/react-query-next-experimental/**/*' -'package: react-query-persist-client': - - 'packages/react-query-persist-client/**/*' -'package: solid-query': - - 'packages/solid-query/**/*' -'package: solid-query-devtools': - - 'packages/solid-query-devtools/**/*' -'package: solid-query-persist-client': - - 'packages/solid-query-persist-client/**/*' -'package: svelte-query': - - 'packages/svelte-query/**/*' -'package: svelte-query-devtools': - - 'packages/svelte-query-devtools/**/*' -'package: svelte-query-persist-client': - - 'packages/svelte-query-persist-client/**/*' -'package: vue-query': - - 'packages/vue-query/**/*' -'package: vue-query-devtools': - - 'packages/vue-query-devtools/**/*' -'documentation': - - 'docs/**/*' diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..11deb8f95f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +## 🎯 Changes + + + +## ✅ Checklist + +- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/query/blob/main/CONTRIBUTING.md). +- [ ] I have tested this code locally with `pnpm test:pr`. + +## 🚀 Release Impact + +- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md). +- [ ] This change is docs/CI/dev-only (no release). diff --git a/.github/renovate.json b/.github/renovate.json index 13f4da55d7..6bcdc1b427 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -20,7 +20,6 @@ "@types/node", "@types/react", "@types/react-dom", - "eslint-plugin-react-compiler", "node", "react", "react-dom", diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 107a3ef622..77127b1b9f 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -18,12 +18,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v5.0.0 + with: + fetch-depth: 0 - name: Setup Tools uses: tanstack/config/.github/setup@main - name: Fix formatting - run: pnpm prettier:write + run: pnpm run prettier:write - name: Apply fixes - uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef + uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 with: commit-message: 'ci: apply automated fixes' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index a271cb7e68..918ee80661 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -3,10 +3,15 @@ name: Labeler on: - pull_request_target +permissions: + contents: read + pull-requests: write + jobs: - triage: + labeler: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4.3.0 + - uses: actions/labeler@v5.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: labeler-config.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5ef53b56ce..a746fb0de5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,4 +1,4 @@ -name: pr +name: PR on: pull_request: @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v5.0.0 with: fetch-depth: 0 - name: Start Nx Agents @@ -30,11 +30,13 @@ jobs: - name: Setup Tools uses: tanstack/config/.github/setup@main - name: Get base and head commits for `nx affected` - uses: nrwl/nx-set-shas@v4.1.2 + uses: nrwl/nx-set-shas@v4.3.3 with: main-branch-name: main - name: Run Checks run: pnpm run test:pr --parallel=3 + - name: Verify Links + run: pnpm run verify-links - name: Stop Nx Agents if: ${{ always() }} run: npx nx-cloud stop-all-agents @@ -49,7 +51,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v5.0.0 with: fetch-depth: 0 - name: Setup Tools @@ -63,12 +65,12 @@ jobs: run: | echo "COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV - name: Preview Bundle Size - uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 + uses: marocchino/sticky-pull-request-comment@fd19551a2a7c0d29677c63257f86d8ef8bb24b48 with: message: | Sizes for commit ${{ env.COMMIT_SHA }}: | Branch | Bundle Size | |--------|--------| - | Main | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.0/jsx-runtime?target=es2022%22,%22react@^19.1.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.0/jsx-runtime?target=es2022%22,%22react@%5E19.1.0?target=es2022%22%5D%7D%7D) | - | This PR | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.0/jsx-runtime?target=es2022%22,%22react@^19.1.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.0/jsx-runtime?target=es2022%22,%22react@%5E19.1.0?target=es2022%22%5D%7D%7D) | + | Main | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.1/jsx-runtime?target=es2022%22,%22react@^19.1.1?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.1/jsx-runtime?target=es2022%22,%22react@%5E19.1.1?target=es2022%22%5D%7D%7D) | + | This PR | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.1/jsx-runtime?target=es2022%22,%22react@^19.1.1?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.1/jsx-runtime?target=es2022%22,%22react@%5E19.1.1?target=es2022%22%5D%7D%7D) | continue-on-error: true diff --git a/.github/workflows/ci.yml b/.github/workflows/release.yml similarity index 73% rename from .github/workflows/ci.yml rename to .github/workflows/release.yml index 466fa20d62..d2dfa41c73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,6 @@ -name: ci +name: Release on: - workflow_dispatch: - inputs: - tag: - description: override release tag - required: false push: branches: [main, alpha, beta, rc, v4] @@ -21,13 +16,13 @@ permissions: id-token: write jobs: - test-and-publish: - name: Test & Publish + release: + name: Release if: github.repository_owner == 'TanStack' runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v5.0.0 with: fetch-depth: 0 - name: Start Nx Agents @@ -39,16 +34,20 @@ jobs: - name: Stop Nx Agents if: ${{ always() }} run: npx nx-cloud stop-all-agents - - name: Publish + - name: Version Packages + run: pnpm run changeset:version + - name: Commit version files run: | git config --global user.name 'Tanner Linsley' - git config --global user.email 'tannerlinsley@users.noreply.github.com' - npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - pnpm run cipublish + git config --global user.email 'tannerlinsley@users.noreply.github.com' git add -A + git commit -m "ci: Version Packages" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish Packages + run: pnpm run changeset:publish env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - TAG: ${{ inputs.tag }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v4.6.0 with: diff --git a/.gitignore b/.gitignore index 454b506599..9ebc512a09 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ stats-hydration.json stats.json stats.html .vscode/settings.json +.vscode/mcp.json +.cursor/rules +.github/instructions/nx.instructions.md *.log *.tsbuildinfo diff --git a/.npmrc b/.npmrc index 84aee8d998..268c392d3c 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1 @@ -link-workspace-packages=true -prefer-workspace-packages=true provenance=true diff --git a/.nvmrc b/.nvmrc index 1d9b7831ba..b404027604 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22.12.0 +24.8.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ecdb0b86e3..2d90db264c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,8 @@ If you are here to suggest a feature, first create an issue if it does not alrea ## Development +_TanStack/query uses **symlink-based** configuration files. For smooth development in a local environment, we recommend developing in an environment that supports symlinks(ex: Linux, macOS, Windows Subsystem for Linux / WSL)._ + If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started: - Fork this repository. @@ -23,7 +25,7 @@ If you have been assigned to fix an issue or develop a new feature, please follo pnpm install ``` - - We use [pnpm](https://pnpm.io/) v9 for package management (run in case of pnpm-related issues). + - We use [pnpm](https://pnpm.io/) v10 for package management (run in case of pnpm-related issues). ```bash corepack enable && corepack prepare @@ -57,7 +59,7 @@ If you have been assigned to fix an issue or develop a new feature, please follo The documentations for all the TanStack projects are hosted on [tanstack.com](https://tanstack.com), which is a TanStack Start application (https://github.com/TanStack/tanstack.com). You need to run this app locally to preview your changes in the `TanStack/query` docs. > [!NOTE] -> The website fetches the doc pages from GitHub in production, and searches for them at `../query/docs` in development. Your local clone of `TanStack/query` needs to be in the same directory as the local clone of `TansStack/tanstack.com`. +> The website fetches the doc pages from GitHub in production, and searches for them at `../query/docs` in development. Your local clone of `TanStack/query` needs to be in the same directory as the local clone of `TanStack/tanstack.com`. You can follow these steps to set up the docs for local development: @@ -153,79 +155,9 @@ You can use Gitpod (An Online Open Source VS Code like IDE which is free for Ope [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/query) -## Commit message conventions - -`TanStack/query` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines). - -We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. - -### Commit Message Format - -Each commit message consists of a **header**, a **body** and a **footer**. The header has a special -format that includes a **type**, a **scope** and a **subject**: - -```text -(): - - - -