perf(ivy): speed up bindings when no directives are present (#32919)
Prior to this fix, whenever a style or class binding is present, the binding application process would require an instance of `TStylingContext` to be built regardless of whether or not any binding resolution is needed (just so that it knows whether or not there are any collisions). This check is, however, unnecessary because if (and only if) there are directives present on the element then are collisions possible. This patch removes the need for style/class bindings to register themselves on to a `TStylingContext` if there are no directives and present on an element. This means that all map and prop-based style/class bindings are applied as soon as bindings are updated on an element. PR Close #32919
This commit is contained in:

committed by
Miško Hevery

parent
8d111da7f6
commit
b2decf0266
@ -575,6 +575,9 @@
|
||||
{
|
||||
"name": "extractPipeDef"
|
||||
},
|
||||
{
|
||||
"name": "findAndApplyMapValue"
|
||||
},
|
||||
{
|
||||
"name": "findAttrIndexInNode"
|
||||
},
|
||||
@ -587,9 +590,6 @@
|
||||
{
|
||||
"name": "findExistingListener"
|
||||
},
|
||||
{
|
||||
"name": "findInitialStylingValue"
|
||||
},
|
||||
{
|
||||
"name": "findViaComponent"
|
||||
},
|
||||
|
@ -110,7 +110,7 @@ describe('styling context', () => {
|
||||
});
|
||||
|
||||
function makeContextWithDebug() {
|
||||
const ctx = allocTStylingContext();
|
||||
const ctx = allocTStylingContext(null, false);
|
||||
return attachStylingDebugObject(ctx);
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,6 @@ describe('styling debugging tools', () => {
|
||||
});
|
||||
|
||||
function makeContextWithDebug() {
|
||||
const ctx = allocTStylingContext();
|
||||
const ctx = allocTStylingContext(null, false);
|
||||
return attachStylingDebugObject(ctx);
|
||||
}
|
||||
|
Reference in New Issue
Block a user