angular/packages/compiler
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
..
design docs: add oxford commas and rephrase sentences (#47540) 2022-09-29 16:41:32 -07: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 feat(bazel): speed up dev-turnaround by bundling types only when packaging (#45405) 2022-04-21 11:09:39 -07:00
BUILD.bazel build(bazel): fix missing dgeni dependencies 2022-11-22 13:51:16 -07:00
compiler.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json refactor(core): remove Node.js v14 support (#49255) 2023-02-28 11:00:25 -08:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00