Corporate JavaScript Tips

I am currently writing an article that covers tips / tricks / tricks when working with JavaScript in an Enterprise environment. An “enterprise” may be a bit ambiguous, so for the purposes of this article we will define it as: support for several web applications on a network that is not necessarily connected to the Internet.

Here are just a few of my thoughts for your creative juices to flow:

  • Ensure that all libraries are maintained in a central, accessible place on the Internet and that all applications reference these libraries (and not independent copies).
  • Version help libraries guaranteeing new versions will not break your applications (without jquery-latest, use jquery - #. #. # Instead).
  • Native application code namespace

What advice can you provide to help me?

+3
source share
2 answers

Check your javascript for maximum DOM size. IE6 / 7/8 will freeze based on the number of VM statements executed, as opposed to the actual execution time. JQuery regulators and regular expressions are especially bad.

Write less. Javascript, in particular, becomes very difficult to manage and debug outside of a specific set of sizes. Breaking functionality in different external source files may help, but always consider the best way to do what you are doing (ex: jquery plugin.)

, STOP. , jQuery, , jQuery.

DOM . jQuery . , DOM ( DOM, ).

. /jQuery. , .

; . , jQuery / , AOP.

DOM. , , .

jQuery. , FOUC DOM. .first-child, .last-child .. , jQuery.

+1

, ... :

1) . , HTTP-, , . . JS , , "" , .

2) , JS , ( ). . Java Jawr ( ). 1,2,3 ( "" ) 100 ( , RIA). , Jawr, , , script, .

3) - (, JBoss, GlassFish .., java), JavaScript , HTTP- (, Apache lighttd, nginx), , ( )

4) , jquery, Google CDN ( ).

5) Yslow, PageSpeed ​​, Ajax DynaTrace, , ..

6) mod_pagespeed, "" jawr

7) , , - JavaScript-on-demand loading

8)

, , - ...

+1

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


All Articles