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
refactor: enable Ivy and fix template type checking issues #17392
Conversation
96a2981
to
a2c0f5c
Compare
3cba263
to
2adff8a
Compare
It looks like the issue with the page not loading due to moduleDef undefined errors, may be related to this
We haven't set up any custom resolution in our SystemJS configuration AFAIK. Update: Yep, removing this |
2adff8a
to
813991a
Compare
32fe812
to
e580a12
Compare
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.
All the changes in here too good overall. The Angular version thing will conflict w/ my TypeScript 3.6 update when that's ready, since I'll need a higher version of Angular. I think we'll be able to move forward with fullTemplateTypeCheck = false
for the time being.
.bazelrc
Outdated
# does not generate factory files which are needed for AOT. | ||
build --define=compile=legacy | ||
# Use the Ivy AOT compiler strategy. We want to compile with Ivy and with "ngtsc". | ||
build --define=compile=aot --keep_going=true |
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.
What are the required steps if someone wants to test something in ViewEngine?
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 build for ViewEngine, you can use --define=compile=legacy
here instead. I think that @devversion has some ideas on how to make this more configurable and hopefully add NPM scripts to the package.json
for building with Ivy (default) or ViewEngine.
I think that the deploy scripts will need to be changed to always build with ViewEngine since, in Angular version 9, that's the only way to publish libraries.
"yarn": ">= 1.17.3" | ||
}, | ||
"scripts": { | ||
"postinstall": "node --preserve-symlinks --preserve-symlinks-main tools/bazel/postinstall-patches.js", | ||
"postinstall": "node --preserve-symlinks --preserve-symlinks-main tools/bazel/postinstall-patches.js | ivy-ngcc --properties main", |
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.
It might be good to only do this when running within Bazel. ngcc is not very fast and otherwise we are running ngcc twice. We can tackle this in a follow-up though.
e.g. [value] is set for MatInput and MatDatepicker. | ||
MatInput#value expects a string whereas MatDatepicker#value expects a Date. | ||
This breaks strict template type checking. What should we do here? | ||
--> |
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.
Re-opening a comment here again (we had one in the other PR for this). I'm not sure if anything has changed here. Not even sure if we have a ticket for it. I don't think we talked about it in the framework meeting yet.
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.
Jeremy spoke to Alex R about it. It sounds like this is a real issue and that Alex was going to investigate a fix. We should probably open a ticket in JIRA?
a67fe70
to
14bb2f9
Compare
a9d7cf3
to
a4546e5
Compare
I've got a WIP PR open that contains these changes plus 731b80d which starts to resolve all of the |
54a3373
to
551e3f0
Compare
It looks like |
03b0db8
to
8d123fd
Compare
I had to revert Angular |
106dc06
to
a338aa2
Compare
OK, hopefully this last push resolves the issues with the |
a338aa2
to
fb3dd42
Compare
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.
LGTM
- 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.
fb3dd42
to
8f0f73c
Compare
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. |
Changes
9.0.0-next.10
for this PR9.0.0-next.11
brings in a lot of new template type checking errorsAPI Changes
ProgressBarMode
type frommdc-progress-bar
andmat-progress-bar
MatDrawerMode
type frommat-drawer
| null
tomat-tab-body
's@Input() origin: number;
TODO
any
on@Input() stepControl: FormControlLike | any;
inCdkStepper
: stepper: Type 'FormGroup' is not assignable to type 'FormControlLike' #16606focused
' does not exist on type 'HTMLInputElement
'." when binding to thefocused
property of amatInput
through a template variable.value
field from template variables(observableX | async)!
workaround aftercdkVirtualForOf
is updated with better typing likengForOf
: ivy: cdkVirtualForOf template type errors #17411. Fixed in PR fix(cdk/scrolling): expand type for "cdkVirtualForOf" input to work with strict null checks #17421.[value]
on a datepicker input w/o the need forany
. This may be a conflict/bug with template type checking. There is some discussion of this here.@Input
s caused by Angular9.0.0-next.11
. Related discussion: fix(ivy): do not always acceptundefined
for directive inputs angular#33066 (comment) and FW-1475.Notes
"fullTemplateTypeCheck": false
for dev-app doesn't remove the need for many of the changes in this PR.false
here means, do partial template type checking. It doesn't turn off template type checking."fullTemplateTypeCheck": false
does not resolve the hundreds of errors from Angular9.0.0-next.11
.Other related issues
QueryList
is not iterable and can't be used directly in*ngFor
with strict template type checking: QueryList is not iterable angular#29842Fixes #16606. Closes #16373.