Skip to content

Commit c7c2f0c

Browse files
committed
Merge branch 'master' into feature/remove-connectadvanced
2 parents 532f696 + d622cb5 commit c7c2f0c

20 files changed

+390
-249
lines changed

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/Feature_request.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: 🐛 Bug Report
2+
description: Something isn't working correctly.
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thank you for contributing to open source!
8+
9+
Do you need some help?
10+
======================
11+
12+
The issue tracker is meant for bug reports only. This isn't the best place for support or usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:
13+
14+
- Read the docs: https://react-redux.js.org/
15+
- Check out the troubleshooting guide: https://react-redux.js.org/troubleshooting
16+
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/redux
17+
- Ask in chat: https://www.reactiflux.com/
18+
19+
Think you found a bug?
20+
======================
21+
The best bug report is a failing test in the repository as a pull request. Otherwise, please use the form below.
22+
- type: textarea
23+
attributes:
24+
label: What version of React, ReactDOM/React Native, Redux, and React Redux are you using?
25+
value: |
26+
- React:
27+
- ReactDOM/React Native:
28+
- Redux:
29+
- React Redux:
30+
validations:
31+
required: true
32+
- type: textarea
33+
attributes:
34+
label: What is the current behavior?
35+
description: |
36+
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to a CodeSandbox (https://codesandbox.io/s/new) or RN Snack (https://snack.expo.io/) example below
37+
validations:
38+
required: true
39+
- type: textarea
40+
attributes:
41+
label: What is the expected behavior?
42+
validations:
43+
required: true
44+
- type: input
45+
attributes:
46+
label: Which browser and OS are affected by this issue?
47+
validations:
48+
required: false
49+
- type: checkboxes
50+
attributes:
51+
label: Did this work in previous versions of React Redux?
52+
options:
53+
- label: "Yes"
54+
validations:
55+
required: false
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 👍 Feature Request
2+
description: I'd like React Redux to do something new.
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thank you for contributing to open source!
8+
9+
Do you need some help?
10+
======================
11+
12+
The issue tracker is meant for bug reports only. This isn't the best place for support or usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:
13+
14+
- Read the docs: https://react-redux.js.org/
15+
- Check out the troubleshooting guide: https://react-redux.js.org/troubleshooting
16+
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/redux
17+
- Ask in chat: https://www.reactiflux.com/
18+
- type: textarea
19+
attributes:
20+
label: What is the new or updated feature that you are suggesting?
21+
description: |
22+
Please provide thoughtful commentary *and code samples* on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric.
23+
validations:
24+
required: true
25+
- type: textarea
26+
attributes:
27+
label: Why should this feature be included?
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: What docs changes are needed to explain this?
33+
validations:
34+
required: true

jest.config.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
const { default: tsJestPreset } = require('ts-jest')
2-
31
const defaults = {
4-
...tsJestPreset,
52
coverageDirectory: './coverage/',
63
collectCoverage: true,
74
testURL: 'http://localhost',
85
}
9-
10-
const testFolderPath = (folderName) =>
11-
`<rootDir>/test/${folderName}/**/*.{js,ts,tsx}`
6+
const testFolderPath = (folderName) => `<rootDir>/test/${folderName}/**/*.js`
127

138
const NORMAL_TEST_FOLDERS = ['components', 'hooks', 'integration', 'utils']
149

@@ -18,6 +13,16 @@ const standardConfig = {
1813
testMatch: NORMAL_TEST_FOLDERS.map(testFolderPath),
1914
}
2015

16+
const tsTestFolderPath = (folderName) =>
17+
`<rootDir>/test/${folderName}/**/*.{ts,tsx}`
18+
19+
const tsStandardConfig = {
20+
...defaults,
21+
displayName: 'ReactDOM',
22+
preset: 'ts-jest',
23+
testMatch: NORMAL_TEST_FOLDERS.map(tsTestFolderPath),
24+
}
25+
2126
const rnConfig = {
2227
...defaults,
2328
displayName: 'React Native',
@@ -29,5 +34,5 @@ const rnConfig = {
2934
}
3035

3136
module.exports = {
32-
projects: [standardConfig, rnConfig],
37+
projects: [tsStandardConfig, standardConfig, rnConfig],
3338
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@
103103
"prettier": "^2.1.2",
104104
"react": "^16.14.0",
105105
"react-dom": "^16.14.0",
106-
"react-native": "^0.63.3",
106+
"react-native": "^0.64.1",
107107
"react-test-renderer": "^16.14.0",
108108
"redux": "^4.0.5",
109109
"rimraf": "^3.0.2",
110110
"rollup": "^2.32.1",
111111
"rollup-plugin-terser": "^7.0.2",
112-
"ts-jest": "^27.0.3",
112+
"ts-jest": "26.5.6",
113113
"typescript": "^4.3.4"
114114
},
115115
"browserify": {

src/components/Provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface ProviderProps<A extends Action = AnyAction> {
1515
* If this is used, you'll need to customize `connect` by supplying the same context provided to the Provider.
1616
* Initial value doesn't matter, as it is overwritten with the internal state of Provider.
1717
*/
18-
context?: Context<ReactReduxContextValue>
18+
context?: Context<ReactReduxContextValue | null>
1919
children: ReactNode
2020
}
2121

src/connect/wrapMapToProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function wrapMapToPropsConstant(
4747
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
4848
// therefore not reporting its length accurately..
4949
export function getDependsOnOwnProps(mapToProps: MapToProps) {
50-
return mapToProps?.dependsOnOwnProps
50+
return mapToProps.dependsOnOwnProps
5151
? Boolean(mapToProps.dependsOnOwnProps)
5252
: mapToProps.length !== 1
5353
}

src/exports.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { useSelector, createSelectorHook } from './hooks/useSelector'
2222
import { useStore, createStoreHook } from './hooks/useStore'
2323

2424
import shallowEqual from './utils/shallowEqual'
25+
import type { Subscription } from '../src/utils/Subscription'
2526

2627
export * from './types'
2728
export type {
@@ -40,6 +41,7 @@ export type {
4041
MapDispatchToPropsNonObject,
4142
MergeProps,
4243
ReactReduxContextValue,
44+
Subscription,
4345
}
4446
export {
4547
Provider,

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,6 @@ export type ResolveArrayThunks<TDispatchProps extends ReadonlyArray<any>> =
272272
export interface TypedUseSelectorHook<TState> {
273273
<TSelected>(
274274
selector: (state: TState) => TSelected,
275-
equalityFn?: (left: TSelected, right: TSelected) => boolean
275+
equalityFn?: EqualityFn<TSelected>
276276
): TSelected
277277
}

0 commit comments

Comments
 (0)