better.js
better.js copied to clipboard
How to ease integration in existing code
Debug && Debug.privatize(this)
If( Debug ){ Debug.privatize(this) Debug.monitor(this.position) }
- 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
Include the
- If included it is taken advantages of by your apps
Add the script or not
If included, it is taking advantage of by your apps
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.
node.js support
- if Debug prefix is declared in Global, this type of declaration works well in node too
- 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