refactor(ivy): delete ɵɵallocHostVars instruction (#34708)

Delete `ɵɵallocHostVars` instruction in favor of using `hostVars` declaration on `DrictiveDef` directly.

PR Close #34708
This commit is contained in:
Miško Hevery
2020-01-09 12:05:40 -08:00
parent 2961bf06c6
commit 2227d471a4
12 changed files with 150 additions and 155 deletions

View File

@ -0,0 +1,13 @@
# Bundle
## `js_expected_symbol_test`
This folder contains tests which assert that most of the code is tree shaken away.
This is asserted by keeping gold files of all symbols which are expected to be retained.
When doing renaming it is often necessary to update the gold files, to do so use this commands:
```
yarn bazel run --config=ivy //packages/core/test/bundling/cyclic_import:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/hello_world:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/injection:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/todo:symbol_test.accept
```

View File

@ -155,6 +155,9 @@
{
"name": "addComponentLogic"
},
{
"name": "addHostBindingsToExpandoInstructions"
},
{
"name": "addItemToStylingMap"
},
@ -314,9 +317,6 @@
{
"name": "getContainerRenderParent"
},
{
"name": "getCurrentDirectiveDef"
},
{
"name": "getDirectiveDef"
},
@ -410,6 +410,9 @@
{
"name": "getTNode"
},
{
"name": "growHostVarsSpace"
},
{
"name": "hasActiveElementFlag"
},
@ -552,10 +555,7 @@
"name": "objectToClassName"
},
{
"name": "prefillHostVars"
},
{
"name": "queueHostBindingForCheck"
"name": "setHostBindingsByExecutingExpandoInstructions"
},
{
"name": "refreshChildComponents"
@ -647,9 +647,6 @@
{
"name": "setDirectiveStylingInput"
},
{
"name": "setHostBindings"
},
{
"name": "setIncludeViewProviders"
},
@ -707,9 +704,6 @@
{
"name": "writeStylingValueDirectly"
},
{
"name": "ɵɵallocHostVars"
},
{
"name": "ɵɵdefineComponent"
},

View File

@ -140,6 +140,9 @@
{
"name": "_renderCompCount"
},
{
"name": "addHostBindingsToExpandoInstructions"
},
{
"name": "addItemToStylingMap"
},
@ -263,9 +266,6 @@
{
"name": "getContainerRenderParent"
},
{
"name": "getCurrentDirectiveDef"
},
{
"name": "getDirectiveDef"
},
@ -350,6 +350,9 @@
{
"name": "getTNode"
},
{
"name": "growHostVarsSpace"
},
{
"name": "hasActiveElementFlag"
},
@ -447,10 +450,7 @@
"name": "objectToClassName"
},
{
"name": "prefillHostVars"
},
{
"name": "queueHostBindingForCheck"
"name": "setHostBindingsByExecutingExpandoInstructions"
},
{
"name": "refreshChildComponents"
@ -524,9 +524,6 @@
{
"name": "setCurrentQueryIndex"
},
{
"name": "setHostBindings"
},
{
"name": "setIncludeViewProviders"
},
@ -572,9 +569,6 @@
{
"name": "writeStylingValueDirectly"
},
{
"name": "ɵɵallocHostVars"
},
{
"name": "ɵɵdefineComponent"
},

View File

@ -344,6 +344,9 @@
{
"name": "addComponentLogic"
},
{
"name": "addHostBindingsToExpandoInstructions"
},
{
"name": "addItemToStylingMap"
},
@ -647,9 +650,6 @@
{
"name": "getContextLView"
},
{
"name": "getCurrentDirectiveDef"
},
{
"name": "getCurrentStyleSanitizer"
},
@ -824,6 +824,9 @@
{
"name": "getValuesCount"
},
{
"name": "growHostVarsSpace"
},
{
"name": "handleError"
},
@ -1083,10 +1086,7 @@
"name": "patchHostStylingFlag"
},
{
"name": "prefillHostVars"
},
{
"name": "queueHostBindingForCheck"
"name": "setHostBindingsByExecutingExpandoInstructions"
},
{
"name": "readPatchedData"
@ -1238,9 +1238,6 @@
{
"name": "setGuardMask"
},
{
"name": "setHostBindings"
},
{
"name": "setIncludeViewProviders"
},
@ -1367,9 +1364,6 @@
{
"name": "ɵɵadvance"
},
{
"name": "ɵɵallocHostVars"
},
{
"name": "ɵɵclassProp"
},

View File

@ -9,7 +9,7 @@
import {RendererType2} from '../../src/render/api';
import {getLContext} from '../../src/render3/context_discovery';
import {AttributeMarker, ɵɵadvance, ɵɵattribute, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵhostProperty, ɵɵproperty} from '../../src/render3/index';
import {ɵɵallocHostVars, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵtemplate, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all';
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵtemplate, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all';
import {MONKEY_PATCH_KEY_NAME} from '../../src/render3/interfaces/context';
import {RenderFlags} from '../../src/render3/interfaces/definition';
import {RElement, Renderer3, RendererFactory3, domRendererFactory3} from '../../src/render3/interfaces/renderer';
@ -1112,10 +1112,8 @@ describe('sanitization', () => {
static ɵdir = ɵɵdefineDirective({
type: UnsafeUrlHostBindingDir,
selectors: [['', 'unsafeUrlHostBindingDir', '']],
hostVars: 1,
hostBindings: (rf: RenderFlags, ctx: any) => {
if (rf & RenderFlags.Create) {
ɵɵallocHostVars(1);
}
if (rf & RenderFlags.Update) {
ɵɵhostProperty('cite', ctx.cite, ɵɵsanitizeUrl);
}