-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Provide a way to turn off debugging info in production #8423
Comments
So my initial thoughts are to move all attaching of |
Also I think we should just disable this debugging information for all builds by default. It is trivial to enable if it is needed. |
Obviously we would need to implement updates to Protractor and Batarang to support this |
And also the ngScenario runner would need updating too |
the scenario runner is deprecated anyways, so why update it? |
Because although it is deprecated it has not yet been removed and so would suddenly break when upgrading to the new version of AngularJS. |
ng-inspector doesn't make use of the ng-binding classes, so this change wouldn't affect it. Tools could also simply look for the Thanks for the heads up by the way! |
Will the scenario runner be kept alive for Angular 1.3? Because if not, this might be a good moment to remove it... |
I don't believe it is removed in 1.3 - @angular/angular-core? |
Support in Protractor should be very easy if it's just a change in I suspect that there are many little custom applications and debugging aids out there that use the Is there currently any functional difference between minified and non-minified angular? |
Hi, Enabling those checks during protractor tests would be a good way so that an Angular user would not need to care for the configuration. |
For #8430 I would like to provide other switches for protractor as well. However, it feels like those switches are better placed into an e2e mock module that angular provides (just like the The only problem with an e2e mock module in AngularJS is how that gets loaded. For your case of turning off the debugging information, this module is really required, as otherwise tests that select bindings will not work. One solution could be to make the e2e mock module part of the non minified angular core build, and remove it during minification. What do you think? |
I think it is a good idea to package this up into a module. From discussions with @tbosch we realised that ideally Protractor should have an adaptor architecture (similar to Karma?) which can be configured for each project that is using Protractor (in the The AngularJS adaptor will provide the bits that are currently hard-coded into Protractor for injecting modules into AngularJS applications, waiting for AngularJS requests to complete and providing AngularJS specific selectors. This adaptor would by default inject this "debugBindings" module into the application before running the tests. The adaptor architecture would then free up Protractor to have different (non-hard-coded) features for AngularDart and AngularJS v2 applications. |
And then for #8430 we could have another addition to that adaptor. |
I took a look at #8430, sorry for the delay! Adapter architecture seems reasonable but I'm not sure it's worth it for 3 use cases (AngularJS, AngularDart, AngularJS v2). It seems like a lot of overhead to avoid a couple conditionals, and the set of cases isn't going to expand much. @tbosch I think it would be helpful for this discussion to have context on what other switches you'd like to turn off for debugging/e2e testing. |
Ah, thanks. I think using Protractor to output warnings about your application health (a la #8055) is a cool idea but probably needs more thinking through. How are the errors surfaced? |
Landed via #8802 |
angular sets ng-binding class and other classes as well as adds
$binding
object to jqLite/jQuery data storage. This info is not needed in production and is only used by tools like batarang and protractor but are causing performance issues for apps with lots of bindings.These tools can already intercept the angular bootstrap and change configuration of the app if needed, so they could turn on the debugging info on demand.
I'm thinking that to control the behavior we could use
$compileProvider
and expose a setter likedebugMode()
that tools could use.The debugging info should be off by default in production.
Open questions:
cc: @btford, @rev087, @juliemr
The text was updated successfully, but these errors were encountered: