Skip to content

Commit 8da64f4

Browse files
devversionandrewseguin
authored andcommitted
feat: expand input types with coercion to work with ngtsc input type checking (#17528)
* feat: expand input types with coercion to work with ngtsc input type checking * refactor: add workaround for strict metadata emit of coercion static members See: angular/angular#33451 * build: patch ng_module bazel rule to enable strict template type checking Workaround for: angular/angular#33452 * refactor: disable strict metadata emit for legacy build output Workaround for angular/angular#33451. This makes sense at the current time since the Bazel output does *never* work with strict metadata emit... and considering that with Ivy there is no metadata anyway, it could be disabled in the meanwhile. * build: disable strict attribute type checking We are temporarily disabling strict attribute type checking since we have a few templates that set a coerced input while the `NgModel` directive is applied. In those cases, the empty string for the `disabled` input, is not assignable to the `NgModel#disabled` input, since it does not do coercion. We need to figure out what to do in those scenarios.
1 parent ed6f133 commit 8da64f4

File tree

237 files changed

+694
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+694
-155
lines changed

src/a11y-demo/datepicker/datepicker-a11y.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ export class DatepickerAccessibilityDemo {
3131
appointmentDate: Date;
3232
minAppointmentDate = new Date();
3333
maxAppointmentDate = new Date(Date.now() + 365 * 24 * 60 * 60 * 1000);
34-
weekdaysOnly = (d: Date) => d.getDay() != 0 && d.getDay() != 6;
34+
weekdaysOnly = (d: Date|null) => d !== null && d.getDay() != 0 && d.getDay() != 6;
3535
}

src/cdk-experimental/dialog/tsconfig-build.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
],
77
"angularCompilerOptions": {
88
"annotateForClosureCompiler": true,
9-
"strictMetadataEmit": true,
109
"flatModuleOutFile": "index.js",
1110
"flatModuleId": "@angular/cdk-experimental/dialog",
1211
"skipTemplateCodegen": true,

src/cdk-experimental/popover-edit/tsconfig-build.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
],
77
"angularCompilerOptions": {
88
"annotateForClosureCompiler": true,
9-
"strictMetadataEmit": true,
109
"flatModuleOutFile": "index.js",
1110
"flatModuleId": "@angular/cdk-experimental/popover-edit",
1211
"skipTemplateCodegen": true,

src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,7 @@ export class CdkAutoSizeVirtualScroll implements OnChanges {
463463
ngOnChanges() {
464464
this._scrollStrategy.updateBufferSize(this.minBufferPx, this.maxBufferPx);
465465
}
466+
467+
static ngAcceptInputType_minBufferPx: number | string;
468+
static ngAcceptInputType_maxBufferPx: number | string;
466469
}

src/cdk-experimental/scrolling/tsconfig-build.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
],
66
"angularCompilerOptions": {
77
"annotateForClosureCompiler": true,
8-
"strictMetadataEmit": true,
98
"flatModuleOutFile": "index.js",
109
"flatModuleId": "@angular/cdk-experimental/scrolling",
1110
"skipTemplateCodegen": true,

src/cdk-experimental/tsconfig-build.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"angularCompilerOptions": {
2525
"enableIvy": false,
2626
"annotateForClosureCompiler": true,
27-
"strictMetadataEmit": true,
2827
"flatModuleOutFile": "index.js",
2928
"flatModuleId": "@angular/cdk-experimental",
3029
"skipTemplateCodegen": true,

src/cdk-experimental/tsconfig-tests.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
}
1515
},
1616
"angularCompilerOptions": {
17-
"strictMetadataEmit": true,
1817
"skipTemplateCodegen": true,
1918
"emitDecoratorMetadata": true,
2019

src/cdk/a11y/focus-trap/focus-trap.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,7 @@ export class CdkTrapFocus implements OnDestroy, AfterContentInit, DoCheck {
418418
this.focusTrap.attachAnchors();
419419
}
420420
}
421+
422+
static ngAcceptInputType_enabled: boolean | string;
423+
static ngAcceptInputType_autoCapture: boolean | string;
421424
}

src/cdk/a11y/tsconfig-build.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
],
66
"angularCompilerOptions": {
77
"annotateForClosureCompiler": true,
8-
"strictMetadataEmit": true,
98
"flatModuleOutFile": "index.js",
109
"flatModuleId": "@angular/cdk/a11y",
1110
"skipTemplateCodegen": true,

src/cdk/accordion/accordion-item.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,7 @@ export class CdkAccordionItem implements OnDestroy {
152152
}
153153
});
154154
}
155+
156+
static ngAcceptInputType_expanded: boolean | string;
157+
static ngAcceptInputType_disabled: boolean | string;
155158
}

0 commit comments

Comments
 (0)