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

Types broken for TypeScript < 3 #135

Closed
mockdeep opened this issue Jan 17, 2019 · 9 comments
Closed

Types broken for TypeScript < 3 #135

mockdeep opened this issue Jan 17, 2019 · 9 comments

Comments

@mockdeep
Copy link

When we upgraded immutability-helper to version 2.9.0, our TypeScript build broke with the following error:

node_modules/immutability-helper/index.d.ts:25:57 - error TS1110: Type expected.

25     $splice: Array<[number, number?] | [number, number, ...T[]]>;
                                                           ~~~

I'm wondering if this is a syntax that is was added in TypeScript 3, as we're still on 2.8.3.

@jednano
Copy link
Collaborator

jednano commented Jan 17, 2019

That is a new syntax, yes. 2.8.3 is pretty far behind. Have you talked about upgrading? @kolodny it looks like the release was not backwards compatible for TS projects < v3. Maybe we can backport a fix and bump the version of this package to a major?

@mockdeep
Copy link
Author

@jedmao Yeah, we'd like to upgrade, but when we last tried it turned out to be a complicated mess with Webpack and other dependencies, so we shelved it until we've got more time for it. TS3 was released less than 6 months ago, so it seems like 2.8 might still be in the support window for most libraries.

@kolodny
Copy link
Owner

kolodny commented Jan 18, 2019

Is there some way to provide different typings for older TS versions? If there is then we can just use the pre typescript versions since those seemed to work fine

@jednano
Copy link
Collaborator

jednano commented Jan 18, 2019

Yeah we can tell people to lock their versions and all, but it doesn't change the fact that this "minor" version bump just broke something.

@kolodny
Copy link
Owner

kolodny commented Jan 18, 2019

Hmm, in that case, I'd suggest reverting the last change and publishing another minor version and then republishing the current as a major version bump

@jednano
Copy link
Collaborator

jednano commented Jan 18, 2019

Need to publish a new "patch" version, not a minor version, so 2.9.1 will have the fix and then 3.0 will be really the same as 2.9.0.

@jednano
Copy link
Collaborator

jednano commented Jan 18, 2019

It might even make sense to create a 2.x branch and publish off of that with the revert so you don't have to change master and then subsequent updates can just go on master and fixes can go on the older 2.x branch.

@mockdeep
Copy link
Author

Unfortunately, I don't know that that really helps us. If it's about needing to lock to a version, we can do that now. The ideal for us would be that we could continue to upgrade immutability-helper independent of TypeScript, at least for a while longer. I guess there's no hard and fast rule for how long to maintain backwards compatibility, but for something as widely used as TypeScript, it seems like that window should be on the order of 9 months or more for a major version bump.

It's not a big deal, but we do try to keep the bulk of our libraries up to date. So far, this is the first library we've run into that needs to be locked due to TS support, aside from the direct TS dependencies.

@kolodny
Copy link
Owner

kolodny commented Jan 24, 2019

The 2.x branch should now be safe for ts@2 users. Closing for now since there isn't much else to do for this. Feel free to reopen is your issues can be further addressed. Thanks!

@kolodny kolodny closed this as completed Jan 24, 2019
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

No branches or pull requests

3 participants