Skip to content

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

Closed
wants to merge 6 commits into from

Conversation

devversion
Copy link
Member

No description provided.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 24, 2019
@devversion devversion force-pushed the ivy-template-type-check branch from 0afcf02 to 149faa0 Compare June 24, 2019 20:09
@devversion devversion added the in progress This issue is currently in progress label Jun 24, 2019
@devversion devversion force-pushed the ivy-template-type-check branch from 149faa0 to fe5761c Compare June 24, 2019 20:51
<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
Copy link
Member

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

Copy link
Contributor

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"
Copy link
Member

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

Copy link
Member Author

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"
Copy link
Member

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

Copy link
Member Author

@devversion devversion Jun 25, 2019

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

@devversion devversion force-pushed the ivy-template-type-check branch from fe5761c to 0d7f1a8 Compare June 25, 2019 09:04
…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.
@Splaktar
Copy link
Contributor

I think that the main blockers of this have been resolved? Is there anything else blocking this?

Splaktar added a commit that referenced this pull request Oct 17, 2019
fix buggy show bounding box checkbox in connected-overlay-demo

Fixes #16606. Closes #16373.
Splaktar added a commit that referenced this pull request Oct 17, 2019
fix buggy show bounding box checkbox in connected-overlay-demo
fix stylelint to work with WebStorm plugin

Fixes #16606. Closes #16373.
Splaktar added a commit that referenced this pull request Oct 17, 2019
fix buggy show bounding box checkbox in connected-overlay-demo
fix stylelint to work with WebStorm plugin

Fixes #16606. Closes #16373.
@devversion
Copy link
Member Author

@Splaktar One of the main issues is still that our getters/setters are too strict and break with --strictNullChecks I guess.

Splaktar added a commit that referenced this pull request Oct 18, 2019
fix buggy show bounding box checkbox in connected-overlay-demo
fix stylelint to work with WebStorm plugin

Fixes #16606. Closes #16373.
Splaktar added a commit that referenced this pull request Oct 18, 2019
fix buggy show bounding box checkbox in connected-overlay-demo
fix stylelint to work with WebStorm plugin

Fixes #16606. Closes #16373.
Splaktar added a commit that referenced this pull request Oct 18, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 18, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 18, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 18, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 21, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 21, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 21, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 21, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 21, 2019
- 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.
mmalerba pushed a commit that referenced this pull request Oct 21, 2019
- 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.
Splaktar added a commit that referenced this pull request Oct 22, 2019
- 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.
mmalerba pushed a commit that referenced this pull request Oct 22, 2019
- 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.
@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 Nov 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked This issue is blocked by some external factor, such as a prerequisite PR cla: yes PR author has agreed to Google's Contributor License Agreement in progress This issue is currently in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants