1

I'm looking for a way to reduce a javascript library/framework with the objective of only sending to the client (browser) only the necessary code. I've searched and I found that, for example, closure compiler can't remove jquery dead code.

How can I write a web application, using javascript or any other languages/frameworks/tools to archive this goal? I've nothing against frameworks but in mobile devices performance counts a lot. I've tested HTML5 mobile apps on cheap android devices and it's terrible to use due to performance issues. I want to extract maximum performance.

Community
  • 1
  • 1
Mário
  • 1,603
  • 14
  • 24
  • 1
    Do you mean you want to extract maximum performance in terms of load times, or of speed of functionality? – Rory McCrossan May 24 '14 at 13:42
  • Both. I want it to be as fast as possible. – Mário May 24 '14 at 13:45
  • Mobile(html5) has performance issues even the best libraries I know has it; there is where native and hybrid differentiates . – Dalorzo May 24 '14 at 13:47
  • @Mário in that case, go native and write the functionality you need. Note this will be a slow process, but that's the tradeoff with using a framework. – Rory McCrossan May 24 '14 at 13:48
  • Going native while targeting android, ios, etc takes time and money. I think that HTML5 have a place if done right. – Mário May 24 '14 at 13:49

1 Answers1

2

My 2 cents:

In term of performance, use good practises with a linter such as jslint, jshint, or eslint.

To check wich concept is better than another one, you can check at jsperf or make your own ones with benchmark.js.

For loading time, jQuery is a bit big for mobile. Zepto is a good alternative. Imo, it's better to concat all js files on mobile than async load the js.

MicroJs is a site which list all libraries that usually fit a specific need.

isThisLove
  • 269
  • 2
  • 4