angular-cn/packages/compiler-cli/test/compliance
Miško Hevery 2961bf06c6 refactor(ivy): move `hostVars`/`hostAttrs` from instruction to `DirectiveDef` (#34683)
This change moves information from instructions to declarative position:
- `ɵɵallocHostVars(vars)` => `DirectiveDef.hostVars`
- `ɵɵelementHostAttrs(attrs)` => `DirectiveDef.hostAttrs`

When merging directives it is necessary to know about `hostVars` and `hostAttrs`. Before this change the information was stored in the `hostBindings` function. This was problematic, because in order to get to the information the `hostBindings` would have to be executed. In order for `hostBindings` to be executed the directives would have to be instantiated. This means that the directive instantiation would happen before we had knowledge about the `hostAttrs` and as a result the directive could observe in the constructor that not all of the `hostAttrs` have been applied. This further complicates the runtime as we have to apply `hostAttrs` in parts over many invocations.

`ɵɵallocHostVars` was unnecessarily complicated because it would have to update the `LView` (and Blueprint) while existing directives are already executing. By moving it out of `hostBindings` function we can access it statically and we can create correct `LView` (and Blueprint) in a single pass.

This change only changes how the instructions are generated, but does not change the runtime much. (We cheat by emulating the old behavior by calling `ɵɵallocHostVars` and `ɵɵelementHostAttrs`) Subsequent change will refactor the runtime to take advantage of the static information.

PR Close #34683
2020-01-24 12:22:10 -08:00
..
BUILD.bazel test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:07 -05:00
README.md build: migrate references and scripts that set to build with ivy via compile=aot to use config=ivy (#33983) 2019-11-26 16:38:40 -05:00
mock_compile.ts refactor(compiler): i18n - render legacy i18n message ids (#34135) 2019-12-03 10:15:53 -08:00
mock_compiler_spec.ts test(compiler-cli): compliance tests not always reporting test failure (#30597) 2019-05-22 16:22:52 -07:00
r3_compiler_compliance_spec.ts refactor(ivy): move `hostVars`/`hostAttrs` from instruction to `DirectiveDef` (#34683) 2020-01-24 12:22:10 -08:00
r3_view_compiler_binding_spec.ts refactor(ivy): move `hostVars`/`hostAttrs` from instruction to `DirectiveDef` (#34683) 2020-01-24 12:22:10 -08:00
r3_view_compiler_di_spec.ts fix(ivy): handle overloaded constructors in ngtsc (#34590) 2020-01-14 15:17:09 -08:00
r3_view_compiler_directives_spec.ts refactor(core): rename ngFactoryDef to ɵfac (#33116) 2019-10-14 20:27:25 +00:00
r3_view_compiler_i18n_spec.ts fix(ivy): append `advance` instructions before `i18nExp` (#34436) 2020-01-07 10:31:45 -08:00
r3_view_compiler_input_outputs_spec.ts refactor(ivy): remove ngBaseDef (#33264) 2019-10-25 13:11:34 -07:00
r3_view_compiler_listener_spec.ts perf(ivy): chain listener instructions (#33720) 2019-11-12 09:59:13 -08:00
r3_view_compiler_providers_spec.ts refactor(core): rename ngFactoryDef to ɵfac (#33116) 2019-10-14 20:27:25 +00:00
r3_view_compiler_spec.ts perf(ivy): chain multiple property instructions (#31078) 2019-06-19 15:42:37 -07:00
r3_view_compiler_styling_spec.ts refactor(ivy): move `hostVars`/`hostAttrs` from instruction to `DirectiveDef` (#34683) 2020-01-24 12:22:10 -08:00
r3_view_compiler_template_spec.ts fix(ivy): properly parenthesize ternary expressions when emitted (#34221) 2019-12-06 13:01:48 -08:00

README.md

Tests in this directory should be run with:

yarn bazel test --config=ivy  packages/compiler-cli/test/compliance:compliance