perf(ivy): replace select instruction with advance (#32516)
Replaces the `select` instruction with a new one called `advance`. Instead of the jumping to a specific index, the new instruction goes forward X amount of elements. The advantage of doing this is that it should generate code the compresses better. PR Close #32516
This commit is contained in:
@ -594,7 +594,7 @@
|
||||
"name": "saveResolvedLocalsInData"
|
||||
},
|
||||
{
|
||||
"name": "selectInternal"
|
||||
"name": "selectIndexInternal"
|
||||
},
|
||||
{
|
||||
"name": "selectView"
|
||||
|
@ -432,7 +432,7 @@
|
||||
"name": "resetStylingState"
|
||||
},
|
||||
{
|
||||
"name": "selectInternal"
|
||||
"name": "selectIndexInternal"
|
||||
},
|
||||
{
|
||||
"name": "selectView"
|
||||
|
@ -1,7 +1,4 @@
|
||||
[
|
||||
{
|
||||
"name": "INJECTOR_SCOPE"
|
||||
},
|
||||
{
|
||||
"name": "CIRCULAR"
|
||||
},
|
||||
@ -14,6 +11,9 @@
|
||||
{
|
||||
"name": "INJECTOR"
|
||||
},
|
||||
{
|
||||
"name": "INJECTOR_SCOPE"
|
||||
},
|
||||
{
|
||||
"name": "Inject"
|
||||
},
|
||||
@ -215,4 +215,4 @@
|
||||
{
|
||||
"name": "ɵɵinject"
|
||||
}
|
||||
]
|
||||
]
|
@ -1248,7 +1248,7 @@
|
||||
"name": "searchTokensOnInjector"
|
||||
},
|
||||
{
|
||||
"name": "selectInternal"
|
||||
"name": "selectIndexInternal"
|
||||
},
|
||||
{
|
||||
"name": "selectView"
|
||||
@ -1394,6 +1394,9 @@
|
||||
{
|
||||
"name": "wrapListener"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵadvance"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵclassProp"
|
||||
},
|
||||
@ -1436,9 +1439,6 @@
|
||||
{
|
||||
"name": "ɵɵrestoreView"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵselect"
|
||||
},
|
||||
{
|
||||
"name": "ɵɵstyling"
|
||||
},
|
||||
|
@ -10,7 +10,7 @@ import {withBody} from '@angular/private/testing';
|
||||
|
||||
import {ChangeDetectionStrategy, DoCheck} from '../../src/core';
|
||||
import {whenRendered} from '../../src/render3/component';
|
||||
import {LifecycleHooksFeature, getRenderedText, ɵɵdefineComponent, ɵɵgetCurrentView, ɵɵproperty, ɵɵselect, ɵɵtextInterpolate1, ɵɵtextInterpolate2} from '../../src/render3/index';
|
||||
import {LifecycleHooksFeature, getRenderedText, ɵɵadvance, ɵɵdefineComponent, ɵɵgetCurrentView, ɵɵproperty, ɵɵtextInterpolate1, ɵɵtextInterpolate2} from '../../src/render3/index';
|
||||
import {detectChanges, markDirty, tick, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵlistener, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
import {Renderer3, RendererFactory3} from '../../src/render3/interfaces/renderer';
|
||||
@ -38,7 +38,7 @@ describe('change detection', () => {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵtextInterpolate(ctx.value);
|
||||
}
|
||||
}
|
||||
@ -121,7 +121,6 @@ describe('change detection', () => {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate2('', ctx.doCheckCount, ' - ', ctx.name, '');
|
||||
}
|
||||
},
|
||||
@ -165,7 +164,6 @@ describe('change detection', () => {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate2('', ctx.doCheckCount, ' - ', ctx.name, '');
|
||||
}
|
||||
},
|
||||
@ -189,7 +187,6 @@ describe('change detection', () => {
|
||||
ɵɵelement(0, 'manual-comp');
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('name', ctx.name);
|
||||
}
|
||||
|
||||
@ -246,7 +243,6 @@ describe('change detection', () => {
|
||||
ɵɵelement(1, 'manual-comp');
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate1('', ctx.doCheckCount, ' - ');
|
||||
}
|
||||
},
|
||||
@ -322,7 +318,6 @@ describe('change detection', () => {
|
||||
ɵɵtext(0);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.value);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
import {ViewEncapsulation, ɵɵdefineInjectable, ɵɵdefineInjector} from '../../src/core';
|
||||
import {createInjector} from '../../src/di/r3_injector';
|
||||
import {AttributeMarker, ComponentFactory, LifecycleHooksFeature, getRenderedText, markDirty, ɵɵdefineComponent, ɵɵdirectiveInject, ɵɵproperty, ɵɵselect, ɵɵtemplate} from '../../src/render3/index';
|
||||
import {AttributeMarker, ComponentFactory, LifecycleHooksFeature, getRenderedText, markDirty, ɵɵadvance, ɵɵdefineComponent, ɵɵdirectiveInject, ɵɵproperty, ɵɵselect, ɵɵtemplate} from '../../src/render3/index';
|
||||
import {tick, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵnextContext, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all';
|
||||
import {ComponentDef, RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
|
||||
@ -33,7 +33,6 @@ describe('component', () => {
|
||||
ɵɵtext(0);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.count);
|
||||
}
|
||||
},
|
||||
@ -84,7 +83,6 @@ describe('component', () => {
|
||||
ɵɵtext(0);
|
||||
}
|
||||
if (fs & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.myService.value);
|
||||
}
|
||||
}
|
||||
@ -128,7 +126,6 @@ describe('component', () => {
|
||||
ɵɵtext(0);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.name);
|
||||
}
|
||||
},
|
||||
@ -143,7 +140,7 @@ describe('component', () => {
|
||||
ɵɵelement(4097, 'comp');
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(4097);
|
||||
ɵɵadvance(4097);
|
||||
ɵɵproperty('name', ctx.name);
|
||||
}
|
||||
}, 4098, 1, [Comp]);
|
||||
@ -197,7 +194,7 @@ it('should not invoke renderer destroy method for embedded views', () => {
|
||||
2, MyComponent_div_Template_2, 2, 0, 'div', [AttributeMarker.Template, 'ngIf']);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(2);
|
||||
ɵɵadvance(2);
|
||||
ɵɵproperty('ngIf', ctx.visible);
|
||||
}
|
||||
}
|
||||
@ -280,7 +277,6 @@ describe('component with a container', () => {
|
||||
ɵɵelement(0, 'wrapper');
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('items', ctx.items);
|
||||
}
|
||||
}
|
||||
@ -342,7 +338,6 @@ describe('recursive components', () => {
|
||||
ɵɵcontainer(2);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.data.value);
|
||||
ɵɵcontainerRefreshStart(1);
|
||||
{
|
||||
@ -414,11 +409,10 @@ describe('recursive components', () => {
|
||||
[AttributeMarker.Bindings, 'data', AttributeMarker.Template, 'ngIf']);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.data.value);
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('ngIf', ctx.data.left);
|
||||
ɵɵselect(2);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('ngIf', ctx.data.right);
|
||||
}
|
||||
|
||||
@ -434,7 +428,6 @@ describe('recursive components', () => {
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
const parent = ɵɵnextContext();
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('data', parent.data.left);
|
||||
}
|
||||
}
|
||||
@ -446,7 +439,6 @@ describe('recursive components', () => {
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
const parent = ɵɵnextContext();
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('data', parent.data.right);
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
import {ɵɵdefineComponent} from '../../src/render3/definition';
|
||||
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵselect, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
|
||||
import {ComponentFixture, TemplateFixture, createComponent} from './render_util';
|
||||
|
||||
describe('JS control flow', () => {
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
import {RendererType2} from '../../src/render/api';
|
||||
import {getLContext} from '../../src/render3/context_discovery';
|
||||
import {AttributeMarker, ɵɵattribute, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵhostProperty, ɵɵproperty} from '../../src/render3/index';
|
||||
import {ɵɵallocHostVars, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵselect, ɵɵstyling, ɵɵstylingApply, ɵɵtemplate, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all';
|
||||
import {AttributeMarker, ɵɵadvance, ɵɵattribute, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵhostProperty, ɵɵproperty} from '../../src/render3/index';
|
||||
import {ɵɵallocHostVars, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵstyling, ɵɵstylingApply, ɵɵ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';
|
||||
@ -69,7 +69,6 @@ describe('render3 integration test', () => {
|
||||
ɵɵtext(0);
|
||||
}
|
||||
if (rf1 & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.label);
|
||||
}
|
||||
ɵɵembeddedViewEnd();
|
||||
@ -160,7 +159,6 @@ describe('render3 integration test', () => {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('beforeTree', ctx.beforeTree);
|
||||
ɵɵproperty('afterTree', ctx.afterTree);
|
||||
ɵɵcontainerRefreshStart(1);
|
||||
@ -287,7 +285,6 @@ describe('component animations', () => {
|
||||
ɵɵelement(0, 'div', [AttributeMarker.Bindings, '@fooAnimation']);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵattribute('@fooAnimation', ctx.animationValue);
|
||||
}
|
||||
}
|
||||
@ -494,7 +491,7 @@ describe('element discovery', () => {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('ngIf', true);
|
||||
}
|
||||
}
|
||||
@ -1085,7 +1082,6 @@ describe('sanitization', () => {
|
||||
ɵɵelement(0, 'a');
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('href', ctx.href, ɵɵsanitizeUrl);
|
||||
}
|
||||
}
|
||||
@ -1121,12 +1117,11 @@ describe('sanitization', () => {
|
||||
static ngDirectiveDef = ɵɵdefineDirective({
|
||||
type: UnsafeUrlHostBindingDir,
|
||||
selectors: [['', 'unsafeUrlHostBindingDir', '']],
|
||||
hostBindings: (rf: RenderFlags, ctx: any, elementIndex: number) => {
|
||||
hostBindings: (rf: RenderFlags, ctx: any) => {
|
||||
if (rf & RenderFlags.Create) {
|
||||
ɵɵallocHostVars(1);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(elementIndex);
|
||||
ɵɵhostProperty('cite', ctx.cite, ɵɵsanitizeUrl);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {ComponentTemplate, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵproperty} from '../../src/render3/index';
|
||||
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵselect, ɵɵtext} from '../../src/render3/instructions/all';
|
||||
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵtext} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
import {NgIf} from './common_with_def';
|
||||
import {ComponentFixture, createComponent} from './render_util';
|
||||
@ -20,7 +20,6 @@ describe('lifecycles', () => {
|
||||
ɵɵelement(0, name);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵproperty('val', ctx.val);
|
||||
}
|
||||
};
|
||||
|
@ -5,8 +5,8 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ɵɵadvance} from '../../../../src/render3/instructions/advance';
|
||||
import {ɵɵelementEnd, ɵɵelementStart} from '../../../../src/render3/instructions/element';
|
||||
import {ɵɵselect} from '../../../../src/render3/instructions/select';
|
||||
import {refreshView} from '../../../../src/render3/instructions/shared';
|
||||
import {ɵɵtext} from '../../../../src/render3/instructions/text';
|
||||
import {ɵɵtextInterpolate} from '../../../../src/render3/instructions/text_interpolation';
|
||||
@ -63,25 +63,25 @@ function TestInterpolationComponent_ng_template_0_Template(rf: RenderFlags, ctx:
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
ɵɵselect(2);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('0');
|
||||
ɵɵselect(4);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('1');
|
||||
ɵɵselect(6);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('2');
|
||||
ɵɵselect(8);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('3');
|
||||
ɵɵselect(10);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('4');
|
||||
ɵɵselect(12);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('5');
|
||||
ɵɵselect(14);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('6');
|
||||
ɵɵselect(16);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('7');
|
||||
ɵɵselect(18);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('8');
|
||||
ɵɵselect(20);
|
||||
ɵɵadvance(2);
|
||||
ɵɵtextInterpolate('9');
|
||||
}
|
||||
}
|
||||
@ -96,4 +96,4 @@ console.profile('update');
|
||||
for (let i = 0; i < 5000; i++) {
|
||||
refreshView(rootLView, rootTView, null, null);
|
||||
}
|
||||
console.profileEnd();
|
||||
console.profileEnd();
|
||||
|
@ -5,8 +5,8 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ɵɵadvance} from '../../../../src/render3/instructions/advance';
|
||||
import {ɵɵelementEnd, ɵɵelementStart} from '../../../../src/render3/instructions/element';
|
||||
import {ɵɵselect} from '../../../../src/render3/instructions/select';
|
||||
import {refreshView} from '../../../../src/render3/instructions/shared';
|
||||
import {RenderFlags} from '../../../../src/render3/interfaces/definition';
|
||||
import {TVIEW} from '../../../../src/render3/interfaces/view';
|
||||
@ -63,43 +63,43 @@ function testTemplate(rf: RenderFlags, ctx: any) {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '0px', height: '0px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(2);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '10px', height: '100px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(3);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '20px', height: '200px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(4);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '30px', height: '300px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(5);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '40px', height: '400px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(6);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '50px', height: '500px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(7);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '60px', height: '600px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(8);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '70px', height: '700px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(9);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '80px', height: '800px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(10);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleMap({width: '90px', height: '900px'});
|
||||
ɵɵclassMap('one two');
|
||||
ɵɵstylingApply();
|
||||
|
@ -5,9 +5,9 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ɵɵadvance} from '../../../../src/render3/instructions/advance';
|
||||
import {ɵɵelement, ɵɵelementEnd, ɵɵelementStart} from '../../../../src/render3/instructions/element';
|
||||
import {ɵɵproperty} from '../../../../src/render3/instructions/property';
|
||||
import {ɵɵselect} from '../../../../src/render3/instructions/select';
|
||||
import {refreshView} from '../../../../src/render3/instructions/shared';
|
||||
import {RenderFlags} from '../../../../src/render3/interfaces/definition';
|
||||
import {TVIEW} from '../../../../src/render3/interfaces/view';
|
||||
@ -42,25 +42,25 @@ function TestInterpolationComponent_ng_template_0_Template(rf: RenderFlags, ctx:
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title1');
|
||||
ɵɵselect(2);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title2');
|
||||
ɵɵselect(3);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title3');
|
||||
ɵɵselect(4);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title4');
|
||||
ɵɵselect(5);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title5');
|
||||
ɵɵselect(6);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title6');
|
||||
ɵɵselect(7);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title7');
|
||||
ɵɵselect(8);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title8');
|
||||
ɵɵselect(9);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title9');
|
||||
ɵɵselect(10);
|
||||
ɵɵadvance(1);
|
||||
ɵɵproperty('title', 'title10');
|
||||
}
|
||||
}
|
||||
@ -75,4 +75,4 @@ console.profile('update');
|
||||
for (let i = 0; i < 5000; i++) {
|
||||
refreshView(rootLView, rootTView, null, null);
|
||||
}
|
||||
console.profileEnd();
|
||||
console.profileEnd();
|
||||
|
@ -5,8 +5,8 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ɵɵadvance} from '../../../../src/render3/instructions/advance';
|
||||
import {ɵɵelementEnd, ɵɵelementStart} from '../../../../src/render3/instructions/element';
|
||||
import {ɵɵselect} from '../../../../src/render3/instructions/select';
|
||||
import {refreshView} from '../../../../src/render3/instructions/shared';
|
||||
import {RenderFlags} from '../../../../src/render3/interfaces/definition';
|
||||
import {AttributeMarker} from '../../../../src/render3/interfaces/node';
|
||||
@ -74,43 +74,43 @@ function testTemplate(rf: RenderFlags, ctx: any) {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '0px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(2);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '100px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(3);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '200px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(4);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '300px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(5);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '400px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(6);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '500px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(7);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '600px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(8);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '700px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(9);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '800px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(10);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('width', '900px');
|
||||
ɵɵclassProp('scale', true);
|
||||
ɵɵstylingApply();
|
||||
|
@ -5,8 +5,8 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ɵɵadvance} from '../../../../src/render3/instructions/advance';
|
||||
import {ɵɵelementEnd, ɵɵelementStart} from '../../../../src/render3/instructions/element';
|
||||
import {ɵɵselect} from '../../../../src/render3/instructions/select';
|
||||
import {refreshView} from '../../../../src/render3/instructions/shared';
|
||||
import {RenderFlags} from '../../../../src/render3/interfaces/definition';
|
||||
import {TVIEW} from '../../../../src/render3/interfaces/view';
|
||||
@ -15,16 +15,16 @@ import {setupRootViewWithEmbeddedViews} from '../setup';
|
||||
|
||||
`<ng-template>
|
||||
<div>
|
||||
<button [style.backgroundColor]="'color1'"></button>
|
||||
<button [style.backgroundColor]="'color2'"></button>
|
||||
<button [style.backgroundColor]="'color3'"></button>
|
||||
<button [style.backgroundColor]="'color4'"></button>
|
||||
<button [style.backgroundColor]="'color5'"></button>
|
||||
<button [style.backgroundColor]="'color6'"></button>
|
||||
<button [style.backgroundColor]="'color7'"></button>
|
||||
<button [style.backgroundColor]="'color8'"></button>
|
||||
<button [style.backgroundColor]="'color9'"></button>
|
||||
<button [style.backgroundColor]="'color10'"></button>
|
||||
<button [style.backgroundColor]="'color1'"></button>
|
||||
<button [style.backgroundColor]="'color2'"></button>
|
||||
<button [style.backgroundColor]="'color3'"></button>
|
||||
<button [style.backgroundColor]="'color4'"></button>
|
||||
<button [style.backgroundColor]="'color5'"></button>
|
||||
<button [style.backgroundColor]="'color6'"></button>
|
||||
<button [style.backgroundColor]="'color7'"></button>
|
||||
<button [style.backgroundColor]="'color8'"></button>
|
||||
<button [style.backgroundColor]="'color9'"></button>
|
||||
<button [style.backgroundColor]="'color10'"></button>
|
||||
</div>
|
||||
</ng-template>`;
|
||||
function testTemplate(rf: RenderFlags, ctx: any) {
|
||||
@ -63,34 +63,34 @@ function testTemplate(rf: RenderFlags, ctx: any) {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color1');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(2);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color2');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(3);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color3');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(4);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color4');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(5);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color5');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(6);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color6');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(7);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color7');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(8);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color8');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(9);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color9');
|
||||
ɵɵstylingApply();
|
||||
ɵɵselect(10);
|
||||
ɵɵadvance(1);
|
||||
ɵɵstyleProp('background-color', 'color10');
|
||||
ɵɵstylingApply();
|
||||
}
|
||||
@ -105,4 +105,4 @@ console.profile('update');
|
||||
for (let i = 0; i < 5000; i++) {
|
||||
refreshView(rootLView, rootTView, null, null);
|
||||
}
|
||||
console.profileEnd();
|
||||
console.profileEnd();
|
||||
|
@ -9,7 +9,7 @@
|
||||
import {Directive as _Directive, Pipe as _Pipe, PipeTransform, WrappedValue, ɵɵdefinePipe} from '@angular/core';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
|
||||
import {ɵɵselect, ɵɵtext, ɵɵtextInterpolate1} from '../../src/render3/instructions/all';
|
||||
import {ɵɵtext, ɵɵtextInterpolate1} from '../../src/render3/instructions/all';
|
||||
import {ɵɵpipe, ɵɵpipeBind1} from '../../src/render3/pipe';
|
||||
|
||||
import {TemplateFixture} from './render_util';
|
||||
@ -38,10 +38,7 @@ describe('pipe', () => {
|
||||
ɵɵpipe(1, 'wrappingPipe');
|
||||
}
|
||||
|
||||
function updateTemplate() {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate1('', ɵɵpipeBind1(1, 1, null), '');
|
||||
}
|
||||
function updateTemplate() { ɵɵtextInterpolate1('', ɵɵpipeBind1(1, 1, null), ''); }
|
||||
|
||||
it('should unwrap', () => {
|
||||
const fixture =
|
||||
|
@ -9,11 +9,12 @@
|
||||
import {Component as _Component, ComponentFactoryResolver, ElementRef, InjectFlags, Injectable as _Injectable, InjectionToken, InjectorType, Provider, RendererFactory2, ViewContainerRef, ɵNgModuleDef as NgModuleDef, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵinject} from '../../src/core';
|
||||
import {forwardRef} from '../../src/di/forward_ref';
|
||||
import {createInjector} from '../../src/di/r3_injector';
|
||||
import {injectComponentFactoryResolver, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdirectiveInject, ɵɵselect, ɵɵtextInterpolate1} from '../../src/render3/index';
|
||||
import {injectComponentFactoryResolver, ɵɵProvidersFeature, ɵɵadvance, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdirectiveInject, ɵɵtextInterpolate1} from '../../src/render3/index';
|
||||
import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all';
|
||||
import {RenderFlags} from '../../src/render3/interfaces/definition';
|
||||
import {NgModuleFactory} from '../../src/render3/ng_module_ref';
|
||||
import {getInjector} from '../../src/render3/util/discovery_utils';
|
||||
|
||||
import {getRendererFactory2} from './imported_renderer2';
|
||||
import {ComponentFixture} from './render_util';
|
||||
|
||||
@ -880,9 +881,8 @@ describe('providers', () => {
|
||||
ɵɵtext(1);
|
||||
}
|
||||
if (fs & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.s);
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵtextInterpolate(ctx.n);
|
||||
}
|
||||
}
|
||||
@ -967,9 +967,8 @@ describe('providers', () => {
|
||||
ɵɵtext(1);
|
||||
}
|
||||
if (fs & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate(ctx.s);
|
||||
ɵɵselect(1);
|
||||
ɵɵadvance(1);
|
||||
ɵɵtextInterpolate(ctx.n);
|
||||
}
|
||||
},
|
||||
@ -1050,7 +1049,6 @@ describe('providers', () => {
|
||||
ɵɵtext(0);
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
ɵɵselect(0);
|
||||
ɵɵtextInterpolate1('', cmp.s, '');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user