What are the benefits of PhoneJS in relation to a regular backbonejs / HTML5 application?

I tried using PhoneJS - it's pretty easy to get started, and seems to provide a good structure. However, I usually prefer to avoid pre-installed frameworks, as they limit me flexibly. My main problems 2:

  • PhoneJs uses jQuery, while many people recommend using Zepto for better performance.
  • Can I use my own trigger.io/phonegap plugins?
  • As a rule, you should avoid using "large" frameworks for mobile applications (for performance reasons) - why some people are against jQuery Mobile. Phonejs is pretty big. Does anyone have any experience with PhoneJS?
  • Frames reduce flexibility - how easy is it to configure PhoneJS / expand?
+4
source share
1 answer

1. PhoneJs uses jQuery, while many people recommend using Zepto for better performance.

If you are configured to use Zepto, even though certain tests indicate that it does not work better than jQuery as a whole, most likely I will not be able to subordinate it to jQuery without much difficulty. Zepto is a jQuery clone with code that handles extreme cases for older browsers. Since you are developing for mobile devices, I suspect this is not a problem. The Foundation 4 framework, as an example, allows you to choose between them.

2. Can I use my own trigger.io/phonegap plugins?

There is no reason why you could not use PhoneJS to structure your code and PhoneGap OR Trigger.io for assembly, packaging, and deployment. PhoneJS and PhoneGap / Trigger.io are the frameworks that are aimed at solving completely different (but additional) problems. In fact, the PhoneJS page specifically mentions packaging applications using PhoneGap. You will certainly be able to make full use of the APIs and plugins offered by either of the two (PhoneGap or Trigger.io) that you decide to use with PhoneJS.

3. As a rule, you should avoid using "large" frameworks for mobile applications (for performance reasons) - why some people are against jQuery Mobile. Phonejs is pretty big. Does anyone have any experience with PhoneJS?

Besides affecting the boot time, which will not be a problem if you use trigger.io/PhoneGap to pack your code as a native application, there is no need for a correlation between the frame size and the quality of execution. As far as I understand, the main problem with jQuery mobile is the amount of markup that it creates to display the components of its interface ( link ). However, I recently used jQuery mobile on a mobile app packed with PhoneGap, and the performance was great. Apparently, I expect PhoneJS to be the same.

Please note that any answer you get regarding the effectiveness of the structure from the one who used it is likely to be quite subjective. If you're worried, the best suggestion would be to download the framework, use it to prototype a representative subset of the functionality of your application, and test it on the lowest device that you plan to configure.

4. Framework reduces flexibility - how easy is it to configure PhoneJS / expand?

A good structure can limit your flexibility a bit, but, I would say, positively. This will encourage you to structure your code so that it is consistent, unrelated, and maintainable. Why waste time inventing the wheel when someone has already done all the hard work for you?

Using the framework eliminates the need to make many boring decisions about the structure of files and codes and free up your time so that you can focus on creative and flexible solutions to your problems in a real problem area (i.e., which is unique to your application).

PhoneJS consists of a set of user interface components and a Knockout MVVM framework, so it’s about the same as jQuery mobile and Backbone. If you don't like the user interface components, you can edit the code to improve them, or not use them at all. You will get an idea of ​​the knockout flexibility by looking at the documentation, but referring to my first point, if you find yourself fighting with it, you probably won't get anything better from it.


TL; DR . It is best to evaluate whether the structure is suitable for your requirements in terms of performance and flexibility. Download it, look at the code, play with it, prototype some functions yourself, and then make a decision based on your experience.

+14
source

Source: https://habr.com/ru/post/1499505/


All Articles