BVG BEACH CLEANING PROJECTS- ORISSA , ANDAMAN, PORT BLAIR
A team 43 C
1. Code compilation / build
Much less http requests
Tools:
concatenation
uglify / yuicompressor
•
•
http://www.flickr.com/photos/halfbisqued/2353845688/
2. Code compilation / build
Compile all js that we need:
One huge file
Compile all the js that the
current page might need:
Several smaller files
Create js groups according to page needs
http://www.flickr.com/photos/halfbisqued/2353845688/
3. Code compilation / build
Compile all js that we need:
One huge file
Compile all the js that the
current page might need:
Several smaller files
Create js groups according to page needs
What is the problem with that?
http://www.flickr.com/photos/halfbisqued/2353845688/
6. The new killer feature, that saves us!
Click here to
close
7. Code compilation / build
"the current page might need"
One page gets n+1 new feature:
The js compiled group for that page grows even more
heavy
The given feature is used on the page,
or
The visitor might use it on the page
Do we really need it onLoad?
Lots of unused code, that waits for the user:
overhead, slows load time.
http://www.flickr.com/photos/halfbisqued/2353845688/
8. Async loading!
Load only the most necessary js onLoad!
Then, for every feature the user wants,
load the js runtime.
• Feature based code, not page based
code
• Small lag in UX, but faster page start
• Loose module coupling, better code
http://www.flickr.com/photos/thenationalguard/8029811025/
9. Code compilation / build
Compile all js that we need:
One huge file
And what is the problem with that?
Compile all the js that the
current page might need:
Several smaller files
Create js groups according to page needs
http://www.flickr.com/photos/halfbisqued/2353845688/
10. Dependency handling
The problem with predefined js
groups:
• add js by planned use
(add a feature, that
can be used)
• add js by failsafe use
("this might come
handy" or "make sure to have this")
• group is built at deploy
http://www.flickr.com/photos/wongjunhao/2761709029/