Skip to content
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

V5 final type changes #639

Merged
merged 11 commits into from
Nov 21, 2023
Merged

Conversation

aryaemami59
Copy link
Contributor

@aryaemami59 aryaemami59 commented Nov 19, 2023

This PR includes:

Major changes:

  • Remove ParametricSelector and OutputParametricSelector since Selector and OutputSelector support additional parameters by default. This is a breaking change!
  • AdddependencyRecomputations and resetDependencyRecomputations to enable debugging input selectors and argsMemoize.

Minor changes:

  • Slightly refactor CreateSelectorOptions for consistency.
  • Add more type expansions for better visualization for hover-previews.
  • Slightly modify ensureIsArray utility function.
  • Rename some of the types related to MergeParameters for clarity and future maintainability.
  • Add JSDocs for types related to MergeParameters.
  • Add dependencyRecomputations and resetDependencyRecomputations to unit tests.
  • Add type expansions to createStructuredSelector to improve visibility during hover-previews.
  • Add DefaultMemoizeFields with clearCache in order to centralize definitions.
  • Add more units tests for createStructuredSelector.
  • Update JSDocs for:
  • createStructuredSelector
  • defaultEqualityCheck
  • CreateSelectorOptions.memoize
  • CreateSelectorOptions.argsMemoize
  • OutputSelectorFields
  • weakMapMemoize
  • autotrackMemoize

Copy link

codesandbox-ci bot commented Nov 19, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit fda51ea:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration

@aryaemami59 aryaemami59 marked this pull request as ready for review November 19, 2023 05:18
aryaemami59 and others added 11 commits November 20, 2023 21:29
- Add `@typescript/analyze-trace` to "devDependencies" to help measure TS performance.
- Update `.gitignore` file to exclude the trace folder.
- These two types can now be removed since `Selector` and `OutputSelector` support additional parameters by default.
-  Add`dependencyRecomputations` and `resetDependencyRecomputations` to enable debugging input selectors and `argsMemoize`.
- Slightly refactor `CreateSelectorOptions` for consistency.
- Add more type expansions for better visualization for hover-previews.
- Slightly modify `ensureIsArray` utility function.
- Rename some of the types related to `MergeParameters` for clarity and future maintainability.
- Add JSDocs for types related to `MergeParameters`.
- Add `dependencyRecomputations` and `resetDependencyRecomputations` to unit tests.
- Add type expansions to `createStructuredSelector` to improve visibility during hover-previews.
- Add `DefaultMemoizeFields` with `clearCache` in order to centralize definitions.
- Add more units tests for `createStructuredSelector`.
- Update JSDocs for:
  * `createStructuredSelector`
  * `defaultEqualityCheck`
  * `CreateSelectorOptions.memoize`
  * `CreateSelectorOptions.argsMemoize`
  * `OutputSelectorFields`
  * `weakMapMemoize`
  * `autotrackMemoize`
src/types.ts Outdated

/**
* Resets the count of {@linkcode OutputSelectorFields.recomputations recomputations} count to 0.
*/
resetRecomputations: () => 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✋ Nitpicking a bit. I know these reset methods do return 0 because of the shorthand logic, but conceptually they really oughta be () => void

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think I should change the implementation to

resetRecomputations: () => {
  recomputations = 0
}

@markerikson markerikson merged commit a39a97a into reduxjs:master Nov 21, 2023
15 checks passed
@aryaemami59 aryaemami59 deleted the v5-final-type-changes branch December 17, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants