Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ivy): harmonize container and element / elementContainer signatures #25458

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/src/render3/instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1840,8 +1840,8 @@ export function createLContainer(
* @param localRefs A set of local reference bindings on the element.
*/
export function container(
index: number, template?: ComponentTemplate<any>, tagName?: string | null, attrs?: TAttributes,
localRefs?: string[] | null): void {
index: number, template?: ComponentTemplate<any>| null, tagName?: string | null,
attrs?: TAttributes | null, localRefs?: string[] | null): void {
ngDevMode &&
assertEqual(
viewData[BINDING_INDEX], -1, 'container nodes should be created before any bindings');
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/render3/di_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ describe('di', () => {
/** <div *myIf="showing" dir dirSameInstance #dir="dir"> {{ dir.value }} </div> */
template: function(rf: RenderFlags, ctx: MyApp) {
if (rf & RenderFlags.Create) {
container(0, C1, undefined, ['myIf', 'showing']);
container(0, C1, null, ['myIf', 'showing']);
}
if (rf & RenderFlags.Update) {
containerRefreshStart(0);
Expand Down
16 changes: 8 additions & 8 deletions packages/core/test/render3/query_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -542,7 +542,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -577,7 +577,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -609,7 +609,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -1129,7 +1129,7 @@ describe('query', () => {
}
}, null, []);

container(5, undefined, null, [AttributeMarker.SelectOnly, 'vc']);
container(5, null, null, [AttributeMarker.SelectOnly, 'vc']);
}

if (rf & RenderFlags.Update) {
Expand Down Expand Up @@ -1221,8 +1221,8 @@ describe('query', () => {
}
}, null, []);

container(2, undefined, null, [AttributeMarker.SelectOnly, 'vc']);
container(3, undefined, null, [AttributeMarker.SelectOnly, 'vc']);
container(2, null, null, [AttributeMarker.SelectOnly, 'vc']);
container(3, null, null, [AttributeMarker.SelectOnly, 'vc']);
}

if (rf & RenderFlags.Update) {
Expand Down Expand Up @@ -1288,7 +1288,7 @@ describe('query', () => {
element(0, 'span', ['id', 'from_tpl'], ['foo', '']);
}
}, undefined, undefined, ['tpl', '']);
container(3, undefined, null, [AttributeMarker.SelectOnly, 'ngTemplateOutlet']);
container(3, null, null, [AttributeMarker.SelectOnly, 'ngTemplateOutlet']);
}
if (rf & RenderFlags.Update) {
const tplRef = getOrCreateTemplateRef(getOrCreateNodeInjectorForNode(load(1)));
Expand Down
10 changes: 5 additions & 5 deletions packages/core/test/render3/view_container_ref_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('ViewContainerRef', () => {

it('should work on containers', () => {
function createTemplate() {
container(0, embeddedTemplate, undefined, ['vcref', '']);
container(0, embeddedTemplate, null, ['vcref', '']);
element(1, 'footer');
}

Expand Down Expand Up @@ -246,8 +246,8 @@ describe('ViewContainerRef', () => {
template: (rf: RenderFlags, cmp: TestComponent) => {
if (rf & RenderFlags.Create) {
text(0, 'before|');
container(1, EmbeddedTemplateA, undefined, ['testdir', '']);
container(2, EmbeddedTemplateB, undefined, ['testdir', '']);
container(1, EmbeddedTemplateA, null, ['testdir', '']);
container(2, EmbeddedTemplateB, null, ['testdir', '']);
text(3, '|after');
}
},
Expand Down Expand Up @@ -315,7 +315,7 @@ describe('ViewContainerRef', () => {
template: (rf: RenderFlags, cmp: TestComponent) => {
if (rf & RenderFlags.Create) {
text(0, 'before|');
container(1, EmbeddedTemplateA, undefined, ['testdir', '']);
container(1, EmbeddedTemplateA, null, ['testdir', '']);
container(2);
text(3, '|after');
}
Expand Down Expand Up @@ -1074,7 +1074,7 @@ describe('ViewContainerRef', () => {

it('should work on containers', () => {
function createTemplate() {
container(0, embeddedTemplate, undefined, ['vcref', '']);
container(0, embeddedTemplate, null, ['vcref', '']);
element(1, 'footer');
}

Expand Down