paypal / glamorous

DEPRECATED: πŸ’„ Maintainable CSS with React
https://glamorous.rocks
MIT License
3.64k stars 208 forks source link

Fix typings for Typescript 2.9 #425

Closed aaronjensen closed 6 years ago

aaronjensen commented 6 years ago

@Ailrun I used Exclude since that's 2.8+

Ailrun commented 6 years ago

@aaronjensen So for you, does T extends keyof any look weird? That's why you remove support for TS@>=2.6.2 < 2.8?

aaronjensen commented 6 years ago

@Ailrun no, to be honest, I don't know what the full impacts would be of that change so I didn't want to risk it and given that there won't be much other reason to upgrade glamorous it doesn't seem like a big deal to drop support for <2.8

kentcdodds commented 6 years ago

Can we get the build working before we merge this please? :)

aaronjensen commented 6 years ago

We could yeah, but it has nothing to do w/ this PR, so should it be a separate one? This repo doesn't appear to use a package-lock or a yarn.lock so as new eslint rules get added failures crop up with 0 changes.

Current failures:

[lint] /home/travis/build/paypal/glamorous/src/theme-provider.js
[lint]   16:1  error  componentWillMount is deprecated since React 16.3.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount                       react/no-deprecated
[lint]   16:1  error  componentWillReceiveProps is deprecated since React 16.3.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops  react/no-deprecated
[lint] 
[lint] /home/travis/build/paypal/glamorous/src/with-theme.js
[lint]   16:3  error  componentWillMount is deprecated since React 16.3.0, use UNSAFE_componentWillMount instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillmount                       react/no-deprecated
[lint]   16:3  error  componentWillReceiveProps is deprecated since React 16.3.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops  react/no-deprecated
aaronjensen commented 6 years ago

I actually get even more lint failures locally πŸ˜–

codecov-io commented 6 years ago

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #425   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          10     10           
  Lines         177    177           
  Branches       50     50           
=====================================
  Hits          177    177

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 7c54bbe...b3e75d4. Read the comment docs.

aaronjensen commented 6 years ago

Tests are passing now with the deprecated lints being ignored. Maybe a follow-up PR could deal w/ it properly (which would probably require bumping the minimum version of react required)