Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Change TypeScript to peerDependency #85

Closed
ianschmitz opened this issue Jun 15, 2017 · 8 comments
Closed

Change TypeScript to peerDependency #85

ianschmitz opened this issue Jun 15, 2017 · 8 comments

Comments

@ianschmitz
Copy link
Contributor

ianschmitz commented Jun 15, 2017

Just a quick suggestion for your package.json that is created as part of a new cra-ts app.

Could we consider changing TypeScript to be a peerDependency in react-scripts-ts and a devDependency in the application's package.json instead of a dependency inside of react-scripts-ts? This would allow the developer to be in control of the version of TS to use, while being able to stay on the latest flavor of react-scripts-ts.

Our company has had issues in the past in a large code base where we've had to stay back a minor version or two of TypeScript to fix issues that prevented us from upgrading.

Cheers!

@wmonk
Copy link
Owner

wmonk commented Jun 15, 2017

This is an interesting question. If you look through past issues, most people are asking the package to upgrade the version os TS - the opposite issue for you!

What that does show though, is that there might be an opportunity to let consumers control their version of TS, while the package dictates a minimum version it supports on creation. I can't think of any issues that may arise from this, but maybe other people can 😄

Would be good to open this to discussion!

@ianschmitz
Copy link
Contributor Author

Yeah I think there's a couple benefits. It allows users to stay back on an older version if needed because of some breaking change in their project. Like I was describing has happened on a very large code base at my company. Stuck on 2.1.5 when 2.3.3 was current and took a significant effort to fix the issues for us to upgrade.

It also allows users to upgrade to the latest without having to release a new version of react-scripts-ts. I'm actually confused as to why this isn't already the case since you guys use the carat versioning to signify any 2.x.

Thanks for considering!

@ianschmitz
Copy link
Contributor Author

Oh I forgot to mention I thought of it since I've used gulp-typescript before which uses this same approach with the peerDependency

@sartaj10
Copy link

Same here. This would be a nice thing to do
I too want to lower the typescript version to 2.3.3 since I'm facing a few issues with the latest version.

@GeeWee
Copy link
Contributor

GeeWee commented Aug 30, 2017

Other side of the story - I'd like to be on typescript@next currently for some compilation performance improvements they've done there.

Being able to specify the typescript version would be really nice.

edit: It actually does seem to pick up on the new tsc if i install typescript@next

@ianschmitz
Copy link
Contributor Author

Are we feeling like this is a change we should make? I'd be happy to submit a PR. We should probably do a major version bump on react-scripts-ts though.

@drager
Copy link

drager commented Oct 22, 2017

I agree with @ianschmitz. This is a change I would also appreciate! I want to use the latest changes of react-scripts-ts but use a slightly older typescript version at the moment.

I use yarn's resolutions to accomplish that today like this:

"resolutions": {
  "**/*/typescript": "2.3.4"
},

@wmonk
Copy link
Owner

wmonk commented Oct 24, 2017

Yep happy to take a PR for this, and will publish a major version 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants