Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/reduxjs/redux into gitatt…
Browse files Browse the repository at this point in the history
…ributes
  • Loading branch information
aryaemami59 committed Mar 21, 2024
2 parents 2e7147e + a6984eb commit 50c7800
Show file tree
Hide file tree
Showing 25 changed files with 9,768 additions and 8,064 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"sandboxes": ["vanilla", "vanilla-ts"],
"node": "16"
"node": "18"
}
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: preactjs/compressed-size-action@v2
Expand Down
70 changes: 44 additions & 26 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -29,14 +29,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18.x']
node: ['20.x']

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Pack
run: yarn pack

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: package
path: ./package.tgz
Expand All @@ -65,21 +65,21 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['18.x']
node: ['20.x']
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

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

- name: Install deps
run: yarn install

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: package
path: .
Expand All @@ -102,14 +102,14 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['18.x']
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3']
node: ['20.x']
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2', '5.3', '5.4']
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
Expand All @@ -120,7 +120,7 @@ jobs:
- name: Install TypeScript ${{ matrix.ts }}
run: yarn add typescript@${{ matrix.ts }}

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: package
path: .
Expand All @@ -143,19 +143,19 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['18.x']
node: ['20.x']
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: package
path: .

# Note: We currently expect "FalseCJS" failures for Node16 + `moduleResolution: "node16"
# Note: We currently expect "FalseESM" failures for Node16 + `moduleResolution: "node16"
- name: Run are-the-types-wrong
run: npx @arethetypeswrong/cli ./package.tgz --format table --ignore-rules false-cjs
run: npx @arethetypeswrong/cli ./package.tgz --format table --ignore-rules false-esm

test-published-artifact:
name: Test Published Artifact ${{ matrix.example }}
Expand All @@ -165,21 +165,37 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['18.x']
example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm']
node: ['20.x']
example:
[
'cra4',
'cra5',
'next',
'vite',
'node-standard',
'node-esm',
'react-native',
'expo'
]
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

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

- name: Clone RTK repo
run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit

- name: Cache example deps
uses: actions/cache@v4
with:
path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}/node_modules
key: test-published-artifact-${{ matrix.example }}-node_modules

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

Expand All @@ -189,7 +205,7 @@ jobs:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: yarn install

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: package
path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
Expand All @@ -208,7 +224,9 @@ jobs:

- name: Build example
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: NODE_OPTIONS=--openssl-legacy-provider yarn build
env:
NODE_OPTIONS: --openssl-legacy-provider
run: yarn build

- name: Run test step
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
Expand Down
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.4.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.4.1.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs
2 changes: 0 additions & 2 deletions docs/introduction/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ Here are some suggestions on when it makes sense to use Redux:
>
> - **[Redux FAQ: When should I use Redux?](../faq/General.md#when-should-i-use-redux)**
> - **[You Might Not Need Redux](https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367)**
>
> - **[The Tao of Redux, Part 1 - Implementation and Intent](https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-1/)**
>
> - **[The Tao of Redux, Part 2 - Practice and Philosophy](https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-2/)**
> - **[Redux FAQ](../FAQ.md)**
6 changes: 6 additions & 0 deletions docs/usage/deriving-data-selectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ const selectItemsByCategory = createSelector(
)
```

You can then use the selector like this:

```js
const electronicItems = selectItemsByCategory(state, "electronics");
```

For consistency, you may want to consider passing additional parameters to a selector as a single object, such as `selectThings(state, otherArgs)`, and then extracting values from the `otherArgs` object.

#### Selector Factories
Expand Down

0 comments on commit 50c7800

Please sign in to comment.