better.js icon indicating copy to clipboard operation
better.js copied to clipboard

How to ease integration in existing code

Open jeromeetienne opened this issue 11 years ago • 7 comments

Debug && Debug.privatize(this)

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne

If( Debug ){ Debug.privatize(this) Debug.monitor(this.position) }

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne

  • it is available now
  • it is quite intrusive in the code, but it is a first step
  • And it allows to unblock debug.js, which stalled due to lack of direction

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne

Include the

  • If included it is taken advantages of by your apps

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne

Add the script or not

If included, it is taking advantage of by your apps

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne

This type of declaration of your debug.js allow dead code optimisation. So if you dont include debug.js, the declarations code wont be in your minified code. Google closue compiler is said to be able to do dead code removal.

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne

node.js support

  • if Debug prefix is declared in Global, this type of declaration works well in node too

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne

  • this type of declaration is opt-in
  • debug.js is not a dependancy, it is an option
  • very important if you want to support it in a library

jeromeetienne avatar Jan 03 '14 05:01 jeromeetienne