perf(ivy): add self-closing elementContainer instruction (#31444)
Adds a new `elementContainer` instruction that can be used to avoid two instruction (`elementContainerStart` and `elementContainerEnd`) for `ng-container` that has text-only content. This is particularly useful when we have `ng-container` inside i18n sections. This PR resolves FW-1105. PR Close #31444
This commit is contained in:
@ -118,6 +118,7 @@ export {
|
||||
ɵɵallocHostVars,
|
||||
ɵɵelementContainerStart,
|
||||
ɵɵelementContainerEnd,
|
||||
ɵɵelementContainer,
|
||||
ɵɵstyling,
|
||||
ɵɵstyleMap,
|
||||
ɵɵclassMap,
|
||||
|
@ -56,6 +56,7 @@ export {
|
||||
ɵɵdirectiveInject,
|
||||
|
||||
ɵɵelement,
|
||||
ɵɵelementContainer,
|
||||
ɵɵelementContainerEnd,
|
||||
|
||||
ɵɵelementContainerStart,
|
||||
|
@ -100,3 +100,19 @@ export function ɵɵelementContainerEnd(): void {
|
||||
|
||||
registerPostOrderHooks(tView, previousOrParentTNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an empty logical container using {@link elementContainerStart}
|
||||
* and {@link elementContainerEnd}
|
||||
*
|
||||
* @param index Index of the element in the LView array
|
||||
* @param attrs Set of attributes to be used when matching directives.
|
||||
* @param localRefs A set of local reference bindings on the element.
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ɵɵelementContainer(
|
||||
index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void {
|
||||
ɵɵelementContainerStart(index, attrs, localRefs);
|
||||
ɵɵelementContainerEnd();
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ export const angularCoreEnv: {[name: string]: Function} =
|
||||
'ɵɵelement': r3.ɵɵelement,
|
||||
'ɵɵelementContainerStart': r3.ɵɵelementContainerStart,
|
||||
'ɵɵelementContainerEnd': r3.ɵɵelementContainerEnd,
|
||||
'ɵɵelementContainer': r3.ɵɵelementContainer,
|
||||
'ɵɵpureFunction0': r3.ɵɵpureFunction0,
|
||||
'ɵɵpureFunction1': r3.ɵɵpureFunction1,
|
||||
'ɵɵpureFunction2': r3.ɵɵpureFunction2,
|
||||
|
Reference in New Issue
Block a user