▸ Consultant - Working with Ruby on Rails, WordPress, React, and more. ▸ Craftsman - Over 20 years of crafting software solutions for large and small companies. ▸ Cowboy - Riding horses and competing in barrel racing and pole bending. ▸ Connoisseur - Lover of fine coffee and craft beer.
▸ REST stands for Representational State Transfer. ▸ It is an architectural style for networked applications using HTTP. ▸ It can perform all CRUD operations via GET, POST, PUT, and DELETE. ▸ Communication between clients and server is done in either XML or JSON formats.
WANT TO USE REST IN WORDPRESS? You can build interfaces for both Web and Mobile, while letting your site admins keep the interface they know and love. Source: https://www.withfriendship.com/user/pintu/representational-state-transfer.php Mobile Web
LOOK AT THE POSTS ▸ Make sure that your Permalink settings are set to “Post name”. ▸ Create and publish some posts. ▸ You’re done. The plugin does the heavy lifting for you.
API WITH POSTMAN ▸ https://www.getpostman.com/ ▸ Postman is free, as a Chrome app or a Mac app. ▸ It lets you interact with the WP-API plugin. Source: https://www.getpostman.com/
WITH NPM ▸ NPM is a package manager that will handle the install of the JavaScript libraries that will power our project. ▸ It comes with Node.js, which we also need. ▸ Node.js should be installed via Homebrew on a Mac. ▸ Homebrew needs Xcode and its command line tools to work. ▸ Sounds complex, but as a developer, you probably know all this already.
Open a terminal window ▸ Navigate to the top level WordPress folder ▸ Create a new folder named quotes, and navigate into it ▸ Type ‘npm init’ and answer the questions it asks ▸ You are now ready to install the packages to use in the project ▸ We will look at the main ones in this talk
module bundler - think compiler. It’s main purpose is to take your project assets and create a JavaScript file ▸ To do this it can utilize the following ▸ Plugins - to extend Webpack ▸ Loaders - to process ES6, SASS, etc. ▸ Code Splitting - to allow code loading on demand ▸ Performance Optimization - caching and faster builds
state container - a single repository of all application data ▸ Data never changes directly, but is re-created via Reducers. ▸ Reducers are activated via ActionCreators ▸ The idea is that data flows down to UI components, and actions are sent up from UI components
a framework, just a library; so it needs the previous stuff to do anything ▸ Just the view part of the app ▸ Code is broken down into JSX components which compile into JavaScript ▸ Uses a “Virtual DOM”; an in memory copy of the DOM ▸ One way data flow; data in, actions out
LEFT FOR YOU ▸ Git - You need version control ▸ Organization - Where to put what in your project ▸ Testing - Automated testing with something like Mocha ▸ Deployment - Making a production build with Webpack ▸ Error handling - Gracefully catch errors and inform the user ▸ Authentication - Logging people in and letting them do special things like… ▸ Other HTTP actions - We did not cover POST, PUT or DELETE
plugin is easy to set up and allows new ways for you to interact with WordPress ▸ React and it’s related technologies can be used in the creation of plugins, themes, or totally separate interfaces. Go be creative! Source: http://chickensmoviereviews.blogspot.com/ It wasn’t too hard