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

fix: lock Typescript to 3.6.0 #6810

Merged
merged 1 commit into from Sep 30, 2020

Conversation

imnotjames
Copy link
Contributor

@imnotjames imnotjames commented Sep 30, 2020

Because of a breaking feature in Typescript 3.7.0 we cannot upgrade
past that without marooning users of Typescript 3.5 / 3.6 & 4.0+

this locks typescript to ~3.6.0 explicitly and fixes some small
issues that arise in using that version

fixes #6809
fixes #6805

@imnotjames
Copy link
Contributor Author

):

It looks like the only safe upgrade path is directly to 4.0 & requiring all users of TypeORM with Typescript to use 4.0+?

@imnotjames
Copy link
Contributor Author

nestjs ran into this issue as well nestjs/nest#3513

The issue about this in Typescript is microsoft/TypeScript#33939 but was closed as working as intended. Unfortunately, the backwards compat break in a minor release was the intended outcome.

Because of a breaking feature in Typescript 3.7.0 we cannot upgrade
past that without marooning users of Typescript 3.5 / 3.6 & 4.0+

this locks typescript to ~3.6.0 explicitly and fixes some small
issues that arise in using that version

fixes typeorm#6809
fixes typeorm#6805
@pleerock pleerock merged commit 7f7e4d5 into typeorm:master Sep 30, 2020
@pleerock
Copy link
Member

I guess I need to release a new version?

@imnotjames
Copy link
Contributor Author

😢 yes, apologies on it being so soon.

@imnotjames
Copy link
Contributor Author

Ideally we get some folks confirming this as well - I checked against TS 4.0.3 myself and it seemed fine?

@pleerock
Copy link
Member

there are many 👍 on that issue, so I guess there is a problem.

@bryantbiggs
Copy link

so can typeorm be used with TS v4.0.x or no?

@imnotjames
Copy link
Contributor Author

imnotjames commented Oct 17, 2020

It should work for you but it's not officially supported yet. We transpile using 3.6 but it should be compatible with 4.0 - we don't run tests to confirm that.

@imnotjames imnotjames deleted the fix/downgrade-typescript branch October 17, 2020 20:47
@bryantbiggs
Copy link

perfect, thanks

@pleerock
Copy link
Member

yes, of course it does support 4.x. This PR is only about used compiler version for the internal development.

@nebkat
Copy link
Contributor

nebkat commented Nov 23, 2020

Could we consider using https://github.com/sandersn/downlevel-dts and "typesVersions" in package.json to fix this? We would benefit a lot from TypeScript 3.7's optional chaining and nullish coalescing to replace the hundreds of options && options.option in the repo, and I'm sure some later features too.

Since it's only a matter of having the .d.ts files correctly parsed we could easily add an extra test for every TS version down to the minimum that is supported, which will prevent accidents like this in the future.

zaro pushed a commit to zaro/typeorm that referenced this pull request Jan 12, 2021
Because of a breaking feature in Typescript 3.7.0 we cannot upgrade
past that without marooning users of Typescript 3.5 / 3.6 & 4.0+

this locks typescript to ~3.6.0 explicitly and fixes some small
issues that arise in using that version

fixes typeorm#6809
fixes typeorm#6805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants