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

build: update to TypeScript 4.8 #25505

Merged
merged 1 commit into from
Aug 21, 2022
Merged

build: update to TypeScript 4.8 #25505

merged 1 commit into from
Aug 21, 2022

Conversation

crisbeto
Copy link
Member

Updates the repo to TypeScript 4.8 and resolves some of the breaking changes. I've only kept the schematics code backwards-compatible since the rest of the changes are to our own tooling.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release labels Aug 20, 2022
@crisbeto crisbeto force-pushed the ts-4.8 branch 9 times, most recently from 5f2b966 to 987462f Compare August 20, 2022 21:18
@@ -44,7 +44,7 @@
"karma-jasmine-html-reporter": "~1.7.0",
"selenium-webdriver": "3.6.0",
"ts-node": "~10.7.0",
"typescript": "file:../../node_modules/typescript",
"typescript": "~4.7.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to lock down the TS version of all of these integration tests, because the CLI hasn't been updated to handle 4.8 yet.

@crisbeto crisbeto marked this pull request as ready for review August 20, 2022 21:24
Updates the repo to TypeScript 4.8 and resolves some of the breaking changes. I've only kept the schematics code backwards-compatible since the rest of the changes are to our own tooling.
@@ -26,7 +26,7 @@ import {MatDatepickerBase, MatDatepickerControl} from './datepicker-base';
host: {'(click)': '_applySelection()'},
})
export class MatDatepickerApply {
constructor(private _datepicker: MatDatepickerBase<MatDatepickerControl<unknown>, unknown>) {}
constructor(private _datepicker: MatDatepickerBase<MatDatepickerControl<any>, unknown>) {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to go for any here, because 4.7 infers it as unknown while 4.8 infers it as {} and we need to support both.

@@ -730,7 +736,7 @@ export class HammerGesturesMigration extends DevkitMigration<null> {

const sourceFile = rootModuleSymbol.valueDeclaration.getSourceFile();
const metadata = getDecoratorMetadata(
sourceFile,
sourceFile as Ts48MigrationAny,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were causing a type mismatch so I had to temporarily cast to any.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 — can likely remove this code at some point anyway

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this is actually why we wanted to keep to the schematic/angular utilities as part of our sources 🤷

@@ -730,7 +736,7 @@ export class HammerGesturesMigration extends DevkitMigration<null> {

const sourceFile = rootModuleSymbol.valueDeclaration.getSourceFile();
const metadata = getDecoratorMetadata(
sourceFile,
sourceFile as Ts48MigrationAny,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 — can likely remove this code at some point anyway

@@ -730,7 +736,7 @@ export class HammerGesturesMigration extends DevkitMigration<null> {

const sourceFile = rootModuleSymbol.valueDeclaration.getSourceFile();
const metadata = getDecoratorMetadata(
sourceFile,
sourceFile as Ts48MigrationAny,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this is actually why we wanted to keep to the schematic/angular utilities as part of our sources 🤷

@@ -218,17 +218,17 @@
"tsickle": "0.39.1",
"tslint": "^6.1.3",
"tsutils": "^3.21.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is tsutils still used somewhere now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing we're using it for now is to iterate over the comments of a node which we may be able to refactor as well, but the tsutils implementation seemed a bit more involved to me so I decided to leave it.

@crisbeto crisbeto self-assigned this Aug 21, 2022
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 21, 2022
@crisbeto crisbeto merged commit e2a1216 into angular:main Aug 21, 2022
crisbeto added a commit that referenced this pull request Aug 21, 2022
Updates the repo to TypeScript 4.8 and resolves some of the breaking changes. I've only kept the schematics code backwards-compatible since the rest of the changes are to our own tooling.

(cherry picked from commit e2a1216)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants