[wp-trac] [WordPress Trac] #38342: Quick Draft: Leverage REST API endpoints
WordPress Trac
noreply at wordpress.org
Tue Oct 25 21:17:48 UTC 2016
#38342: Quick Draft: Leverage REST API endpoints
----------------------------------+------------------------------
Reporter: adamsilverstein | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: needs-patch REST-API | Focuses: javascript
----------------------------------+------------------------------
Comment (by aduth):
The above patch is more-or-less functionally complete. The experience
should feel much the same as it is currently.
[[Image(https://cldup.com/1JEVwhyCPH.gif)]]
Some thoughts and pain points encountered in the course of implementing
this:
- Bootstrapping data helps in displaying recent drafts more quickly, but
there's still a delay for as long as it takes for the dashboard script to
load. I added some placeholder elements to give the illusion of incoming
content and reduce the jarring effect of items suddenly appearing.
- It's still not clear how we'd access certain data from JavaScript.
Content such as: formatted dates, links where filters are run server-side
(e.g. edit link), truncated content, etc. Script localization, porting
functions to JavaScript, and newer browser features like
[[https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat|Intl.DateTimeFormat]]
(with appropriate fallbacks) can help achieve these. Other content might
require filters on the API endpoints return values themselves.
- Quick Draft already requires JavaScript anyways, but it's worth
consideration for if and how content should be rendered "isomorphically"
(i.e. complete markup sent from the server, but thereafter controlled in
the browser). This could help remedy the need for placeholders as the
script loads, but the state of tooling is such that the logic would need
to be duplicated to implement (rendering in PHP/Backbone, querying from
REST API/WP_Query).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38342#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list