angular/packages/compiler-cli/ngcc/test
Kristiyan Kostadinov 54ceed53e2 refactor(compiler): add support for host directives (#46868)
This is the compile-time implementation of the `hostDirectives` feature plus a little bit of runtime code to illustrate how the newly-generated code will plug into the runtime. It works by creating a call to the new `ɵɵHostDirectivesFeature` feature whenever a directive has a `hostDirectives` field. Afterwards `ɵɵHostDirectivesFeature` will patch a new function onto the directive definition that will be invoked during directive matching.

For example, if we take the following definition:

```ts
@Directive({
  hostDirectives: [HostA, {directive: HostB, inputs: ['input: alias']}]
})
class MyDir {}
```

Will compile to:

```js
MyDir.ɵdir = ɵɵdefineComponent({
  features: [ɵɵHostDirectivesFeature([HostA, {
    directive: HostB,
    inputs: {
      input: "alias"
    }
  }])]
});
```

The template type checking is implemented during directive matching by adding the host directives applied on the host to the array of matched directives whenever the host is matched in a template.

Relates to #8785.

PR Close #46868
2022-08-22 16:00:35 -07:00
..
analysis refactor(ngcc): remove Ivy switch marker transform (#43891) 2021-11-24 19:26:25 +00:00
dependencies fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00
entry_point_finder fix(compiler-cli): ensure ngcc can handle wildcard base-paths (#41033) 2021-03-01 15:25:44 -08:00
execution fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00
helpers feat(core): support TypeScript 4.7 (#45749) 2022-04-29 12:19:45 -04:00
host test(ngcc): run more tests against more supported UMD formats (#44245) 2021-11-29 12:38:05 -05:00
integration refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
locking build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
migrations refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
packages fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00
rendering refactor(compiler): remove usages of deprecated AST creation functions (#45134) 2022-02-22 10:22:47 -08:00
writing fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00
BUILD.bazel build: disable bazel nodejs linker to improve stability on windows (#45872) 2022-05-04 16:20:57 -07:00
ngcc_options_spec.ts refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
utils_spec.ts fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00