Skip to content

WIP: Monorepo, Rebrand to TanStack #3708

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

Merged
merged 49 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2576874
rebrand
tannerlinsley Jun 14, 2022
56dffb8
move to src
tannerlinsley Jun 20, 2022
de08f87
chore: fix build by re-exporting types explicitly
TkDodo Jun 20, 2022
1b918c2
chore: run everything through prettier
TkDodo Jun 20, 2022
54b1308
chore: bring back linting and compilation tasks
TkDodo Jun 21, 2022
01155b4
chore: setup eslint-import-resolver-typescript
TkDodo Jun 21, 2022
d40121f
chore: fix a ton of imports
TkDodo Jun 21, 2022
3231d9e
chore: down to zero ts errors
TkDodo Jun 21, 2022
e33a3e6
chore: export types separately to make the build work
TkDodo Jun 21, 2022
8b0864f
chore: down to zero eslint issues 🎉
TkDodo Jun 21, 2022
f394040
chore: try to get tests to work
TkDodo Jun 21, 2022
9b74ab2
chore: make tests work
TkDodo Jun 22, 2022
371789c
fix: use better match sorter primitives
tannerlinsley Jun 22, 2022
fb537a3
chore: update workflows
tannerlinsley Jun 22, 2022
ff35b01
Update ci.yml
tannerlinsley Jun 22, 2022
a199c84
chore: remove match-sorter dependency
TkDodo Jun 22, 2022
8c4178c
chore: enable bundle size collection
TkDodo Jun 22, 2022
2122181
chore: update to latest react
TkDodo Jun 22, 2022
3800bbd
fix(devtools): fix typings of rankItems
TkDodo Jun 22, 2022
8037db4
chore: fix compilation
TkDodo Jun 22, 2022
0fbf692
tests: fix tests by removing weird comment that is no longer necessar…
TkDodo Jun 22, 2022
dff4845
tests: remove incrompehensible tests
TkDodo Jun 22, 2022
1c4367e
fix(devtools): fix sorting of queries
TkDodo Jun 22, 2022
287a818
chore: setup ci pipeline and bundlewatch
TkDodo Jun 22, 2022
97c8ecd
chore: build during pr pipelines
TkDodo Jun 22, 2022
e1b237b
chore: remove private:true
TkDodo Jun 22, 2022
63bda79
Revert "chore: remove private:true"
TkDodo Jun 22, 2022
acd2483
chore: turn off import/no-unresolved in tests
TkDodo Jun 22, 2022
9a26783
fix: turn of import/no-unresolved for all tanstack imports
TkDodo Jun 22, 2022
7783fe0
fix: regex
TkDodo Jun 22, 2022
482cb3b
chore: do not run legacy pipelines on PRs
TkDodo Jun 22, 2022
9a46171
chore: fix ci check names
TkDodo Jun 22, 2022
46d19fc
chore: add react-17 dependencies
TkDodo Jun 22, 2022
53df2c0
chore: split up ci tasks
TkDodo Jun 22, 2022
797f7a1
fix: building is done via bundlesize reporting
TkDodo Jun 22, 2022
f91aab2
chore: try to make codesandbox ci work
TkDodo Jun 23, 2022
f007065
fix: apply private: false to all workspaces
TkDodo Jun 23, 2022
7d0a93b
fix: paths to sandboxes
TkDodo Jun 23, 2022
d68ea3c
chore: fix code coverage collection
TkDodo Jun 23, 2022
128cbfa
chore: change imports from react-query to tanstack/react-query
TkDodo Jun 24, 2022
4c7563a
docs: update migration docs with the rebrand
TkDodo Jun 24, 2022
c9bf19a
chore: revert codemod changes
TkDodo Jun 24, 2022
30c0e2e
fix(useIsMutating): we need to subscribe to the right cache
TkDodo Jun 24, 2022
819b400
Update README.md
tannerlinsley Jun 24, 2022
822c98c
Merge branch 'rebrand-2' of https://github.com/TanStack/query into re…
tannerlinsley Jun 24, 2022
f654e9a
docs: devtools documentation for tanstack rebrand
TkDodo Jun 26, 2022
10ddd15
Merge branch 'beta' into rebrand-2
tannerlinsley Jul 8, 2022
f4e736c
fix builds
tannerlinsley Jul 8, 2022
57ae1c0
chore: cleanup
tannerlinsley Jul 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": ["./"],
"sandboxes": ["/examples/basic", "/examples/basic-typescript"],
"node": "14"
"installCommand": "install:csb",
"sandboxes": ["/examples/react/basic", "/examples/react/basic-typescript"],
"node": "16"
}
32 changes: 17 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import"],
"extends": [
Expand All @@ -12,9 +13,23 @@
"es6": true
},
"parserOptions": {
"project": "./tsconfig.json",
"project": "./tsconfig.base.json",
"sourceType": "module"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"node": true,
"typescript": {
"project": "packages/*/tsconfig.json"
}
},
"react": {
"version": "detect"
}
},
"rules": {
"react/jsx-key": ["error", { "checkFragmentShorthand": true }],
"@typescript-eslint/ban-types": "off",
Expand All @@ -32,21 +47,8 @@
],
"no-shadow": "error",
"import/no-cycle": "error",
"import/no-unresolved": ["error", { "ignore": ["react-query"] }],
"import/no-unresolved": ["error", { "ignore": ["^@tanstack\/"] }],
"import/no-unused-modules": ["off", { "unusedExports": true }],
"import/no-restricted-paths": [
"error",
{
"zones": [
{ "target": "src/core", "from": "src/broadcastQueryClient-experimental" },
{ "target": "src/core", "from": "src/createAsyncStoragePersister" },
{ "target": "src/core", "from": "src/createWebStoragePersister" },
{ "target": "src/core", "from": "src/devtools" },
{ "target": "src/core", "from": "src/persistQueryClient" },
{ "target": "src/core", "from": "src/reactjs" }
]
}
],
"no-redeclare": "off"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ name: react-query tests
on:
push:
branches:
- 'master'
- 'next'
- 'alpha'
- 'beta'
- '1.x'
- '2.x'
pull_request:

