[wp-trac] [WordPress Trac] #27355: Customizer: Add framework for partial preview refreshes

WordPress Trac noreply at wordpress.org
Thu Nov 6 18:42:55 UTC 2014


#27355: Customizer: Add framework for partial preview refreshes
-------------------------+--------------------------
 Reporter:  westonruter  |       Owner:  westonruter
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.1
Component:  Customize    |     Version:  3.4
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  javascript
-------------------------+--------------------------

Comment (by westonruter):

 I suggest punting this to 4.2 and instead rely on JS in the Customizer for
 compiling the CSS for TwentyFifteen. For TwentyFifteen and #29988, using
 JS to manage the CSS makes for a much better experience in that the
 changes happen instantly without any HTTP requests, and it is DRY in that
 the JS-rendered CSS gets stored in the theme_mod to then be output via PHP
 for normal visitors. The caveat is that the settings that comprise the CSS
 must only be edited in the Customizer (including the background color), so
 any other admin pages that touch those Appearance settings have to be
 disabled (#25569 and #25571).

 In [ticket:29988#comment:20] I also get into the use of logic-less
 Mustache templates for applying settings to templates. This is a piece
 missing from Core I think. Underscore templates often have JS code
 embedded within them, and this makes them unusable for rendering settings
 onto templates via PHP. Likewise, PHP “templates” are even more logic-
 filled and so are unsuitable for rendering settings onto templates with
 JS.

 Taylor Buley presents a great idea in his talk
 [http://wordpress.tv/2014/08/14/taylor-buley-how-parade-com-uses-the-
 wordpress-theme-customizer-api/ Taylor Buley: How Parade.com Uses the
 WordPress Theme Customizer API] for how they used Mustache templates for
 rendering template partials as opposed to straight PHP, and this enabled
 them to use `postMessage` transport much more extensively.

 I know it is unrealistic to expect developers to start writing Mustache
 templates exclusively, so the partial refresh proposed in this ticket is
 sort of a stopgap.

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


More information about the wp-trac mailing list