Skip to content

Commit

Permalink
Merge branch 'master' into feature/remove-connectadvanced
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Jul 28, 2021
2 parents 532f696 + d622cb5 commit c7c2f0c
Show file tree
Hide file tree
Showing 20 changed files with 390 additions and 249 deletions.
33 changes: 0 additions & 33 deletions .github/ISSUE_TEMPLATE/Bug_report.md

This file was deleted.

36 changes: 0 additions & 36 deletions .github/ISSUE_TEMPLATE/Feature_request.md

This file was deleted.

55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 🐛 Bug Report
description: Something isn't working correctly.
body:
- type: markdown
attributes:
value: |
Thank you for contributing to open source!
Do you need some help?
======================
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:
- Read the docs: https://react-redux.js.org/
- Check out the troubleshooting guide: https://react-redux.js.org/troubleshooting
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/redux
- Ask in chat: https://www.reactiflux.com/
Think you found a bug?
======================
The best bug report is a failing test in the repository as a pull request. Otherwise, please use the form below.
- type: textarea
attributes:
label: What version of React, ReactDOM/React Native, Redux, and React Redux are you using?
value: |
- React:
- ReactDOM/React Native:
- Redux:
- React Redux:
validations:
required: true
- type: textarea
attributes:
label: What is the current behavior?
description: |
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
validations:
required: true
- type: textarea
attributes:
label: What is the expected behavior?
validations:
required: true
- type: input
attributes:
label: Which browser and OS are affected by this issue?
validations:
required: false
- type: checkboxes
attributes:
label: Did this work in previous versions of React Redux?
options:
- label: "Yes"
validations:
required: false
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 👍 Feature Request
description: I'd like React Redux to do something new.
body:
- type: markdown
attributes:
value: |
Thank you for contributing to open source!
Do you need some help?
======================
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:
- Read the docs: https://react-redux.js.org/
- Check out the troubleshooting guide: https://react-redux.js.org/troubleshooting
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/redux
- Ask in chat: https://www.reactiflux.com/
- type: textarea
attributes:
label: What is the new or updated feature that you are suggesting?
description: |
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.
validations:
required: true
- type: textarea
attributes:
label: Why should this feature be included?
validations:
required: true
- type: textarea
attributes:
label: What docs changes are needed to explain this?
validations:
required: true
19 changes: 12 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
const { default: tsJestPreset } = require('ts-jest')

const defaults = {
...tsJestPreset,
coverageDirectory: './coverage/',
collectCoverage: true,
testURL: 'http://localhost',
}

const testFolderPath = (folderName) =>
`<rootDir>/test/${folderName}/**/*.{js,ts,tsx}`
const testFolderPath = (folderName) => `<rootDir>/test/${folderName}/**/*.js`

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

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

const tsTestFolderPath = (folderName) =>
`<rootDir>/test/${folderName}/**/*.{ts,tsx}`

const tsStandardConfig = {
...defaults,
displayName: 'ReactDOM',
preset: 'ts-jest',
testMatch: NORMAL_TEST_FOLDERS.map(tsTestFolderPath),
}

const rnConfig = {
...defaults,
displayName: 'React Native',
Expand All @@ -29,5 +34,5 @@ const rnConfig = {
}

module.exports = {
projects: [standardConfig, rnConfig],
projects: [tsStandardConfig, standardConfig, rnConfig],
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@
"prettier": "^2.1.2",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-native": "^0.63.3",
"react-native": "^0.64.1",
"react-test-renderer": "^16.14.0",
"redux": "^4.0.5",
"rimraf": "^3.0.2",
"rollup": "^2.32.1",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^27.0.3",
"ts-jest": "26.5.6",
"typescript": "^4.3.4"
},
"browserify": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ProviderProps<A extends Action = AnyAction> {
* If this is used, you'll need to customize `connect` by supplying the same context provided to the Provider.
* Initial value doesn't matter, as it is overwritten with the internal state of Provider.
*/
context?: Context<ReactReduxContextValue>
context?: Context<ReactReduxContextValue | null>
children: ReactNode
}

Expand Down
2 changes: 1 addition & 1 deletion src/connect/wrapMapToProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function wrapMapToPropsConstant(
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
// therefore not reporting its length accurately..
export function getDependsOnOwnProps(mapToProps: MapToProps) {
return mapToProps?.dependsOnOwnProps
return mapToProps.dependsOnOwnProps
? Boolean(mapToProps.dependsOnOwnProps)
: mapToProps.length !== 1
}
Expand Down
2 changes: 2 additions & 0 deletions src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useSelector, createSelectorHook } from './hooks/useSelector'
import { useStore, createStoreHook } from './hooks/useStore'

import shallowEqual from './utils/shallowEqual'
import type { Subscription } from '../src/utils/Subscription'

export * from './types'
export type {
Expand All @@ -40,6 +41,7 @@ export type {
MapDispatchToPropsNonObject,
MergeProps,
ReactReduxContextValue,
Subscription,
}
export {
Provider,
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,6 @@ export type ResolveArrayThunks<TDispatchProps extends ReadonlyArray<any>> =
export interface TypedUseSelectorHook<TState> {
<TSelected>(
selector: (state: TState) => TSelected,
equalityFn?: (left: TSelected, right: TSelected) => boolean
equalityFn?: EqualityFn<TSelected>
): TSelected
}
Loading

0 comments on commit c7c2f0c

Please sign in to comment.