User:Tim Starling/RL debug ideas

[22:08:31] 	RoanKattouw: I'm thinking that the debug parameter to RL should be a list or associative array rather than boolean [22:08:54] 	there are lots of debug features that I'd like to have and to be able to turn on and off from the query string [22:14:35] 	TimStarling: What else do you want to be able to debug besides minification? [22:15:09] 	I thought most of the other RL options were split out into their own URL parameters. [22:15:23] 	well, if we can switch minification on and off, then we can do other optional transformations to the JS as well [22:15:55] 	?debug=true/false currently just undoes the minification, right? Or does it have other features? [22:16:17] 	it changes the output completely [22:16:24] 	Hoenstly, the part about debugging that most annoys me is &amp; --> & in URLs. [22:16:26] 	new bugs appear, other bugs disappear [22:16:30] 	it's not the same system [22:17:07] 	so for a start I would want to make it so that you can have output which is basically the same as the production output, except without minification [22:17:23] 	I think people argued that that wouldn't happen when this was being discussed before being implemented.. [22:17:59] 	I thought that was the purpose of the debug parameter. [22:18:16] 	also I've complained previously that it's difficult to inspect objects with private variables using a shell like firebug [22:18:32] 	I found that if you have a function inside the object's lexical scope that does this: [22:18:42] 	function eval(s) { return eval(s); } [22:18:49] <TimStarling>	then you can access any private variable like this: [22:18:58] <TimStarling>	obj.eval('varname') [22:19:11] *RoanKattouw 	gets back from grabbing lunch [22:19:15] <RoanKattouw>	Yeah, that sounds useful [22:19:26] <Dantman>	Just don't enable ES5-strict [22:19:51] <TimStarling>	but maybe some people don't want to break the privacy model or are afraid of this feature being used in production [22:20:21] <TimStarling>	so my idea is to have a comment /*MW_DEBUG_CLASS*/ that injects such debug functions only in a certain debug mode [22:20:35] <RoanKattouw>	hmm [22:20:56] <RoanKattouw>	You could also inspect private vars by setting a breakpoint in an arbitrary method of the object, then call that method from the console [22:22:34] <TimStarling>	another debug feature I would like to have, inspired by bug 34538, is the ability to execute all the modules at the end of the [22:22:57] <RoanKattouw>	You mean load everything early and defer nothing? [22:23:18] <TimStarling>	something like that [22:23:41] <RoanKattouw>	That wouldn't be too hard to do [22:23:58] <RoanKattouw>	Just set a flag in the loader that makes it ignore the async parameter and do everything synchronously [22:24:20] <RoanKattouw>	(assuming $wgResourceLoaderExperimentalAsyncLoading is gonna default to true then go away) [22:24:45] <TimStarling>	and another debug feature I'd like to have is an option to generate vastly more debug output on the console [22:25:10] <TimStarling>	like, similar to the amount that MediaWiki generates to its debug log [22:25:35] <Joan>	The browser console? [22:25:41] <TimStarling>	yeah, console.log [22:25:53] <TimStarling>	or wherever, you could abstract it out [22:26:30] <TimStarling>	maybe we could have a sampled remote logging feature [22:26:37] <TimStarling>	it could post all the log messages back to a server :) [22:26:56] <Joan>	Error reporting functionality in MediaWiki? [22:27:58] <TimStarling>	Joan: well, we have error reporting functionality already, just not on the client side [22:28:17] <Joan>	I was thinking of what newer versions of Firefox do. [22:28:43] <Joan>	When you open them, there's a drop-down below the URL bar asking about collecting anonymous debug info. [22:28:46] <TimStarling>	it wouldn't pop up a dialog box asking you to agree to submit personal information [22:28:58] <TimStarling>	because we wouldn't be collecting anything that we didn't know already [22:29:23] <TimStarling>	except for things that aren't personal information, like whether JS breaks on some browser or not [22:31:27] <TimStarling>	anyway I'm thinking that all these debug options could be combined into an associative array, with a compact format for query strings, like debug=nominify|loglevel=3|nodeferload