[wp-trac] [WordPress Trac] #27355: Customizer: Add framework for selective refresh (partial preview refreshes)
WordPress Trac
noreply at wordpress.org
Tue Mar 22 03:46:51 UTC 2016
#27355: Customizer: Add framework for selective refresh (partial preview refreshes)
-------------------------------------------------+-------------------------
Reporter: westonruter | Owner:
Type: task (blessed) | westonruter
Priority: normal | Status: closed
Component: Customize | Milestone: 4.5
Severity: normal | Version: 3.4
Keywords: has-patch has-unit-tests commit | Resolution: fixed
has-screenshots | Focuses: javascript
-------------------------------------------------+-------------------------
Description changed by westonruter:
Old description:
> In regards to the Widget Customizer merge in #27112, we agreed to remove
> the partial preview refreshing of widgets (live previews via postMessage
> transport and re-rendering widgets via Ajax then doing DOM replacements).
> This live preview functionality for widgets was removed in favor of
> generalizing the functionality so that any customize control can add
> support for doing so. This partial preview refresh is key to keeping
> things DRY by eliminating the current requirement that all setting
> updates via postMessage transport re-implement all rendering logic in
> JavaScript for components that are normally written out in PHP—but even
> when the render logic is attempted to be written in JS, it will never be
> able to account for any filters added in PHP.
>
> For instance, with such partial preview refreshes, the Navigation Menu
> control needn't do a full refresh of the preview: the menu's container
> could be targeted for a partial refresh, where the new menu gets rendered
> via an Ajax request and the response replaces the old menu.
>
> Originally mentioned at
> https://core.trac.wordpress.org/ticket/27112#comment:10
>
> Feature plugin available
> WordPress.org: https://wordpress.org/plugins/customize-partial-refresh/
> GitHub project: https://github.com/xwp/wp-customize-partial-refresh
New description:
In regards to the Widget Customizer merge in #27112, we agreed to remove
the partial preview refreshing of widgets (live previews via postMessage
transport and re-rendering widgets via Ajax then doing DOM replacements).
This live preview functionality for widgets was removed in favor of
generalizing the functionality so that any customize control can add
support for doing so. This partial preview refresh is key to keeping
things DRY by eliminating the current requirement that all setting updates
via postMessage transport re-implement all rendering logic in JavaScript
for components that are normally written out in PHP—but even when the
render logic is attempted to be written in JS, it will never be able to
account for any filters added in PHP.
For instance, with such partial preview refreshes, the Navigation Menu
control needn't do a full refresh of the preview: the menu's container
could be targeted for a partial refresh, where the new menu gets rendered
via an Ajax request and the response replaces the old menu.
Originally mentioned at
https://core.trac.wordpress.org/ticket/27112#comment:10
Feature plugin available
WordPress.org: https://wordpress.org/plugins/customize-partial-refresh/
GitHub project: https://github.com/xwp/wp-customize-partial-refresh
----
For summaries of the feature as merged into 4.5, see Make Core posts:
* [https://make.wordpress.org/core/2016/02/16/selective-refresh-in-the-
customizer/ Selective Refresh in the Customizer]
* [https://make.wordpress.org/core/2016/03/22/implementing-selective-
refresh-support-for-widgets/ Implementing Selective Refresh Support for
Widgets]
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27355#comment:100>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list