- '3.x'
jobs:
test:
name: 'Node ${{ matrix.node }}, React ${{ matrix.react }}'
Expand Down Expand Up @@ -40,7 +35,7 @@ jobs:
name: 'Publish Module to NPM'
needs: test
# publish only when merged in master on original repo, not on PR
if: github.repository == 'tannerlinsley/react-query' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/1.x' || github.ref == 'refs/heads/2.x')
if: github.repository == 'tannerlinsley/react-query' && (github.ref == 'refs/heads/1.x' || github.ref == 'refs/heads/2.x' || github.ref == 'refs/heads/3.x')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci
concurrency:
group: publish-${{ github.github.base_ref }}
cancel-in-progress: true
on: [push]
jobs:
test-and-publish:
if: github.event_name != 'pull_request'
name: 'Test & Publish'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: |
npm i
git config --global user.name 'Tanner Linsley'
git config --global user.email '[email protected]'
npm run cipublish
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pr
on: [pull_request]
jobs:
test:
name: 'Node ${{ matrix.node }}, React ${{ matrix.react }}'
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16]
react: [17, 18]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
uses: bahmutov/npm-install@v1
- run: npm run test:ci
env:
REACTJS_VERSION: ${{ matrix.react }}
- run: npm run test:size
if: matrix.node == '16' && matrix.react == '18'
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules
# builds
types
build
*/build
dist
lib
es
Expand All @@ -30,7 +31,13 @@ yarn-error.log*
.history
size-plugin.json
stats-hydration.json
stats-react.json
stats.json
stats.html
.vscode/settings.json
.idea/

*.log
.DS_Store
node_modules
.cache
dist
.idea
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
112 changes: 0 additions & 112 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Tanner Linsley
Copyright (c) 2021 Tanner Linsley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Tabl

Still on **React Query v2**? No problem! Check out the v2 docs here: https://react-query-v2.tanstack.com/. <br />
Would you like to try **React Query v4beta**? Check out the v4 beta docs here: https://react-query-beta.tanstack.com/.

## Quick Features

- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)
Expand Down Expand Up @@ -94,4 +95,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

<!-- Force 4 -->
<!-- Use the force, Luke -->
File renamed without changes.
1 change: 0 additions & 1 deletion broadcastQueryClient-experimental/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion broadcastQueryClient-experimental/index.js

This file was deleted.

6 changes: 0 additions & 6 deletions broadcastQueryClient-experimental/package.json

This file was deleted.

1 change: 0 additions & 1 deletion core/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion core/index.js

This file was deleted.

1 change: 0 additions & 1 deletion createAsyncStoragePersister/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion createAsyncStoragePersister/index.js

This file was deleted.

1 change: 0 additions & 1 deletion createWebStoragePersister/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion createWebStoragePersister/index.js

This file was deleted.

1 change: 0 additions & 1 deletion devtools/development/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion devtools/development/index.js

This file was deleted.

1 change: 0 additions & 1 deletion devtools/index.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions devtools/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/adapters/react-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `react-query` package offers a 1st-class API for using TanStack Query via Re
## Example

```tsx
import { QueryClient, useQuery } from 'react-query'
import { QueryClient, useQuery } from '@tanstack/react-query'

const queryClient = new QueryClient()

Expand Down
16 changes: 11 additions & 5 deletions docs/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ When you begin your React Query journey, you'll want these devtools by your side

> Please note that for now, the devtools **do not support React Native**. If you would like to help us make the devtools platform agnostic, please let us know!

## Import the Devtools
## Install and Import the Devtools

The devtools are bundle split into the `react-query/devtools` package. No need to install anything extra, just:
The devtools are a separate package that you need to install:

```bash
$ npm i @tanstack/react-query-devtools
```

You can import the devtools like this:

```js
import { ReactQueryDevtools } from 'react-query/devtools'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
```

By default, React Query Devtools are only included in bundles when `process.env.NODE_ENV === 'development'`, so you don't need to worry about excluding them during a production build.
Expand All @@ -26,7 +32,7 @@ Floating Mode will mount the devtools as a fixed, floating element in your app a
Place the following code as high in your React app as you can. The closer it is to the root of the page, the better it will work!

```js
import { ReactQueryDevtools } from 'react-query/devtools'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'

function App() {
return (
Expand Down Expand Up @@ -59,7 +65,7 @@ function App() {
Embedded Mode will embed the devtools as a regular component in your application. You can style it however you'd like after that!

```js
import { ReactQueryDevtoolsPanel } from 'react-query/devtools'
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools'

function App() {
return (
Expand Down
Loading