[wp-trac] [WordPress Trac] #49330: REST API: introduce block-editor context

WordPress Trac noreply at wordpress.org
Thu Jan 30 16:48:59 UTC 2020


#49330: REST API: introduce block-editor context
-------------------------+-------------------------
 Reporter:  kadamwhite   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  5.4
Component:  REST API     |    Version:  trunk
 Severity:  normal       |   Keywords:  needs-patch
  Focuses:  rest-api     |
-------------------------+-------------------------
 The block editor does not make use of rendered content, and rendering
 content for complex posts with a large quantity of dynamic blocks can take
 a non-trivial amount of time. The REST API maintainers and Gutenberg
 developers have previously discussed the need to be able to "skip"
 rendering of the content if it is not required.

 In [46184] we introduced the ability to provide an explicit list of nested
 fields to include. Specifying `_fields=content.raw` without mentioning
 `rendered` now causes the posts controller to skip computation of the
 rendered field, as it has not been requested. Unfortunately, this approach
 requires a developer to provide a comprehensive list of all fields they
 _do_ wish to include in the response, and cannot easily be used to
 specifically exclude one field. Because block editor developers may depend
 on registered rest fields or other additional properties, it is infeasible
 to have the block editor request "all but the rendered content" using this
 interface.

 A slack conversation
 ([https://wordpress.slack.com/archives/C02RQC26G/p1574361923322500]) with
 @aduth and @timothyblynjacobs addressed this problem and discussed two
 separate options, either providing an `_omit_fields` parameter to
 complement `_fields` and permit specific exclusions, or alternatively to
 introduce a new `block-editor` context that does everything that `edit`
 does except render content.

 This trac ticket is intended to move that discussion forward and aim
 towards introducing a solution that can be used to speed up response times
 within the block editor.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49330>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list