Upgrade to Pro — share decks privately, control downloads, hide ads and more …

We need to talk about the REST API

We need to talk about the REST API

A non-developer guide to the opportunities, challenges and changes for WordPress coming with the REST API.

10 April 2016, WordCamp London.

Petya Raykovska

April 10, 2016
Tweet

More Decks by Petya Raykovska

Other Decks in Technology

Transcript

  1. WE NEED TO TALK ABOUT The
    rest api
    @petyeah
    #wcldn

    View Slide

  2. Human Made pm & events ❉ WordPress polyglots ❉ WordCamp Europe
    @petyeah
    #wcldn

    View Slide

  3. large-scale WordPress websites
    wordpress.com vip partner agency
    distributed team with ~30 humans
    @petyeah
    #wcldn

    View Slide

  4. @petyeah
    #wcldn

    View Slide

  5. @petyeah
    #wcldn

    View Slide

  6. feelingrestful.com
    A DAY OF REST ❉ a week of rest
    @petyeah
    #wcldn

    View Slide

  7. @petyeah
    #wcldn
    driven ❉ control freak ❉ has trouble delegating

    View Slide

  8. 25% of the web…
    @petyeah
    #wcldn

    View Slide

  9. from blog platform to
    application framework
    @petyeah
    #wcldn

    View Slide

  10. UNDERSTANDING
    THE REST API
    @petyeah
    #wcldn

    View Slide

  11. The REST API - the next milestone
    @petyeah
    #wcldn

    View Slide

  12. 2014
    State of
    the Word
    @petyeah
    #wcldn

    View Slide

  13. Enter the wordpress rest api
    @petyeah
    #wcldn

    View Slide

  14. why is this important?
    @petyeah
    #wcldn

    View Slide

  15. @petyeah
    #wcldn

    View Slide

  16. @petyeah
    #wcldn

    View Slide

  17. @petyeah
    #wcldn
    delivery speed

    View Slide

  18. @petyeah
    #wcldn

    View Slide

  19. @petyeah
    #wcldn
    solid
    backend

    View Slide

  20. @petyeah
    #wcldn
    security security

    View Slide

  21. @petyeah
    #wcldn
    modern front end

    View Slide

  22. @petyeah
    #wcldn

    View Slide

  23. @petyeah
    #wcldn
    backwards compatibility

    View Slide

  24. @petyeah
    #wcldn

    View Slide

  25. @petyeah
    #wcldn

    View Slide

  26. wordpress right now
    @petyeah
    #wcldn

    View Slide

  27. how will the REST API role change this?
    @petyeah
    #wcldn

    View Slide

  28. the REST API will help wordpress learn to delegate
    @petyeah
    #wcldn

    View Slide

  29. the headless cms
    @petyeah
    #wcldn

    View Slide

  30. @petyeah
    #wcldn

    View Slide

  31. 31
    @petyeah
    #wcldn
    Source: https://hmn.md/wordpress-rest-api-white-paper/

    View Slide

  32. power multiple front ends
    @petyeah
    #wcldn

    View Slide

  33. @petyeah
    #wcldn
    Source: https://hmn.md/wordpress-rest-api-white-paper/

    View Slide

  34. one module in a bigger stack
    @petyeah
    #wcldn

    View Slide

  35. @petyeah
    #wcldn
    Source: https://hmn.md/wordpress-rest-api-white-paper/

    View Slide

  36. That's all great, examples?
    @petyeah
    #wcldn

    View Slide

  37. @petyeah
    #wcldn

    View Slide

  38. A react native iOS app that reuses code from the
    browser app
    is used for create overlays on the map.
    uses APIs to gather geodata from Facebook, Swarm, Twitter,
    Instagram, and Tripit
    Wordpress provided stable central platform where data
    can be aggregated and delivered to the frontend
    nomad base
    Content
    platform & API
    LEAFLET React iOS app
    @petyeah
    #wcldn

    View Slide

  39. @petyeah
    #wcldn

    View Slide

  40. Node.js server enables server-side rendering
    React was used because it allows for isomorphic rendering
    wordpress at the backend + react fronted
    us two website
    react frontend
    single page app
    Node.JS
    @petyeah
    #wcldn

    View Slide

  41. @petyeah
    #wcldn

    View Slide

  42. A bunch of complicated technologies are used to render data
    to handle processes that happen on save
    the fronted is served by wordpress for seo reasons but data is
    received from web socket and rendered via react
    The Admin interface is a backbone app that uses the WordPress
    REST API. Constantly updated filterable stream
    ny Times live coverage platform
    wp frontend for seo
    Backbone + REST
    custom endpoints data rendered via react
    @petyeah
    #wcldn

    View Slide

  43. React updates the content
    react
    Updates are added on the
    backend or via SLACK ;)
    React wraps the posts
    area
    Request is served by
    WordPress, PHP generates
    markup
    JavaScript listens to Web
    Socket
    nytimes.com/live/{event}
    wp + php react Javascript wordpress
    @petyeah
    #wcldn
    Source: http://www.slideshare.net/ScottTaylor1/rest-in-action-the-live-coverage-platform-at-the-new-york-times

    View Slide

  44. @petyeah
    #wcldn

    View Slide

  45. Custom WordPress rest api endpoint makes the content
    available to the fronted
    text and images are rapidly posted via a third
    party mobile platform, polled and saved to
    WordPress post meta
    the data is displayed via a custom React.js front end where the
    user can easily and quickly read though the content or site back
    and watch new posts pop into view
    Data is delivered from wordpress
    WIRED live blog
    REact frontend
    wordpress data
    third party mobile platform Custom REST API End points
    @petyeah
    #wcldn

    View Slide

  46. opportunities
    @petyeah
    #wcldn

    View Slide

  47. opportunities
    Create context-specific solutions
    @petyeah
    #wcldn

    View Slide

  48. opportunities
    Create context-specific solutions
    Reusable, portable content
    @petyeah
    #wcldn

    View Slide

  49. opportunities
    Create context-specific solutions
    Reusable, portable content
    Separation of concerns
    @petyeah
    #wcldn

    View Slide

  50. opportunities
    Create context-specific solutions
    Reusable, portable content
    Separation of concerns
    Familiar backend for authors and publishers
    @petyeah
    #wcldn

    View Slide

  51. opportunities
    Create context-specific solutions
    Reusable, portable content
    Separation of concerns
    Integrate WordPress as one part of a
    content-authoring workflow
    Familiar backend for authors and publishers
    @petyeah
    #wcldn

    View Slide

  52. CHALLENGES
    @petyeah
    #wcldn

    View Slide

  53. Loss of wordpress core functionality
    CHALLENGES
    @petyeah
    #wcldn

    View Slide

  54. @petyeah
    #wcldn

    View Slide

  55. Loss of wordpress core functionality
    Disempowers wordpress site builders
    CHALLENGES
    @petyeah
    #wcldn

    View Slide

  56. the curious case of
    feelingrestful.com
    @petyeah
    #wcldn

    View Slide

  57. @petyeah
    #wcldn

    View Slide

  58. @petyeah
    #wcldn

    View Slide

  59. @petyeah
    #wcldn

    View Slide

  60. @petyeah
    #wcldn

    View Slide

  61. @petyeah
    #wcldn

    View Slide

  62. a few setbacks
    couldn’t edit menus
    couldn’t use previews
    couldn’t impact the front end in any way
    each small change on the website
    apart from the content needed a developer
    @petyeah
    #wcldn

    View Slide


  63. petya
    @petyeah
    #wcldn

    View Slide


  64. siobhan
    F*$^G
    REST API!!!
    @petyeah
    #wcldn

    View Slide

  65. Loss of wordpress core functionality
    Disempowers wordpress site builders
    CHALLENGES
    @petyeah
    #wcldn

    View Slide

  66. Loss of wordpress core functionality
    Disempowers wordpress site builders
    The necessity for structured, portable data
    CHALLENGES
    @petyeah
    #wcldn

    View Slide

  67. @petyeah
    #wcldn
    Data needs to be structured in
    a modular manner, separate to
    the CSS and HTML

    View Slide

  68. @petyeah
    #wcldn
    REST API driven sites will not
    rely on WYSIWYG in TinyMCE
    for page layouts

    View Slide

  69. Loss of wordpress core functionality
    Disempowers wordpress site builders
    The necessity for structured, portable data
    Progressive enhancement
    CHALLENGES
    @petyeah
    #wcldn

    View Slide

  70. Loss of wordpress core functionality
    Disempowers wordpress site builders
    The necessity for structured, portable data
    Progressive enhancement
    CHALLENGES
    knowledge deficits
    @petyeah
    #wcldn

    View Slide

  71. With the REST API, WordPress stops being a web development tool used in isolation.
    WordPress becomes just one module that is available in a web developer’s toolkit
    WHAT WILL CHANGE?
    @petyeah
    #wcldn

    View Slide

  72. WordPress as part of a larger stack
    what will change?
    @petyeah
    #wcldn

    View Slide

  73. WordPress as part of a larger stack
    a new (old?) Approach to project management
    what will change?
    @petyeah
    #wcldn

    View Slide

  74. WordPress as part of a larger stack
    what will change?
    WordPress developer will become backend specialists
    a new (old?) Approach to project management
    @petyeah
    #wcldn

    View Slide

  75. WordPress as part of a larger stack
    what will change?
    WordPress will be adopted outside of PHP communities
    WordPress developer will become backend specialists
    a new (old?) Approach to project management
    @petyeah
    #wcldn

    View Slide

  76. WordPress as part of a larger stack
    WordPress developer will become backend specialists
    WordPress will be adopted outside of PHP communities
    what will change?
    The emergence of funnelled, role-based admin interfaces
    a new (old?) Approach to project management
    @petyeah
    #wcldn

    View Slide

  77. @petyeah
    #wcldn

    View Slide

  78. WordPress as part of a larger stack
    The WordPress developer as a backend specialist
    what will change?
    The emergence of funnelled, role-based admins
    The enhancement of built-in WordPress functionality
    a new (old?) Approach to project management
    WordPress will be adopted outside of PHP communities
    @petyeah
    #wcldn

    View Slide

  79. themes are here to stay. blogs and small sites are not going anywhere
    wordpress will keep democratising publishing
    WHAT WILL not CHANGE?
    @petyeah
    #wcldn

    View Slide

  80. themes and theme shops will continue to function as before
    what will not change?
    @petyeah
    #wcldn

    View Slide

  81. themes and theme shops will continue to function as before
    wordpress will still be used for blogging,
    small sites and DYI sites
    what will not change?
    @petyeah
    #wcldn

    View Slide

  82. themes and theme shops will continue to function as before
    wordpress will still be used for blogging,
    small sites and DYI sites
    backwards compatibility will not suffer
    what will not change?
    @petyeah
    #wcldn

    View Slide

  83. themes and theme shops will continue to function as before
    wordpress will still be used for blogging,
    small sites and DYI sites
    backwards compatibility will not suffer
    what will not change?
    wordpress’ mission will remain the same:
    to democratise publishing
    @petyeah
    #wcldn

    View Slide

  84. you might be asking yourselves right about now.
    some important questions
    @petyeah
    #wcldn

    View Slide

  85. you might be asking yourselves right about now.
    is the rest api getting merged?
    @petyeah
    #wcldn

    View Slide

  86. and there is a bit of a glitch around how feedback is given to the team from the leadership
    it is. but it still needs work
    @petyeah
    #wcldn

    View Slide

  87. you might be asking yourselves right about now.
    how do you use it if it’s not merged?
    @petyeah
    #wcldn

    View Slide

  88. and has its own awesome team working on it that has no intention of abandoning it
    it’s available as a plugin
    @petyeah
    #wcldn

    View Slide

  89. is it safe to use in production?
    you might be asking yourselves right about now.
    @petyeah
    #wcldn

    View Slide

  90. the development teams at ny times and wided use it. how much more proof do you need?
    yes. we saw that a few slides back
    @petyeah
    #wcldn

    View Slide

  91. you might be asking yourselves right about now.
    will i be able to use the rest api?
    @petyeah
    #wcldn

    View Slide

  92. sorry.
    unless you are a developer: no.
    @petyeah
    #wcldn

    View Slide

  93. you might be asking yourselves right about now.
    why do i need to know about it then?
    @petyeah
    #wcldn

    View Slide

  94. it’s important you understand it when you write proposals or read rfps . if you ever want to do kick ass wordpress work
    it’s the future of wordpress
    @petyeah
    #wcldn

    View Slide

  95. What are endpoints?
    you might be asking yourselves right about now.
    @petyeah
    #wcldn

    View Slide

  96. This is a non developer talk
    but here are some resources you can use to further educate yourself:
    @petyeah
    #wcldn

    View Slide

  97. @petyeah
    #wcldn
    hmn.md/whitepaper

    View Slide

  98. @petyeah
    #wcldn
    wp-api.org

    View Slide

  99. @petyeah
    #wcldn
    hmn.md/wp-api/core/

    View Slide

  100. @petyeah
    #wcldn
    follow ryan on twitter @rmccue

    View Slide

  101. thank you!
    @petyeah
    #wcldn

    View Slide