Skip to content

Modernize code (use typescript, use class syntax instead of prototype) #68

Open
@TysonAndre

Description

@TysonAndre

A switch to typescript may make sense in a major version

index.d.ts may get out of sync with the implementation. It may be easier to write everything in typescript and add a publish hook to convert code to typescript
(https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-dynamodb/package.json https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-dynamodb/tsconfig.json)

(the publish hook would trigger a typescript build to dist/ or a subdirectory)

Alternately, with --checkJs, jsdoc can be type checked in CI


Also, class syntax can be used in node 6+ - the upstream code was supporting node 4+ and declared function Client instead of class Client https://github.com/parse-community/node-apn/blob/master/lib/client.js


What are the maintainer's thoughts on those ideas? Would you accept PRs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bounty:$50Bounty applies for fixing this issue (Parse Bounty Program)type:feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions