-
Notifications
You must be signed in to change notification settings - Fork 197
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
Bump the redux group with 3 updates #6003
Conversation
createSelectorCreator, | ||
defaultMemoize, | ||
} from 'reselect'; | ||
import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMemoize
has been renamed to lruMemoize
, as it's no longer the default: https://github.com/reduxjs/reselect/releases/tag/v5.0.1
@@ -1,6 +1,6 @@ | |||
/* global process */ | |||
import * as redux from 'redux'; | |||
import thunk from 'redux-thunk'; | |||
import { thunk } from 'redux-thunk'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the thunk
named export now has the right types and redux-thunk/extend-redux
is no longer needed (in fact it is no longer included)
Bumps the redux group with 3 updates: [redux](https://github.com/reduxjs/redux), [redux-thunk](https://github.com/reduxjs/redux-thunk) and [reselect](https://github.com/reduxjs/reselect). Updates `redux` from 4.2.1 to 5.0.0 - [Release notes](https://github.com/reduxjs/redux/releases) - [Changelog](https://github.com/reduxjs/redux/blob/master/CHANGELOG.md) - [Commits](reduxjs/redux@v4.2.1...v5.0.0) Updates `redux-thunk` from 2.4.2 to 3.1.0 - [Release notes](https://github.com/reduxjs/redux-thunk/releases) - [Commits](reduxjs/redux-thunk@v2.4.2...v3.1.0) Updates `reselect` from 4.1.8 to 5.0.1 - [Release notes](https://github.com/reduxjs/reselect/releases) - [Changelog](https://github.com/reduxjs/reselect/blob/master/CHANGELOG.md) - [Commits](reduxjs/reselect@v4.1.8...v5.0.1) --- updated-dependencies: - dependency-name: redux dependency-type: direct:development update-type: version-update:semver-major dependency-group: redux - dependency-name: redux-thunk dependency-type: direct:development update-type: version-update:semver-major dependency-group: redux - dependency-name: reselect dependency-type: direct:development update-type: version-update:semver-major dependency-group: redux ... Signed-off-by: dependabot[bot] <support@github.com>
8041b4f
to
4921ff8
Compare
4921ff8
to
1a5904f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6003 +/- ##
=======================================
Coverage 99.45% 99.45%
=======================================
Files 265 265
Lines 10127 10129 +2
Branches 2462 2462
=======================================
+ Hits 10072 10074 +2
Misses 55 55 ☔ View full report in Codecov by Sentry. |
@@ -105,7 +105,10 @@ function createDraft(annotation: AnnotationID, changes: DraftChanges) { | |||
* An empty draft has no text and no reference tags. | |||
*/ | |||
function deleteNewAndEmptyDrafts() { | |||
return (dispatch: Dispatch, getState: () => { drafts: State }) => { | |||
return ( | |||
dispatch: ThunkDispatch<{ drafts: State }, void, any>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The any
at the end represents the actions that dispatch
can be called with. It's either a regular action, or the return type of an async thunk callback. In this case we need both.
I could not define an action type that didn't make one of the dispatch(...)
calls trigger a type error, so I defined it as ´any´ for now, but we might want to revisit this.
For references, this is ThunkDispatch
type definition and docs:
/**
* The dispatch method as modified by React-Thunk; overloaded so that you can
* dispatch:
* - standard (object) actions: `dispatch()` returns the action itself
* - thunk actions: `dispatch()` returns the thunk's return value
*
* @template State The redux state
* @template ExtraThunkArg The extra argument passed to the inner function of
* thunks (if specified when setting up the Thunk middleware)
* @template BasicAction The (non-thunk) actions that can be dispatched.
*/
interface ThunkDispatch<State, ExtraThunkArg, BasicAction extends Action> {
/** Accepts a thunk function, runs it, and returns whatever the thunk itself returns */
<ReturnType>(thunkAction: ThunkAction<ReturnType, State, ExtraThunkArg, BasicAction>): ReturnType;
/** Accepts a standard action object, and returns that action object */
<Action extends BasicAction>(action: Action): Action;
/** A union of the other two overloads for TS inference purposes */
<ReturnType, Action extends BasicAction>(action: Action | ThunkAction<ReturnType, State, ExtraThunkArg, BasicAction>): Action | ReturnType;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pragmatic for now.
All explicit type errors resulting from updating to new major versions have been addressed. There's now two warnings left, triggered by two of our selectors, caused by the changes introduced in reduxjs/reselect#645 Both were probably a potential issue before, but they were not checked by previous reselect versions. Applying this diff allows those to not be checked if that's what we want: diff --git a/src/sidebar/store/modules/frames.ts b/src/sidebar/store/modules/frames.ts
index acb066ad9..864b3acd7 100644
--- a/src/sidebar/store/modules/frames.ts
+++ b/src/sidebar/store/modules/frames.ts
@@ -208,6 +208,11 @@ const searchUris = createShallowEqualSelector(
[],
),
uris => uris,
+ {
+ devModeChecks: {
+ identityFunctionCheck: 'never',
+ },
+ },
);
function getContentInfo(state: State) {
diff --git a/src/sidebar/store/modules/real-time-updates.ts b/src/sidebar/store/modules/real-time-updates.ts
index ef1ecdb5f..4d70c6b5e 100644
--- a/src/sidebar/store/modules/real-time-updates.ts
+++ b/src/sidebar/store/modules/real-time-updates.ts
@@ -194,6 +194,11 @@ const pendingUpdateCount = createSelector(
(state: State) => [state.pendingUpdates, state.pendingDeletions],
([pendingUpdates, pendingDeletions]) =>
Object.keys(pendingUpdates).length + Object.keys(pendingDeletions).length,
+ {
+ devModeChecks: {
+ inputStabilityCheck: 'never',
+ },
+ },
);
/** EDIT: The second warning can also be addressed by refactoring function pendingUpdateCount(state: State) {
return (
Object.keys(state.pendingUpdates).length +
Object.keys(state.pendingDeletions).length
);
} |
Fix an issue where the selector would return a new array on each call, even if called with the same arguments. Instead the correct way to capture multiple values from the state is to pass multiple arguments to `createSelector`.
The warning is correct that this is not really how Reselect is supposed to be used, but it is intentional. Add a suppression with a comment explaining the intent in case we find a nicer approach in future that better aligns with how Reselect is supposed to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial changes from you look good to me @acelaya. I pushed suggested solutions for the two remaining warnings. In one instance I fixed a simple error, in the other I used a warning suppression as it is more complex to resolve the actual issue.
Those changes seem sensible to me. |
Bumps the redux group with 3 updates: redux, redux-thunk and reselect.
Updates
redux
from 4.2.1 to 5.0.0Release notes
Sourced from redux's releases.
... (truncated)
Commits
549589e
Release 5.0.00dab270
Merge pull request #4629 from reduxjs/docs/5.0-docs-updatese222442
Update migration pagee124f0b
Merge pull request #4625 from reduxjs/docs/5.0-docs-updates173ff78
Kill the term "reducing function"3757120
Drop UMD mentions5dcefbe
Nuke most "ES2015" referencesddf44fe
Nuke dead "Object spread" page47cf3a5
Add API docs for new utils97d0992
ES2015 all the things!Updates
redux-thunk
from 2.4.2 to 3.1.0Release notes
Sourced from redux-thunk's releases.
... (truncated)
Commits
88008ea
Release 3.1.01de2476
Merge pull request #357 from reduxjs/feature/remove-extendc8d4878
Drop the extend-redux addition3da59d0
Release 3.0.1d4909d3
Kill the bindActionCreators overload for nowece6c25
Release 3.0.0b419ba6
Bump Redux dep72db9a6
Release 3.0.0-rc.00ad3af1
Merge pull request #356 from reduxjs/feature/3.0-bump-deps-rc8863682
Remove old attw matrix entryUpdates
reselect
from 4.1.8 to 5.0.1Release notes
Sourced from reselect's releases.
... (truncated)
Commits
cf8d96b
Release 5.0.12a1e055
Merge pull request #657 from reduxjs/bugfix/5.0-weakref-check484626e
Drop v2.0-integration checkoutd2a0cd1
Fix WeakRef check87ac8fb
Release 5.0.03bf2ab4
Merge pull request #656 from aryaemami59/netlify-docscedf7a5
Further README cleanupf616572
Update theme to monokai to match other sites31f2228
Update docs site link and tweak contenta5db189
Memoize some componentsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major version
will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor version
will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>
will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>
will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>
will remove the ignore condition of the specified dependency and ignore conditions