Still not finding anything I used a super simple application Thomas Davis had which was just a view that bound a prompt to click events, like this. I did find a few backbone.js tutorials and started going through two of them to compare to my app, trying to find the problem. So by now my hour was running out and I had 90 lines of backbone.js code that wasn't working. Great for experienced developers but really shitty for beginners. The official backbone.js docs is 69 pages of API. I figured there was something I was missing so I want back to the official docs to see if there was a simple tutorial. Even skipping over a lot of the stuff on the first pass it still took quite a bit of time.Īnd nothing worked. step 1, step 2).Īfter reading the docs and code for the todo application twice, I started to mimic the parts I wanted for my app. It's just that the documentation was in the form of describing each part of the code and not in a tutorial style (e.g. I figured this would be great since I could read about how the application was put together while seeing the actual code.ĭon't get me wrong, the todo application is very well documented and even uses localStorage which is what I was planning to use for my Running application. I clicked through to the examples and found that Jérôme Gravel-Niquet created a Todo List application that came with the annotated source. I read the short introduction to backbone.js but it wasn't that useful, just an executive summary of the project. Pretty simple to model and much more interesting than yet another todo list. Then there are calculations that can be done on individual or groups of objects: average pace, total distance in a month, speed trends, etc. The runs are collected into a Running Journal which is just a time based collection (Array). You have an object (a Run) with data attributes about the run. For those who don't know, many runners keep track of each run in a journal so they can see progress and spot any problems in training. While running I had the idea of building apps that would record my running, like a running journal. In previous weeks I've done a todo list but todo lists are overplayed. App Ideaīefore I get into what happened, I wanted to write about the new app idea I'm going to try building. Unfortunately, the session was worthless. Of all of the technology I've been wanting to learn, backbone.js has been the one I've been the most interested in. In other words, the data is retrieved from the database, filtered, then returned to the application.This post is part of my weekly tech learning series, where I take one hour each week to try out a piece of technology that I'd like to learn.įor this week's tech learning session I decided to tackle backbone.js. We felt strongly that Collections needed to preserve these conventions while employing the SPA particularly because so many plugins use these mechanisms.Ĭollections relies on this data being prepared on the server before being sent back to the client side application. Furthermore, WordPress shortcodes can be saved within a post’s content, which are transformed to content when printed. This is a popular way for plugins to change post content as it does not permanently change the content. Due to filters, the data can be altered via PHP code, which allows the final state of the data to be different than its original state in the database. In WordPress, data in the database is not the final form of that data. We specifically decided to build a limited JSON endpoint into Collections because we wanted to increase the probability of plugin compatibility in the theme. Since WordPress does not provide a JSON API, a JSON endpoint was created for use with Collections. When a new page is loaded in the Collections Single Page Application (SPA), an AJAX request is made to the server, which returns JSON data that is sent to a JavaScript (JS) template and rendered on the page. In this post, I will discuss some of the measures we took to increase the probability of plugin compatibility in Collections. Backbone.js and Collections: Plugin compatibilityĮnsuring plugin compatibility within the Single Page Application in Collections was a major challenge.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |