Topic on Talk:ResourceLoader/Migration guide (users)

He7d3r (talkcontribs)
Krinkle (talkcontribs)

Thanks, I've seen your efforts and help with the cross-wiki gadget mess we currently have.

Cross-wiki load.php requests are, however, discouraged as they can and will cause several undocumented behaviors which should not be dependent on and bugs that will not be fixed (since it's not an official feature).

ResourceLoader 2.0 will introduce the concept of using "Shared gadgets" from a declared "Foreign Gadget Repository" (like Commons is for files) which will do this much nicer and natively, thus removing the need to have a 1-line gadget importing it from another wiki.

Untill RL2.0 is ready, I recommend not wasting time with temporary solutions that are not supported and may break at any time. The legacy solutions currently around are no worse than before ResourceLoader made it's introduction and they will continue to work for a while, so I'd say stick to whatever it is now (such as action=raw).

He7d3r (talkcontribs)

Ok then. Do you know in which version of MW this will be available?

If it will take some time until its release, it may be worth to replace the live version of the shared gadgets by its minified version, so that users can get a smaller amount of code for these gadgets while this is not available by default. E.g. for commons:MediaWiki:Gadget-HotCat.js, the Google Closure Compiler would save 37.90% off the gzipped size if we select the option "Whitespace only" and 50.68% in the advanced mode (although in this case it displays 86 warnings which may need to be addressed).

Krinkle (talkcontribs)

We don't use the Google Closure Compiler but the minifier in ResourceLoader (based on Paul Copperman's JavaScriptMinifier).

Compare:

He7d3r (talkcontribs)

Yes, but since the "production" version of the code is only sent to the users which are on the source wiki (not to people who enable a "one line gadget" on other wikis), I was suggesting to do something similar to what you do on RTRC.js and its -dev.js version, i.e., to save the minified version directly in the wikipage which is being used globally, so that we have a stopgap until ResourceLoader can be used to generate it directly. And for that purpose, the minifier we use can be anyone one available.

Krinkle (talkcontribs)

You asked in which version of MW the new system will be available and were proposing to use Google Closure Compiler, obviously we're not talking about what's currently live on Wikipedia.

When central gadgets (or "Global gadgets" or "Shared gadgets") are ready, every use of them on any wiki will be "production". There will not be any one-line gadgets.