-
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
Angular CLI compiler requires older Typescript #7625
Comments
Newly created project with |
Is this requirement valid? My project looks fine with [email protected] and I was planning to go for 2.5.x but now I am not sure if it is a good idea. |
Anyway it would be good if @angular/compiler-cli would define the correct peer dependency here: https://github.com/angular/angular/blob/4.4.x/packages/compiler-cli/package.json#L17. Not everybody is using angular-cli. I can understand the safety check, but I am not sure the matrix linked by kuncevic should be the correct place to specify the requirements. |
There were no indications that this restriction would be implemented. The only thing I updated in my project was the CLI. The @angular/[email protected] has no problems previously. |
These versions shown in the warning are the ones recommended by the Angular team. A lot of bugs that are reported are actually the result of using incompatible versions, and it is not clear at all what these versions are. This is not a new restriction: incompatible versions have caused problems for a while now. It is true that other typescript versions may work in your particular project - but we cannot guarantee they will work. That is why we show a warning now (but not an error). It became more important to alert users to what the recommended versions are because Angular version 5 is coming out and it has its own recommend set of typescript versions. There are two factors preventing simply adding a strict dependency:
So it was better to show a warning than to prevent usage of other typescript versions. If you feel confident that your project should work with other versions of typescript, you can disable the warning. This is useful when using versions of libraries that specifically need typescript of a certain version for compilation to be successful. |
@filipesilva : Thanks for the high-level explanation. For those of us who wish to "scout ahead" using TypeScript versions beyond what is recommended, is there a place where any known issues (with or without a fix/work-around) have been documented? |
@filipesilva See also #7678 which would help a lot related to the warning. |
Hi guys... Node: 8.4.0 But as we can see in the package.json of angular/compiler-cli, it saids, in its peerDependencies, that it needs typescript ^2.0.2, and [email protected] should meet this requirement |
Maybe the A CLI project may now cause more confusion:
|
In my case I am quite used to work with the spread operator, also using it to pass parameters to functions, and I need to use Typescript@>=2.4.0 to compile a project created with Angular CLI 4.3.6, as this issue was resolved in TypeScript 2.4 microsoft/TypeScript#5296. But the reasoning given is quite valid, and you can upgrade TypeScript per project to see if it fits for you or not. Thanks, and keep the good work team ❤️ |
* This is due to a bug about spread operator usage fixed on TypeScript 2.4.0 (microsoft/TypeScript#5296) * With this change now a warning will be given about the TS version used. This is expected, you see the discussion about it on angular/angular-cli#7625
@dherges that's actually a limitation of the CLI architecture currently... the CLI (specifically ngtools/webpack) really wants to use the local project typescript, but the global CLI doesn't have a local project and thus it would have missing peerdeps. The answer is, of course, to have two CLI packages: one for global and one for local, installing different dependencies. This is a goal for CLI 2.0, but would be disruptive now so we don't do it. |
Would the global CLI pick up a global typescript as peerDep?
Cheers, David
… On 2. Oct 2017, at 12:29, Filipe Silva ***@***.***> wrote:
@dherges that's actually a limitation of the CLI architecture currently... the CLI (specifically ngtools/webpack) really wants to use the local project typescript, but the global CLI doesn't have a local project and thus it would have missing peerdeps.
The answer is, of course, to have two CLI packages: one for global and one for local, installing different dependencies. This is a goal for CLI 2.0, but would be disruptive now so we don't do it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
It would, but asking people to install both the cli and typescript globally isn't a good solution either imho. |
@dherges it almost always did, except when the dependency wasn't hoisted. That PR is meant to address that case. |
It seems this is still the case today that the latest Angular Compiler requires an older version of TypeScript, but just the compiler. I mean we are talking minor version limitations not major versions this seems odd. It should require just a min or greater version and block the next major version. Currently today you get this error:
Seem like it should just require TypeScript >=3.1.1 and <4.0.0 until there is a broken minor release which would hopefully be rare. Should we just always assume that if we want to use the latest stable release of Angular we always have to run versions behind the latest stable version of Typescript? |
@CreepyGnome, Typescript minor version can be breaking and that's why we only support versions that have been released. |
Currently, it doesn't support anything newer than 3.2.4 and there have been other released versions since then. The current released version is Typescript 3.4.5. So based on your statement shouldn't Typescript 3.4.5 be supported then? |
It is supported in version 8 release candidate. |
Closing the initial reported issue should be solved by now. If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
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. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.4.0
node: 8.4.0
os: darwin x64
@angular/animations: 4.3.6
@angular/cdk: 2.0.0-beta.10
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/material: 2.0.0-beta.10
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.4.0
@angular/compiler-cli: 4.3.6
@angular/language-service: 4.3.6
typescript: 2.5.2
Repro steps.
Start up app with
ng serve
and this message is displayed:The text was updated successfully, but these errors were encountered: