Skip to content

Commit

Permalink
Merge branch 'v2.0-integration' into pr/configure-produce-implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ben.durrant committed Apr 5, 2023
2 parents f0228f9 + d96ce6e commit a36f092
Show file tree
Hide file tree
Showing 171 changed files with 47,270 additions and 83 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
filters: |
toolkit:
- 'packages/toolkit/**'
- 'examples/publish-ci/**'
- '.github/workflows/tests.yml'
build:
needs: changes
Expand All @@ -43,6 +45,13 @@ jobs:
- name: Install deps
run: yarn install

# Read existing version, reuse that, add a Git short hash
- name: Set build version to Git commit
run: node scripts/writeGitVersion.mjs $(git rev-parse --short HEAD)

- name: Check updated version
run: jq .version package.json

- name: Pack
run: yarn pack

Expand Down Expand Up @@ -121,9 +130,76 @@ jobs:
- name: Install build artifact
run: yarn add ./package.tgz

- name: Show installed RTK versions
run: yarn info @reduxjs/toolkit

- run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./vitest.config.ts ./src/tests/*.* ./src/query/tests/*.*

- name: Test types
run: |
yarn tsc --version
yarn type-tests
test-published-artifact:
name: Test Published Artifact ${{ matrix.example }}

needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['16.x']
example:
[
'cra4',
'cra5',
'next',
'vite',
'node-standard',
'node-esm',
'are-the-types-wrong',
]
defaults:
run:
working-directory: ./examples/publish-ci/${{ matrix.example }}
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install deps
run: yarn install

- name: Remove existing RTK
run: yarn remove @reduxjs/toolkit

- uses: actions/download-artifact@v2
with:
name: package
path: ./examples/publish-ci/${{ matrix.example }}

- name: Check folder contents
run: ls -l .

- name: Install RTK build artifact
run: yarn add ./package.tgz

- name: Show installed RTK versions
run: yarn info @reduxjs/toolkit && yarn why @reduxjs/toolkit

- name: Build example
run: yarn build

- name: Run test step
run: yarn test
if: matrix.example != 'are-the-types-wrong'

- name: Run test step (attw)
# Ignore "FalseCJS" errors in the `attw` job
run: yarn test -n FalseCJS
if: matrix.example == 'are-the-types-wrong'
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ es

.yalc
yalc.lock
yalc.sig

.idea/
.vscode/
Expand All @@ -29,7 +30,3 @@ typesversions
!.yarn/versions
.pnp.*
*.tgz

.yalc
yalc.lock
yalc.sig
2 changes: 1 addition & 1 deletion docs/rtk-query/usage/code-splitting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ export const { useExampleQuery } = extendedApi
```

:::tip
In development mode, if you inject an endpoint that already exists and don't explicitly specify `overrideExisting: true`, the endpoint will not be overridden and you will get a warning about it. You **will not see the warning in production** and the existing endpoint will just be overriden, so make sure to account for this in your tests.
If you inject an endpoint that already exists and don't explicitly specify `overrideExisting: true`, the endpoint will not be overridden. In development mode, you will get a warning about this.
:::
2 changes: 1 addition & 1 deletion docs/rtk-query/usage/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function App() {
}
```

While `data` is expected to used in the majority of situations, `currentData` is also provided,
While `data` is expected to be used in the majority of situations, `currentData` is also provided,
which allows for a further level of granularity. For example, if you wanted to show data in the UI
as translucent to represent a re-fetching state, you can use `data` in combination with `isFetching`
to achieve this. However, if you also wish to _only_ show data corresponding to the current arg,
Expand Down
35 changes: 35 additions & 0 deletions examples/publish-ci/are-the-types-wrong/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

typesversions
.cache
.yarnrc
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
*.tgz
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/package.json b/package.json
index 60791b6ccd3575279eddef2ac795802bd5044abd..41be518d2f21a659ca71095850cb18264a814f8d 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
"prepublishOnly": "npm run tsc && npm run test"
},
"type": "module",
+ "types": "./dist/index.d.ts",
"exports": {
".": {
"development": "./src/index.ts",
Loading

0 comments on commit a36f092

Please sign in to comment.