angular/packages/compiler-cli
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
..
integrationtest test: update source-map tests to account for source-map breaking change (#46888) 2022-07-19 09:40:54 -07:00
linker refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
ngcc refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
private refactor(localize): update version of Babel (#44931) 2022-02-24 21:42:54 +00:00
src refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
test refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
BUILD.bazel build: remove source-map package from compiler-cli bundling external list (#46888) 2022-07-19 09:40:54 -07:00
esbuild.config.js refactor: setup bundling for @angular/compiler-cli package (#43431) 2021-10-01 18:28:42 +00:00
import_meta_url.d.ts refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
index.ts build: switch all instances from ng_rollup_bundle to app_bundle (#44490) 2022-01-04 12:14:14 -08:00
package.json feat(core): support TypeScript 4.8 (#47038) 2022-08-16 16:02:47 +00:00
tsconfig-build.json refactor(compiler-cli): dismantle View Engine implementation of ngc (#44269) 2021-12-01 10:36:30 -08:00
tsconfig.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00