Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typings, use TypeScript 3.1 #929

Merged
merged 4 commits into from
Oct 17, 2019
Merged

Conversation

adidahiya
Copy link
Contributor

  • Upgrade TypeScript version to 3.1 (this version has been around for quite a while, it's safe to assume your users are on TS 3.1+ at this point, and 3.1 has a lot of bug fixes compared to 3.0)
    • also remove the explicit dependency on typescript, since dtslint pulls it in and you never invoke it directly
  • Enable noImplicitAny in tsconfig.json so that you can check you are using types like React.Component correctly
    • install @types/react to get this to work
  • Remove redundant re-exports in types/index.d.ts
    • Since DateUtils, LocaleUtils, and ModifiersUtils are all already const values in utils.d.ts which are reexported by export * from './utils';, there is no need to explicitly export them
  • Add a README to the types folder to discourage TypeScript users from importing from react-day-picker submodules. This was the reason for the bug in DateTime 3.9.2 datePickerCore.d.ts 'LocaleUtils' type reference error palantir/blueprint#3703: we were importing from react-day-picker/types/utils, which had a breaking change in Fix utils TypeScript types #899. I was able to fix our usage by importing from the module root: [datetime] fix: upgrade react-day-picker, clean up type imports palantir/blueprint#3725

@codecov-io
Copy link

Codecov Report

Merging #929 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #929   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          15     15           
  Lines         659    659           
  Branches      146    146           
=====================================
  Hits          659    659

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a3cef0...8305dee. Read the comment docs.

1 similar comment
@codecov-io
Copy link

codecov-io commented Sep 4, 2019

Codecov Report

Merging #929 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #929   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          15     15           
  Lines         659    659           
  Branches      146    146           
=====================================
  Hits          659    659

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a3cef0...8305dee. Read the comment docs.

Copy link
Owner

@gpbl gpbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you @adidahiya, sorry for the late merge. I'm going fast forward with version 8 which is interely in typescript. I'd love your feedback: #942

@gpbl gpbl added this to the v7.2.0 milestone Oct 17, 2019
@gpbl gpbl merged commit d7ed1f7 into gpbl:master Oct 17, 2019
@adidahiya adidahiya deleted the ad/fix-typings branch October 19, 2019 02:58
@adidahiya adidahiya mentioned this pull request Nov 4, 2019
kimamula pushed a commit to kimamula/react-day-picker that referenced this pull request Aug 17, 2022
* Upgrade TypeScript to 3.1

* Remove explicit TypeScript dependency

* Remove redundant type exports

* Add types/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants