[wp-trac] [WordPress Trac] #33901: Defer embedding Customizer widget controls to improve DOM performance

WordPress Trac noreply at wordpress.org
Tue Oct 6 21:58:49 UTC 2015


#33901: Defer embedding Customizer widget controls to improve DOM performance
------------------------------+--------------------------------------
 Reporter:  westonruter       |       Owner:  westonruter
     Type:  enhancement       |      Status:  closed
 Priority:  normal            |   Milestone:  4.4
Component:  Customize         |     Version:  3.9
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  javascript, performance
------------------------------+--------------------------------------

Comment (by westonruter):

 In [changeset:"34883"]:
 {{{
 #!CommitTicketReference repository="" revision="34883"
 Customizer: Ensure that `wp.customize.Widgets.savedWidgetIds` is defined
 up front.

 In 4.3 the widget controls were fully initialized up front along with the
 sidebar controls. The sidebar control depended (unnecessarily) on the
 widget control to ensure that `wp.customize.Widgets.savedWidgetIds` was
 defined. So after [34563] there could be a situation where the widgets are
 added/removed from a sidebar before their controls are initialized (if the
 sidebar section is never expanded), resulting in an error attempting to
 get a property off of an undefined value. So this change does the right
 thing and defines `savedWidgetIds` up front.

 Also changes the `savedWidgetIds` variable type from an array to an
 object, to match how it is used as a dictionary lookup.

 See #33901.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33901#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list