Skip to content

First-class Typescript support #723

Open
@dougwilson

Description

@dougwilson

Traditionally for the express ecosystem, typescript definitions have been created and maintained by great contributors to the DefinatelyTyped project. Types would be pulled in under a scope @types, separate from the module itself (@types/express-session, for instance).

These types are of various quality and many of the express community (like myself) is not familiar with (or use) Typescript, so don't know about it / would be able to identify an issue there.

@HoldYourWaffle graciously has worked on fixing up the type definitions for this module and created PR #656 to add the definitions to the module package directly.

This brings up languishing sticking points for the longevity of this, of course, that I would like to discuss to understand as the package maintainer.

Preface: Since the types would become part of the package, a given version with some new function signature would need a corresponding definition update. Failure to do so would mean a follow up release would need to me made (after eventually someone in typescript community tries to use it and then realizes, opens an issue, etc.). Under the @types a new version of the definitions would need to be published to add a new signature, which seems natural if the project doesn't keep them up.

That brings my thoughts always to the following: How can we prevent this "fatigue" between the maintainer and the typescript users?

Is there some kind of automation that could be added to make a PR fail if type definitions were not updated correctly? Or maybe someone who can commit for at least some kind of long-haul, like at least a year, to review PRs / changes as they come in and maybe even provide what the corresponding type change is?

I'm not sure, of course, about the above being disconnected from typescript.

(note @HoldYourWaffle , this entire thread is a meta discussion, unrelated to actually landing your PR into this module, but related to it's protentional future removal if problem arise and there is no solution in place).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions