angular/packages/compiler-cli/linker/src
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
..
ast refactor(compiler): required inputs prerequisite refactors (#49333) 2023-03-14 09:27:49 -07:00
file_linker feat(compiler): add support for compile-time required inputs (#49304) 2023-03-15 16:59:24 -07:00
fatal_linker_error.ts refactor(compiler-cli): linker - add Babel plugin, FileLinker and initial PartialLinkers (#39116) 2020-10-19 11:23:45 -07:00
linker_import_generator.ts docs: fix spelling (#46713) 2022-07-08 20:54:52 +00:00