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

WordPress Trac noreply at wordpress.org
Fri Sep 25 21:01:48 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
------------------------------+--------------------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"34563"]:
 {{{
 #!CommitTicketReference repository="" revision="34563"
 Customizer: Defer embedding widget controls to improve DOM performance and
 initial load time.

 The Menu Customizer feature includes a performance technique whereby the
 controls for nav menu items are only embedded into the DOM once the
 containing menu section is expanded. This commit implements the same DOM
 deferral for widgets but goes a step further than just embedding the
 controls once the widget area's Customizer section is expanded: it also
 defers the embedding of the widget control's form until the widget is
 expanded, at which point the `widget-added` event also fires to allow any
 additional widget initialization to be done. The deferred DOM embedding
 can speed up initial load time by 10x or more. This DOM deferral also
 yields a reduction in overall memory usage in the browser process.

 Includes changes to `wp_widget_control()` to facilitate separating out the
 widget form from the surrounding accordion container; also includes unit
 tests for this previously-untested function. Also included are initial
 QUnit tests (finally) for widgets in the Customizer.

 Fixes #33901.
 }}}

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


More information about the wp-trac mailing list