reselect icon indicating copy to clipboard operation
reselect copied to clipboard

Help wanted with Typescript PRs

Open ellbee opened this issue 10 years ago • 12 comments

There are a couple of outstanding PRs that I don't feel qualified to review (#123 and #115) relating to Typescript. It would be great to give someone commit access to the project who has Typescript experience and feels able to review and merge these PRs. Would anyone like to help out?

ellbee avatar May 03 '16 17:05 ellbee

I can review. I'm fairly new to Typescript, but the library's small enough that it shouldn't be a problem.

threehams avatar Jun 15 '16 15:06 threehams

@threehams That would be awesome. Thank you.

ellbee avatar Jun 15 '16 19:06 ellbee

I'm going to start contributing some work to the declaration files, so it might be good to have a second collaborator, as well.

threehams avatar Jun 23 '16 14:06 threehams

Not sure who is really to blame for this but please don't put breaking TS changes in dot releases. https://github.com/reactjs/reselect/commit/87df18a56554b49f607ca36f99ffbaea5351ce71 added a mandatory TProps generic parameter between 2.5.1 and 2.5.2 which causes TS to fail to compile when using the old version. Not good at all!

b-smets avatar Jul 04 '16 10:07 b-smets

The work involved for types in 3.0 is very little, but I'm really concerned about reducing the number of exported types from the definition file. At the moment, internal and external interfaces are mixed together, and it's possible (likely?) that some people are importing and using types meant to be internal in their projects.

I'm also starting to think that including type definitions in a non-Typescript repo may not be the best idea, as narrowing types over time - especially as new features come out in 2.1 and beyond - requires major version releases in Reselect itself, even though the library itself hasn't changed at all.

Immutable.js has a similar problem. The type definitions in the repo are backwards compatible with 1.6, even though improvements in 1.8 - 2.0 (especially the polymorphic this type) make for much better definitions.

Some opinions here from @ellbee or anyone in the community would be greatly appreciated.

threehams avatar Oct 31 '16 18:10 threehams

@threehams I totally agree with you. It would be great if we could specify different definition file for each TS version in typingns field of package.json.

For the time being, we can still keep separate versions of definitions in this repo, but only put to package.json the one that doesn't break semver. Users can pick the version they need via Typings.

aikoven avatar Nov 01 '16 14:11 aikoven

I've been maintaining custom typings for reselect for my projects and can contribute them.

Also consider that TS 2.1 will include Mapped types that would allow us to correctly type createStructuredSelector.

aikoven avatar Nov 11 '16 08:11 aikoven

@threehams I am unsure on best practices here, for Typescript and Flow, so I will follow the lead of someone who knows what they are doing.

@aikoven You have commit access, right? I would be happy for you to handle the Typescript stuff if you are up for it.

ellbee avatar Nov 13 '16 16:11 ellbee

@ellbee Ok, I'm on it. Are there any API changes for 3.0?

aikoven avatar Nov 14 '16 15:11 aikoven

@aikoven Thank you!

There is a slight change here:

https://github.com/reactjs/reselect/commit/f63e49c7b48bd91e4d11ad72851bba089fe3e563

ellbee avatar Nov 15 '16 13:11 ellbee

I updated the type definition file as well https://github.com/reactjs/reselect/pull/224, Is it necessary to keep this issue open ?

alex3165 avatar Mar 09 '17 10:03 alex3165

No, let's close it down. Thanks to everyone who helped!

ellbee avatar Mar 09 '17 12:03 ellbee