Skip to content

chore: introduce changesets #9502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

chore: introduce changesets #9502

wants to merge 4 commits into from

Conversation

lachlancollins
Copy link
Member

@lachlancollins lachlancollins commented Jul 26, 2025

Copy link

nx-cloud bot commented Jul 26, 2025

View your CI Pipeline Execution ↗ for commit ab7eb13

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

☁️ Nx Cloud last updated this comment at 2025-07-26 11:50:20 UTC

@lachlancollins lachlancollins requested a review from TkDodo July 26, 2025 08:56
Copy link

pkg-pr-new bot commented Jul 26, 2025

More templates

@tanstack/angular-query-devtools-experimental

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

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: ab7eb13

Copy link

github-actions bot commented Jul 26, 2025

Sizes for commit ab7eb13:

Branch Bundle Size
Main
This PR

Copy link

codecov bot commented Jul 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@3cc59be). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9502   +/-   ##
=======================================
  Coverage        ?   45.30%           
=======================================
  Files           ?      208           
  Lines           ?     8283           
  Branches        ?     1869           
=======================================
  Hits            ?     3753           
  Misses          ?     4085           
  Partials        ?      445           
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (?)
@tanstack/angular-query-experimental 85.00% <ø> (?)
@tanstack/eslint-plugin-query 83.24% <ø> (?)
@tanstack/query-async-storage-persister 43.85% <ø> (?)
@tanstack/query-broadcast-client-experimental 24.39% <ø> (?)
@tanstack/query-codemods 0.00% <ø> (?)
@tanstack/query-core 97.69% <ø> (?)
@tanstack/query-devtools 3.55% <ø> (?)
@tanstack/query-persist-client-core 79.47% <ø> (?)
@tanstack/query-sync-storage-persister 84.61% <ø> (?)
@tanstack/query-test-utils 77.77% <ø> (?)
@tanstack/react-query 95.95% <ø> (?)
@tanstack/react-query-devtools 10.00% <ø> (?)
@tanstack/react-query-next-experimental ∅ <ø> (?)
@tanstack/react-query-persist-client 100.00% <ø> (?)
@tanstack/solid-query 78.13% <ø> (?)
@tanstack/solid-query-devtools ∅ <ø> (?)
@tanstack/solid-query-persist-client 100.00% <ø> (?)
@tanstack/svelte-query 87.58% <ø> (?)
@tanstack/svelte-query-devtools ∅ <ø> (?)
@tanstack/svelte-query-persist-client 100.00% <ø> (?)
@tanstack/vue-query 71.10% <ø> (?)
@tanstack/vue-query-devtools ∅ <ø> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines -4 to -8
workflow_dispatch:
inputs:
tag:
description: override release tag
required: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need this to trigger manual releases from the github actions workflow

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or rather, we “needed” this. how can I force publish a release with changesets only?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you can do this with changesets alone!

@@ -237,7 +167,7 @@ Use an appropriate commit type. Be especially careful with breaking changes.

## Releases

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.
For each new commit added to `main`, a GitHub Workflow is triggered which runs the [Changesets Action](https://github.com/changesets/action). This generates a preview PR showing the impact of all changesets. When this PR is merged, the package will be published to NPM.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sounds like more work for maintainers. Previously, I just merged a PR with fix: or feat: prefix in the commit message (which I could alter while squash merging if someone didn’t do that correctly) and it would auto-trigger a release. Now I have to:

  • generate a changeset or remind people to do that
  • wait for the preview PR to show up
  • merge that, too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @TkDodo , yes it's definitely an extra step, maybe this wasn't explicitly addressed in that Discord thread. I'll still advocate for this change as I believe the downsides are outweighed by the benefits, but happy to discuss further on Discord!

Comment on lines -158 to -230
## Commit message conventions
## Changesets

`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
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.

### Type

Must be one of the following:

- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation

### Scope

The scope could be anything specifying place of the commit change. For example `query-core`, `react-query` etc...

You can use `*` when the change affects more than a single scope.

### Subject

The subject contains succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (.) at the end

### Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

### Footer

The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

### Example

Here is an example of the release type that will be done based on a commit messages:

| Commit message | Release type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| fix(pencil): stop graphite breaking when too much pressure applied | Patch Release |
| feat(pencil): add `graphiteWidth` option | ~~Minor~~ Feature Release |
| perf(pencil): remove `graphiteWidth` option<br/><br/>BREAKING CHANGE: The `graphiteWidth` option has been removed.<br/>The default graphite width of 10mm is always used for performance reasons. | ~~Major~~ Breaking Release |

### Revert

If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lachlancollins

Hello,
I noticed that the commit message conventions section in the CONTRIBUTING.md appears to be removed in this update, so I wanted to check.
Could you please share if there is any particular reason or background for removing this section?
Since it seems to be an important part of maintaining the team’s commit message conventions, I’d like to better understand.
Thank you!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sukvvon , the commit messages are currently more important because they directly influence versioning logic. With changesets, the commit messages no longer affect versioning. I'm happy to keep in a section about writing good commit messages, but I don't think it needs to be as extensive!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sukvvon , the commit messages are currently more important because they directly influence versioning logic. With changesets, the commit messages no longer affect versioning. I'm happy to keep in a section about writing good commit messages, but I don't think it needs to be as extensive!

@lachlancollins

https://github.com/pmndrs/zustand/blob/main/CONTRIBUTING.md#committing

How about referring to the link above? It’s a brief version I wrote before, and I think it can meet our needs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants