angular/packages/compiler/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
..
expression_parser fix(compiler): infinite loop in parser assignment expression with invalid left-hand expression (#47151) 2022-08-17 07:33:32 +00:00
i18n test: remove view-engine-only tests (#43884) 2021-11-23 21:10:06 +00:00
ml_parser build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
output test: update source-map tests to account for source-map breaking change (#46888) 2022-07-19 09:40:54 -07:00
render3 refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
schema refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
selector build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
BUILD.bazel build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
compiler_facade_interface_spec.ts refactor(core): change component emit to 'dependencies' (#45672) 2022-04-20 05:45:56 -07:00
integration_spec.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00
shadow_css_spec.ts Revert "fix(compiler): scope css keyframes in emulated view encapsulation (#42608)" (#45786) 2022-04-27 15:00:41 -07:00
style_url_resolver_spec.ts refactor(compiler): make template preparser null-safe (#44411) 2022-01-04 15:54:10 -08:00
util_spec.ts perf(compiler): use raw bytes to represent utf-8 encoded strings (#39694) 2020-11-17 10:09:28 -08:00