-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build: ensure components can be built with ivy strict template type checking #16373
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
Conversation
0afcf02
to
149faa0
Compare
149faa0
to
fe5761c
Compare
<input matInput [matDatepicker]="datePicker4" [value]="date" [min]="minDate" | ||
[max]="maxDate" [matDatepickerFilter]="filterOdd ? dateFilter : null"> | ||
<!-- | ||
TODO for reviewer: Angular sets the inputs for both directives on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to talk about this at the framework meeting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there an outcome from the discussion of this at the framework meeting? This is an issue that I'm still running into and I don't have a solution.
@@ -97,7 +97,7 @@ <h2>Options</h2> | |||
<button mat-raised-button | |||
cdkOverlayOrigin | |||
type="button" | |||
[disabled]="overlayRef" | |||
[disabled]="!!overlayRef" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about this one at the team meeting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this one I'm not sure if there is actually an issue? With strict type checking it makes sense to me that it expects a boolean here and not an overlay ref (even though it is truthy). example
@@ -51,7 +51,7 @@ <h2>Result</h2> | |||
[(ngModel)]="date" | |||
[min]="minDate" | |||
[max]="maxDate" | |||
[matDatepickerFilter]="filterOdd ? dateFilter : null" | |||
[matDatepickerFilter]="filterOdd ? dateFilter : undefined" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about this one at the team meeting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To provide some context for later:
@Input()
set matDatepickerFilter(value: (date: D | null) => boolean) {
With strict null checks, type checking should technically complain for both undefined
and null
. Right now it looks like with ngtsc type checking, undefined
is somehow allowed while null
is not.
Chatted with Joost and it looks like it is because ngtsc uses Partial
for checking the input bindings. This means that undefined
is a valid value. To me this looks like a bug because explicitly assigning it to undefined
vs not even setting the input is a difference. Related code: see here
fe5761c
to
0d7f1a8
Compare
…pe checking Before angular#15134 landed, the stepper accepted an`AbstractControl` from `@angular/forms`. Unfortunately this PR accidentally changed the type for the `stepControl` input from `AbstractControl` to `FormControl`. This means that with strict template type checking, passing a `FormGroup` (like we do in our dev-app various times) causes type check failures. We need to adjust the `stepControl` type to accept an abstract control which is the base of a `FormControl` and `FormmGroup`.
All components which are exported should be built with Ivy's strict template type checking. This guarantees maximum safety for template bindings and increases general code health in the components repository.
0d7f1a8
to
b31b5af
Compare
I think that the main blockers of this have been resolved? Is there anything else blocking this? |
@Splaktar One of the main issues is still that our getters/setters are too strict and break with |
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
- enable Ivy and fix template type checking in Bazel - for libraries, examples, dev-app, CI - add `postinstall` task for `ivy-ngcc` and configure it for our SystemJS setup - pin to Angular `9.0.0-next.10` for this PR - Angular `9.0.0-next.11` brings in a lot of new template type checking errors - fix buggy show bounding box checkbox in connected-overlay-demo - fix stylelint to work with WebStorm plugin - restrict NodeJS version to 10.x - We can't go to NodeJS 12.x without dropping or upgrading Gulp to 4.x - export `ProgressBarMode` type from `mdc-progress-bar` and `mat-progress-bar` - export `MatDrawerMode` type from `mat-drawer` - Add `| null` to `mat-tab-body`'s `@Input() origin: number;` Fixes #16606. Closes #16373.
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. |
No description provided.