SPA Sage Theme with the new REST API

Hey @staypuftman. I’ve given some thought to it, and I’ve also built a few of my own custom APIs and used Angular to build some SPA pages in Sage (as well as built a React app or two).

Here’s a few reasons as to why I haven’t tried anything serious or put a repo up:

  1. Every SPA I have built has individual requirements, no 2 projects have been alike. I know we can grab some posts and put them on a page, but if you do a search there are plenty of repos/projects to show that off. I’m afraid that even with the Roots team members being as awesome as they are, we’d end up with a lot of “I have a custom post type and I want to do x with it with my insert name of project here thing, how do I do that?” - we try to support people on our projects, and that would take A LOT of work.
  2. JS libraries move really really fast. To maintain updates to Angular or React apps would take a lot of work (way more than how much it takes to move with WP), and time I personally don’t have to donate. While I’ve worked with React, Angular, and Ember, I’m not sure Angular would be a good case, because of the divide b/w 1.x and 2.x crowd/implementations/future, and doing stuff with Ember requires so many custom adapters and setup things, not to mention their constant batches of changes, that would be way too much work. The best of the libraries to go with IMHO would be React, but it’s just a view layer. So then we’d have to decide how we want to grab data (redux/flux model? with WP? regular JS?), if we should be making stateless components, etc. Also, we’d probably need to make a babel gulp task just to make it work with the current workflow, which could need some looking at as well. (why use gulp when we can use webpack? - easy for SPAs)
  3. I’m pretty busy with my own crap, and a bit cautious about marrying WP to any specific JS thing. If you haven’t noticed, the Roots team takes their work pretty seriously. Almost every project we spin up and work on stays maintained and supported, so if we do make a new project, we’d want to make sure we can see it through.

All that said, you said this:

… which I totally agree with (and I fixed your P in WordPress).

If you think there’s something that I haven’t thought of, or something that you’d like to SEE started and maintained, and you can pinpoint specific specs and requirements for that project, I might be willing to at least take a look, and help spearhead that and get it started. I’m not talking about “help me build x project”, but something that could benefit a larger community of people. If you can come up with what that would be or should be, I could be down.

8 Likes