segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.39k stars 832 forks source link

move @types/* dependencies to devDependencies #1273

Closed krijoh92 closed 3 years ago

krijoh92 commented 3 years ago

Overview Moved @types/react and @types/react-transition-group to devDependencies instead of depdendencies, this way those types shouldn't interfere with typescript builds of projects using evergreen.

Documentation

netlify[bot] commented 3 years ago

✔️ Deploy Preview for evergreen-storybook ready!

🔨 Explore the source changes: fc4ecbb6cd7c843f1b495e6b4a643cd9ac301ad0

🔍 Inspect the deploy log: https://app.netlify.com/sites/evergreen-storybook/deploys/60f556fdebdf33000725ccaf

😎 Browse the preview: https://deploy-preview-1273--evergreen-storybook.netlify.app

krijoh92 commented 3 years ago

Ok, we are getting a lot of errors like this:

node_modules/evergreen-ui/node_modules/@types/react/index.d.ts:3237:13 - error TS2717: Subsequent property declarations must have the same type.  Property 'stop' must be of type 'SVGProps<SVGStopElement>', but here has type 'SVGProps<SVGStopElement>'.

3237             stop: React.SVGProps<SVGStopElement>;
                 ~~~~

  node_modules/@types/react/index.d.ts:3238:13
    3238             stop: React.SVGProps<SVGStopElement>;
                     ~~~~
    'stop' was also declared here.

when building with Evergreen, just assumed it was because of the @types/react being in depdendencies.

changing skipLibCheck from false to true solved it for us though, so I guess that's the workaround for us.

mshwery commented 3 years ago

@krijoh92 what version(s) of evergreen, react, @types/react?

krijoh92 commented 3 years ago
evegreen: 6.1.0
react: 17.0.2
@types/react: 17.0.14

That's probably the issue, different versions in react & types for react so there's a different version installed in evergreens node_modules folder in our project

mshwery commented 3 years ago

Ah yep! Evergreen isn't ready for React 17 yet either due to some of its deps. Will be soon though!

krijoh92 commented 3 years ago

Ah ok, missed that part :) But haven't experienced any other issues from using Evergreen with React 17 though :+1: