angular/packages/compiler-cli/test/ngtsc
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
..
BUILD.bazel refactor(compiler): Add a new helper method getPrimaryAngularDecorator. (#47180) 2022-08-22 10:39:42 -07:00
component_indexing_spec.ts refactor(compiler-cli): update to use new file-system interfaces (#40281) 2021-01-08 09:34:44 -08:00
env.ts refactor(compiler): Add a new helper method getPrimaryAngularDecorator. (#47180) 2022-08-22 10:39:42 -07:00
extended_template_diagnostics_spec.ts refactor(compiler-cli): remove leftover _extendedTemplateDiagnostics flag (#44920) 2022-02-01 18:24:10 +00:00
host_directives_spec.ts refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
imports_spec.ts refactor(compiler-cli): improve DX for reference emit failures (#44587) 2022-01-06 23:44:24 +00:00
incremental_error_spec.ts perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:19 -08:00
incremental_semantic_changes_spec.ts refactor(compiler-cli): Adjust generated TCB when checkTypeOfPipes is false (#40523) 2021-05-06 17:54:14 -04:00
incremental_spec.ts refactor(core): change component emit to 'dependencies' (#45672) 2022-04-20 05:45:56 -07:00
incremental_typecheck_spec.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
ls_typecheck_helpers_spec.ts refactor(compiler): Add a new helper method getOwningNgModule. (#47166) 2022-08-22 10:57:48 -07:00
monorepo_spec.ts test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
ngtsc_spec.ts refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
scope_spec.ts feat(compiler-cli): standalone types imported into NgModule scopes (#44973) 2022-03-29 13:06:26 -07:00
sourcemap_utils.ts test: update source-map tests to account for source-map breaking change (#46888) 2022-07-19 09:40:54 -07:00
standalone_spec.ts refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
template_mapping_spec.ts test: update source-map tests to account for source-map breaking change (#46888) 2022-07-19 09:40:54 -07:00
template_typecheck_spec.ts refactor(compiler): add support for host directives (#46868) 2022-08-22 16:00:35 -07:00
util.ts refactor(compiler): Add a new helper method getPrimaryAngularDecorator. (#47180) 2022-08-22 10:39:42 -07:00
xi18n_spec.ts test(compiler): fix deprecation warning (#45285) 2022-03-07 11:36:47 -08:00