Skip to content

Commit 5e9f958

Browse files
authored
Merge branch 'main' into issues/8499
2 parents 2f69183 + 2121836 commit 5e9f958

File tree

700 files changed

+19098
-15308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

700 files changed

+19098
-15308
lines changed

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
- name: Fix formatting
2525
run: pnpm prettier:write
2626
- name: Apply fixes
27-
uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
27+
uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
2828
with:
2929
commit-message: 'ci: apply automated fixes'

.github/workflows/pr.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414

1515
permissions:
1616
contents: read
17+
pull-requests: write
1718

1819
jobs:
1920
test:
@@ -57,3 +58,17 @@ jobs:
5758
run: pnpm run build:all
5859
- name: Publish Previews
5960
run: pnpx pkg-pr-new publish --pnpm --compact './packages/*' --template './examples/*/*'
61+
- name: Determine commit SHA
62+
id: determine-sha
63+
run: |
64+
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
65+
- name: Preview Bundle Size
66+
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
67+
with:
68+
message: |
69+
Sizes for commit ${{ env.COMMIT_SHA }}:
70+
| Branch | Bundle Size |
71+
|--------|--------|
72+
| 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) |
73+
| 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) |
74+
continue-on-error: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ yarn.lock
1010
build
1111
coverage
1212
dist
13+
dist-ts
1314

1415
# misc
1516
.DS_Store

.prettierignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@
88
pnpm-lock.yaml
99
packages/**/tsup.config.bundled*.mjs
1010
**/tsconfig.vitest-temp.json
11-
12-
# API Extractor report
13-
packages/angular-query-experimental/etc/*.md

CONTRIBUTING.md

Lines changed: 90 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,63 @@ If you have been assigned to fix an issue or develop a new feature, please follo
5252
- Git stage your required changes and commit (see below commit guidelines).
5353
- Submit PR for review.
5454

55+
### Editing the docs locally and previewing the changes
56+
57+
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.
58+
59+
> [!NOTE]
60+
> 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`.
61+
62+
You can follow these steps to set up the docs for local development:
63+
64+
1. Make a new directory called `tanstack`.
65+
66+
```sh
67+
mkdir tanstack
68+
```
69+
70+
2. Enter that directory and clone the [`TanStack/query`](https://github.com/TanStack/query) and [`TanStack/tanstack.com`](https://github.com/TanStack/tanstack.com) repos.
71+
72+
```sh
73+
cd tanstack
74+
git clone git@github.com:TanStack/query.git
75+
# We probably don't need all the branches and commit history
76+
# from the `tanstack.com` repo, so let's just create a shallow
77+
# clone of the latest version of the `main` branch.
78+
# Read more about shallow clones here:
79+
# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones
80+
git clone git@github.com:TanStack/tanstack.com.git --depth=1 --single-branch --branch=main
81+
```
82+
83+
> [!NOTE]
84+
> Your `tanstack` directory should look like this:
85+
>
86+
> ```
87+
> tanstack/
88+
> |
89+
> +-- query/ (<-- this directory cannot be called anything else!)
90+
> |
91+
> +-- tanstack.com/
92+
> ```
93+
94+
3. Enter the `tanstack/tanstack.com` directory, install the dependencies and run the app in dev mode:
95+
96+
```sh
97+
cd tanstack.com
98+
pnpm i
99+
# The app will run on https://localhost:3000 by default
100+
pnpm dev
101+
```
102+
103+
4. Now you can visit http://localhost:3000/query/latest/docs/framework/react/overview in the browser and see the changes you make in `tanstack/query/docs` there.
104+
105+
> [!WARNING]
106+
> You will need to update the `docs/config.json` file (in `TanStack/query`) if you add a new documentation page!
107+
108+
You can see the whole process in the screen capture below:
109+
110+
https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af275f7a269b
111+
55112
### Running examples
56113

57114
- Make sure you've installed the dependencies in the repo's root directory.
@@ -72,10 +129,6 @@ If you have been assigned to fix an issue or develop a new feature, please follo
72129
pnpm run dev
73130
```
74131

75-
#### Note on `examples/react-native`
76-
77-
React Native example requires Expo to work. Please follow the instructions from example's README.md file to learn more.
78-
79132
#### Note on standalone execution
80133

81134
If you want to run an example without installing dependencies for the whole repo, just follow instructions from the example's README.md file. It will be then run against the latest TanStack Query release.
@@ -183,3 +236,36 @@ Use an appropriate commit type. Be especially careful with breaking changes.
183236
## Releases
184237

185238
For each new commit added to `main` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.
239+
240+
## 🧪 Test
241+
242+
TanStack Query uses [Nx](https://nx.dev/) as its monorepo tool.
243+
To run tests in a local environment, you should use `nx` commands from the root directory.
244+
245+
### ✅ Run all tests
246+
247+
To run tests for **all packages**, run:
248+
249+
```bash
250+
npm run test
251+
```
252+
253+
### ✅ Run tests for a specific package
254+
255+
To run tests for a specific package, use the following command:
256+
257+
```bash
258+
npx nx run @tanstack/{package-name}:test:lib
259+
```
260+
261+
For example:
262+
263+
```bash
264+
npx nx run @tanstack/react-query:test:lib
265+
```
266+
267+
### ⚠️ Caution
268+
269+
Do not run `pnpm run test:lib` inside individual package folders.
270+
This can cause test failures due to dependencies between packages.
271+
Always run tests from the **root folder** using `nx` commands.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ View the contributing guidelines [here](/CONTRIBUTING.md)
5151

5252
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
5353

54-
<!-- Use the force, Luke! -->
54+
<!-- Use the force, Luke -->

0 commit comments

Comments
 (0)