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

@rematch/select type error. #945

Open
NoahStepheno opened this issue Nov 3, 2021 · 8 comments · May be fixed by #948
Open

@rematch/select type error. #945

NoahStepheno opened this issue Nov 3, 2021 · 8 comments · May be fixed by #948

Comments

@NoahStepheno
Copy link

NoahStepheno commented Nov 3, 2021

Describe the bug

I use @rematch/select in my project of typescript. const selection = store.select(/* ignore */). The type of selection is any.

Reproduce Link

https://codesandbox.io/s/magical-goldwasser-reg5l?file=/src/AppWithHooks.tsx

To Reproduce

  1. Go to 'all-plugins-react-ts'
  2. add a selection
  3. use a useSelector to get a state
  4. See the type error

Expected behavior

show the right type

Screenshots

image

Desktop

  • OS: macOS
  • Browser: chrome
  • Version: 91.0.4472.77

Additional context

I realized that the problem is on 'reselect'. After upgrading to 4.1.1, @rematch/select get a type error. But in the monorepo packages. It will always install 4.0.0 'reselect', and do not get this error.

@semoal
Copy link
Member

semoal commented Nov 5, 2021

Reselect changed his internal typings in a minor version, and that probably caused our @rematch/select typings to fail.
We'll need to look into this more deeply.

@semoal semoal added bug triage: accepted typings typings issue version-2 Version 2.X.X labels Nov 5, 2021
@NoahStepheno
Copy link
Author

I'm willing to fix it. But I'm new here, perhaps need your help.

@semoal
Copy link
Member

semoal commented Nov 9, 2021

@tianzhich

@tianzhich
Copy link
Collaborator

I'm willing to fix it. But I'm new here, perhaps need your help.

No problems. Feel free to ask here for any questions you encountered.

@tianzhich
Copy link
Collaborator

To be honest the rematch doesn't 100% compatible with reselect. There are so many @ts-ignore in the codebases. If you are familiar with reselect we could try to fix them together.

@semoal
Copy link
Member

semoal commented Nov 9, 2021

To be honest the rematch doesn't 100% compatible with reselect. There are so many @ts-ignore in the codebases. If you are familiar with reselect we could try to fix them together.

With old reselect we weren't, but with new reselect we could be 100% compatible, now his types are so easily compared to older ones. (They passed from 1000 lines to just 115)
https://github.com/reduxjs/reselect/blob/master/src/types.ts

They rewrote his codebase to TS and now they're only compatible with TypeScript 4.2+. We could ship a fix for this on a major version of @rematch/select,

In this way our users could use:

  • Rematch + Reselect(<4.1.0) + @rematch/select (3.0.0 - current) with an older TypeScript version .

And other users could use:

  • Rematch + Reselect(>=4.1.0) + @rematch/select (4.0.0 - next)

What do you think? I think is worth it to invest in this, we keep a better development line than RTK.

@NoahStepheno You can read CONTRIBUTING.md how to clone, setup, and work with Rematch codebase. Feel free to ask anything on Discord or here if you feel stuck.

@tianzhich
Copy link
Collaborator

That was great. Yes - It's worth investing in this.

@semoal semoal linked a pull request Nov 14, 2021 that will close this issue
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy