angular/packages/core
Kristiyan Kostadinov 1a6ca68154 feat(compiler): add support for compile-time required inputs (#49304)
Adds support for marking a directive input as required. During template type checking, the compiler will verify that all required inputs have been specified and will raise a diagnostic if one or more are missing. Some specifics:
* Inputs are marked as required by passing an object literal with a `required: true` property to the `Input` decorator or into the `inputs` array.
* Required inputs imply that the directive can't work without them. This is why there's a new check that enforces that all required inputs of a host directive are exposed on the host.
* Required input diagnostics are reported through the `OutOfBandDiagnosticRecorder`, rather than generating a new structure in the TCB, because it allows us to provide a better error message.
* Currently required inputs are only supported during AOT compilation, because knowing which bindings are present during JIT can be tricky and may lead to increased bundle sizes.

Fixes #37706.

PR Close #49304
2023-03-15 16:59:24 -07:00
..
global build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
schematics refactor(migrations): Move ChangeTracker to common utils (#49308) 2023-03-03 22:03:37 +00:00
src feat(compiler): add support for compile-time required inputs (#49304) 2023-03-15 16:59:24 -07:00
test feat(compiler): add support for compile-time required inputs (#49304) 2023-03-15 16:59:24 -07:00
testing refactor(core): move Zone providers to a single provider function (#49373) 2023-03-14 09:20:53 -07:00
BUILD.bazel refactor(core): prototype of signals, a reactive primitive for Angular (#49091) 2023-02-21 14:13:08 -08:00
index.ts refactor(core): made comment structure consistent in index.ts (#43684) 2021-10-21 18:39:58 +00:00
package.json feat(core): drop support for zone.js versions <=0.12.0 (#49331) 2023-03-07 19:12:22 +00:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00