Backbone.js and PhoneGap, one or more pages?

I am trying to create a simple application in PhoneGap and Backbone.js. The application has a login page, which, upon successful login, sends the user to a simple menu with several parameters. The user has the ability to view his saved lists, view a list of items, or view an information page. I know how I want to structure all the Views and Models, so the question I have is whether it all on one page has any drawbacks compared to using multiple pages.

To break it into smaller parts:

  • Loading all javascript on one page has serious performance implications?
  • If the router closes, .remove () and .unbind (), all the current view when switching to a new view, am I still risking memory problems?
+7
source share
1 answer

The backbone platform was developed for use in SPA applications. I'm not saying that you cannot skip Backbone for several pages, but, in my opinion, this adds more complexity. From your description, I would save your application as a SPA.

Secondly, create an application using modules. Use a library like require.js. I could not recommend this. I won’t go into too much detail about why you should use it, because you can learn more about it here (I would recommend reading the entire book). When your application is ready for deployment, you can use r.js, require.js build script. This will merge all or some of your modules into a single file. This will significantly speed up the performance of your application, especially if you have a bunch of modules.

Finally, with regard to memory optimization, I am using a method developed by Derick Bailey, which you can read here .

Hope this helps.

+6
source

All Articles