angular/packages/core/src/compiler
Kristiyan Kostadinov 8f539c11f4 feat(compiler): add support for compile-time required inputs (#49468)
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 #49468
2023-03-20 13:10:30 +01:00
..
BUILD.bazel build(bazel): add bazel targets for aio doc generation 2022-11-22 13:51:16 -07:00
compiler_facade.ts refactor(core): expand error logging when the JIT compiler is not available (#42693) 2021-07-15 13:19:05 -07:00
compiler_facade_interface.ts feat(compiler): add support for compile-time required inputs (#49468) 2023-03-20 13:10:30 +01:00