-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Automatically install @types/react-redux as a dependency #1699
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
Conversation
Size Change: 0 B Total Size: 26.5 kB ℹ️ View Unchanged
|
Deploy preview for react-redux-docs ready! Built with commit 82b2d69 |
@markerikson Why was it added to "dependencies" instead of "devDependencies"? Types are needed only for development. In the product I work on we have a tool that treats "dependencies" as something that potentially could go into the final bundle and it reports @types/react-redux, which of course will not be included in the bundle :/ |
@MBelniak Please read the post above by Mark. We're favoring developer experience for those types. In 8.0, we'll be written directly in TS and will have types embedded in the package. |
@timdorr devDependencies are installed as well. Anyway, I've just noticed that this was fixed here: https://github.com/reduxjs/react-redux/pull/1766/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519 :) Sorry for disturbing, it will be all fine in the next release :D |
No, they're not, and that's exactly the point. Look at our https://github.com/reduxjs/react-redux/blob/v7.2.4/package.json#L57-L97 It includes Babel, Jest, ESLint, and many more. I can assure you that when you So, the whole reason we added |
@markerikson OK, this is simply my misunderstanding. What I meant is that when you work on react-redux and run |
This PR:
@types/react-redux
, so that any user who installs the main lib automatically gets the types.This is a trick I saw from Tanner Linsley and Kent C Dodds, and should resolve cases where users forgot to install the typedefs as well. Given that we're not rewriting in TS until we work on a v8 release, and we aren't planning to bring the typedefs over here any time soon, we might as well make sure they're available all the time.
Also, I tweaked the Prettier config to ignore line endings, because suddenly ESLint claimed that every single line of code in my local environment had the wrong line endings :(