Page MenuHomePhabricator

Automatically add a source code link for minimized scripts and styles
Closed, DeclinedPublic

Description

Something like:
"/*\nsource:\n{$strFullUrl}\n*/"

Would be great to quickly view documented source code. For example loaded "MediaWiki:SomeScript.js" would be:
/*
source:
http://en.wikipedia.org/wiki/MediaWiki:SomeScript.js
*/

I've notice this could be added in ResourceLoaderWikiModule but would be removed when minimized...

So if this cannot easily be overridden then probably not worth complication.


Version: 1.17.x
Severity: enhancement

Details

Reference
bz28475

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:36 PM
bzimport set Reference to bz28475.
bzimport added a subscriber: Unknown Object (MLST).

There's a ResourceLoader::getScriptURLsForDebug method already that would work for this. It would have a small perf impact, but it might be worth it.

In the meantime, you can use debug mode: https://www.mediawiki.org/wiki/ResourceLoader/Features#Debug_mode

Note that there is a cookie option, so you don't need to put &debug=true on every request.

load.php requests look like this:

loader.implement(.., function(){..});loader.implement(.., function(){..});loader.implement(.., function(){..});loader.implement(.., function(){..});loader.implement(.., function(){..});loader.implement(.., function(){..});

What is the point of having a url somewhere hidden inside with the location of the unminified source code of that little chunk in the middle of a larger body code with many different modules.

Closing as wontfix for lack of use case.

WikiModule already puts a /* Pagename */ comment in the code in debug mode (not in production mode). If you're looking to change that to a url instead of a pagename, please re-open the bug and clarify for that.