Luxon: Typescript support

Created on 7 Apr 2018  路  11Comments  路  Source: moment/luxon

This is a kind request to write the source in TypeScript and/or provide external type declarations for the library.

Most helpful comment

Well I guess unless Luxon is written in TypeScript in the future and the definitions generated automatically by the compiler, the issue will remain.

(hint: if you want to make the move, I'd be super happy to do the port to TypeScript myself)

All 11 comments

OK, I'll take that to mean you reject the idea of rewriting or supplying the types here. In other words, you will continue to require a third-party to write these types?

@ShawnTalbert sorry for the terseness. Yes, types will stay third-party.

10-4, thanks for clarifying!

@icambron what is the reasoning behind not maintaining the definitions there? It's quite easy - the definitions already exist and you and us would just have to update it when something substantial change.

The current situation is very problematic - as it is for every libraries that rely on third party to provide their definitions: we can't benefit from any of the features you add or bug you fix until someone provide a PR to DefinitelyTyped and this PR is merged and a release is made. We currently face the issue with isInLeapYear getter that is not in the definition - I made a PR to fix that but nobody knows when it will be available in npm and in the meantime we just can't build our own products that depends on Luxon.

we can't benefit from any of the features you add or bug you fix until someone provide a PR

That is true regardless of where it lives, because I'm not going to maintain the definitions, and I'm not going to demand that contributions alter them. And I don't want a bug report each time I add a feature. I have no TypeScript or Flow expertise and won't be able to judge the quality of the PRs or decide when to merge them. It's not that I'm against TypeScript or Flow; it's just a bunch of work I'm not into.

We went through this with Moment and it was a big drain. Stuff piled up until one of the maintainers just made working through TS issues his mission.

Well I guess unless Luxon is written in TypeScript in the future and the definitions generated automatically by the compiler, the issue will remain.

(hint: if you want to make the move, I'd be super happy to do the port to TypeScript myself)

Yup, for me no TypeScript means I won't be using this library. Just sayin.

@ShawnTalbert It's a bit extreme. Twing, written in Typescript, is using Luxon for nearly everything date-related and it works perfectly. The DefinitelyTyped definitions work fine so there is no point in avoiding Luxon because it's not written in TS.

not extreme at all, as there are already alternatives which do provide typings.

date-fns is not timezone aware...

Was this page helpful?
0 / 5 - 0 ratings