refactor(ivy): add element instruction, reducing output size (#24379)

- Adds an element instruction
- Reduces size of compiled output slightly

PR Close #24379
This commit is contained in:
Ben Lesh
2018-06-08 10:48:27 -07:00
committed by Miško Hevery
parent 014949f74c
commit 8dd99ac550
19 changed files with 127 additions and 128 deletions

View File

@ -33,6 +33,7 @@ export {
NH as ɵNH,
NM as ɵNM,
NS as ɵNS,
Ee as ɵEe,
L as ɵL,
T as ɵT,
V as ɵV,

View File

@ -44,6 +44,7 @@ export {
containerRefreshStart as cR,
containerRefreshEnd as cr,
element as Ee,
elementAttribute as a,
elementClass as k,
elementClassNamed as kn,

View File

@ -573,6 +573,20 @@ export function namespaceHTML() {
//// Element
//////////////////////////
/**
* Creates an empty element using {@link elementStart} and {@link elementEnd}
*
* @param index Index of the element in the data array
* @param name Name of the DOM Node
* @param attrs Statically bound set of attributes to be written into the DOM element on creation.
* @param localRefs A set of local reference bindings on the element.
*/
export function element(
index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {
elementStart(index, name, attrs, localRefs);
elementEnd();
}
/**
* Create DOM element. The instruction must later be followed by `elementEnd()` call.
*

View File

@ -41,6 +41,7 @@ export const angularCoreEnv: {[name: string]: Function} = {
'ɵNS': r3.NS,
'ɵE': r3.E,
'ɵe': r3.e,
'ɵEe': r3.Ee,
'ɵf0': r3.f0,
'ɵf1': r3.f1,
'ɵf2': r3.f2,