parse-community / node-apn

Apple Push Notification module for Node.js
Other
177 stars 64 forks source link

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

Open TysonAndre opened 3 years ago

TysonAndre commented 3 years ago

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?

davimacedo commented 3 years ago

Yes. I think that it makes sense and I'd be glad to review a PR.

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this issue!

mtrezza commented 1 year ago

Added a bounty so hopefully someone will pick this up.