-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Support TypeScript 3.7 #16071
Comments
Blocked until Angular FW supports TS 3.7 |
Related to angular/angular#33596 and angular/angular#32962 |
If you're using the framework/CLI RC and Ivy, you might be able to just use TypeScript 3.7 directly. You'll get a peer dependency warning but in all likelihood it'll just work. Ivy is far less sensitive to TypeScript version changed than View Engine. Let me know if you try this and run into problems. |
Updating the dependency to 3.7.2 results in the following error:
I'm using the "nextest" version of Angular (9.0.0-rc.1) So it does not work. :( |
Yeah you're right, that error did not appear before when I tested it and I guess that was a bug. To get around it, add the
This way there will be no TS version error. |
I upgraded to 3.7 and followed the advice of @filipesilva to get rid of the Typescript version error mentioned by @JensMagnus. This was enough to get the site compiling. But when I load the site in a browser now I'm getting this error in the console:
It's hitting the error at the templateUrl line when defining a component.
|
@cconcise I add this in my // @ts-ignore
window.__importDefault = function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
}; |
Interesting error. I haven't seen it before, and we will have to test for it when adding support for TS 3.7. Thank you for reporting it. |
@xiaoxiangmoe, did you write this fix yourself or where is this coming from? I can confirm it works. |
I tried using a |
@MatthiasKunnen I copy code from example-8 var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
} |
@filipesilva Error in line Step to reproduce:
|
Please note that this should only be attempted when using 9.0 (currently in RC) or higher with the Ivy renderer enabled (the default for 9.0+). |
My initial testing shows that TypeScript 3.7 does, indeed, work once the |
Followed steps here, added the polyfill code from @xiaoxiangmoe and disabled Typescript version checking in my NX project with dependencies: angular-cli 8.3.19, angular core 8.2.14, nx 8.7.1. Both Dev and build work fine. I have been waiting for Optional Chaining for ages and now finally! |
@rexebin have you faced any issues in particular with Angular with the Typescript version check disabled? We are using Angular 8.2.5 and would like to know if there are any side effects. Thanks! |
I've been using 3.7.2 since it was out on Angular 8 without problem. Only
the workaround mentioned in the thread was required.
…On Thu, Dec 19, 2019, 18:52 Shubhangi-Priya ***@***.***> wrote:
@rexebin <https://github.com/rexebin> have you faced any issues in
particular with Angular with the Typescript version check disabled? We are
using Angular 8.2.5 and would like to know if there are any side effects.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16071?email_source=notifications&email_token=AEAHNI7EUIMYPPW5FV22GF3QZOYEJA5CNFSM4JJGAV5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHKM3HI#issuecomment-567594397>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEAHNI53ZUIQ435I3Z76G5TQZOYEJANCNFSM4JJGAV5A>
.
|
@Shubhangi-Priya My project is not a small one and so far there is no issues or side effects using Typescript 3.7+. |
Hey im having a problem. I using Angular 8.2.14 with ThreeJs r112. Now ThreeJs needs Typescript 3.7.x, but angular will not support it and i cannot downgrade ThreeJs. So im not able to make a build. Here is another thread where I asked https://discourse.threejs.org/t/using-vr-in-r110-or-angular-8-r112-not-working/12155/3 |
@Fluqz you should be able to use TS 3.7.4 with Angular 9.0.0.rc.9. I'm not familiar with ThreeJs so it's hard to talk about it. I took a look at the thread you linked and saw you mentioned this error:
Those errors seem to come from typescripts Looking over the TS issue tracker I can find issues with a similar messages: DefinitelyTyped/DefinitelyTyped#33672 and DefinitelyTyped/DefinitelyTyped#40995. It suggests the problem is related to the |
@angular/cli compatibility is based on commits here: https://github.com/angular/angular-cli/commits/master/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript |
@filipesilva thanks for your fast answer! I just updated to TSC 3.7.5 but no success. I also made a completely new Angular project with version 8.2.11. I installed threejs r112 and tried to make a build. It failed! Then I added the polyfill, the disableTypeScriptVersionCheck option and updated to TSC 3.7.5 and "babam" it worked again. What else can I provide from the non-test project to help identify the cause? |
@Fluqz Can you give me a minimal reproducible demo? |
@eternalmatt that's not quite right. It's true that we do keep a vendor version of typescript in the Angular CLI repository, but it's used exclusively for schematics. That version is independent from the version that the Angular Framework itself supports. What ends up determining if Angular CLI supports a certain version of TypeScript is mostly testing after the framework adds support, and updating new projects to use the new version. @Fluqz I don't think you'd need disableTypeScriptVersionCheck now. I guess if you got the minimal repro working, then it's a matter of either adding stuff to it until it breaks, or removing stuff from your real app until it doesn't break. If I had to bet though, it might be some residual stuff in your real app from past experimentations. |
@xiaoxiangmoe No, I dont know how to reproduce the issue unfortunately. |
@Fluqz that error only happens if you're not using rc.9 of angular packages. You can find what angular packages you are using by running |
@filipesilva but it is actually working with my testproject. I can build with tsc 3.7.5. Both test and real app are at ng version 8.3.23 (in package.json its at 8.2.11)? Anyway im gonna try the same at 9.0.0-rc.9 again |
I just solved it by cleaning up my package.json & angular.json. Being on Ng 9-rc.9 and tsc 3.7.5. Pretty sure tween.js was the problem. Thanks alot! |
Glad to hear it's sorted. It's not very hard to end up with weird sets of deps with npm/yarn after a bit of experimentation. |
Hey all, Starting with |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🚀 Feature request
Command (mark with an
x
)Description
With the release of TypeScript 3.7, I (and I imagine many others) are eager to upgrade to the latest TypeScript version. Features like optional chaining and nullish coalescing are very compelling.
Describe the solution you'd like
Update build_angular to support TypeScript 3.7 (latest release as of this writing supports only 3.6).
The text was updated successfully, but these errors were encountered: