-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
TS 3.7: --declaration output for getter only property now is a getter instead of readonly
#33939
Comments
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
I just noticed this as well. The problem is that when I use our own library with the "getter-syntax", I get an error:
What is the recommended way of getting around that? |
I have the same issue with 3.7 .. importing the types is now not possible |
@matthiasg It seems that they knew the typings were incompatible. I'm quite surprised that there was no mention of this anywhere (or did I overlook it?). #33470 I ended up writing a small script for our CI that replaces the new syntax with the old one as a temporary solution. |
This will prevent my library from upgrading to 3.7.x until all my customers are also using 3.7.x (and they include Angular folks who won't be upgrading Angular anytime soon). |
I'm also getting TS1086 when trying to use npm libraries with the "getter syntax" - could someone please give some guidance around this/can this be reopended? |
This seems like a fairly significant breaking change, and is biting a lot of our customer: I understand it's working as intended, but I question why this was released in a minor release of the library, vs., a 4.x release like @GordonSmith mentions. |
@RyanCavanaugh is there any other any guidance here (other than re-target to 3.6 or lower)? At least this should be documented somewhere... this is blocking up from using libraries compiled with 3.7 with our current Angular projects. |
Also having the same issue in an Angular project. |
Also got bit by the sudden breaking change through an Angular project (TS 3.5) referencing a library built by 3.7 with breaking definitions. Solved by bashing the library provider until he rolled back to TS 3.6. Just for reference, TS 3.7 support in Angular projects is handled by angular/angular-cli#16071. |
Why is this issue closed? This PR should be reverted as soon as possible due to the breaking change it introduced. I can't update TS to 3.7+ in NestJS as well because people with TS 3.7 < won't be able to use it (see nestjs/nest#3513). The only existing solution is to downgrade TypeScript and don't use the latest version. |
I agree. This issue is causing major headaches throughout the library vendor community. The change should be opt-in and maybe tied to the new |
@RyanCavanaugh |
First, I read a bad information on Stackoverflow : tsc - v will not give you the version of TypeScript used in an Angular project, rather ask "ng version". |
@Gluups Don't think it's relevant to this issue, but you probably have If you still experience the error |
"npx tsc -v" tells me "3.5.3" package.json : ng version : |
Hum, that promises to be an adventure, does not it ? Anyway thank you for your answer. |
This is why typescript 3.7 does not produce not backwards-compatible typings imo. You need to upgrade to typescript 3.7 and the latest version of angular 9 which will work in your case I guess. |
I realize something. As the project already has worked properly, one reasonable solution is to restore package.json from the backup, and then run "npm install" -and surely not "npm update". Well, in the project there are some dependencies marked deprecated and others marked vulnerable, but this is another story -that can lead me back here of course. |
i guess breaking changes in minor versions are a new trend, are they now? Good job typescript team.... please get your stuff together and make stuff like this a major version upgrade next time.... |
The type definitions for postcss 8.x require this. See: microsoft/TypeScript#33939
The type definitions for postcss 8.x require this. See: microsoft/TypeScript#33939
The type definitions for postcss 8.x require this. See: microsoft/TypeScript#33939
* postcss-less: Update for v4.0 The only change in this version is to bump the dependency on postcss to ^8.1.2. * postcss-less: add ES2018.Promise The type declarations for postcss 8.x require this. * postcss-less: Set target: ES5. The type definitions for postcss 8.x require this. * postcss-less: Add self to authors. * postcss-less: Set minimum TypeScript version: 3.7. The type definitions for postcss 8.x require this. See: microsoft/TypeScript#33939 * postcss-less: Update tests for postcss 8.x.
* force Typescript 3.6.5 as >3.7 has getter breaking change forcing all users of this lib to be >3.7 to compile. * they should have made this a 4.x thing see microsoft/TypeScript#33939 otherwise you get: error TS1086: An accessor cannot be declared in an ambient context.
* postcss-less: Update for v4.0 The only change in this version is to bump the dependency on postcss to ^8.1.2. * postcss-less: add ES2018.Promise The type declarations for postcss 8.x require this. * postcss-less: Set target: ES5. The type definitions for postcss 8.x require this. * postcss-less: Add self to authors. * postcss-less: Set minimum TypeScript version: 3.7. The type definitions for postcss 8.x require this. See: microsoft/TypeScript#33939 * postcss-less: Update tests for postcss 8.x.
TypeScript Version: 3.7.0-dev.20191010
Search Terms:
--declaration
Repo:
For the TS file
foo.ts
:tsc foo.ts --declaration
Expected
In TS 3.6, the output
d.ts
usesreadonly
:Actual behavior:
In TS 3.7, the output
d.ts
use a getter instead:The text was updated successfully, but these errors were encountered: