Gadgets 3.0: Implement ability to create wiki-modules at a user level
Open, NormalPublic


From @Nux's comment on T29488#313444

I've submitted this bug (T29488) with specific needs in mind. There is no way I know to:

  1. Load user scripts in the header to allow actually running their code BEFORE the page starts to render (needed to inject CSS or faster adding of crucial elements).
  2. Load user scripts in order (without the need of contacting administrators).

I'm not sure, but I think this probably means we need to provide a way to set position = top on user scripts. Maybe it is related to the need of creating modules from wikipages, maybe not.

See also:

bzimport set Reference to bz34958.
bzimport added a subscriber: Unknown Object (MLST).
He7d3r created this task.Mar 4 2012, 2:12 PM

See also bug 27488 comment #68.

I suggest to rename this bug to "Allow creation of ResourceLoader wiki-modules on a user level", which will give a user script all ResourceLoader features (including the queue 'position', which is a ResourceLoader feature and should/can only by used by ResourceLoader modules).

Coming up with some kind of syntax to load imported user scripts from the top is not realistic in my opinion (nor practical).

Hrm, now I'm getting cranky because I think this is a dupe of bug 27488. Avoiding the dupe hammer for the moment, though.

a.d.bergi wrote:

(In reply to comment #0)

I'm not sure, but I think this probably means we need to provide a way to set
"position = top" on user scripts. Maybe it is related to the need of creating
modules fron wikipages (see bug 27281, bug 27561 and bug 25845), maybe not.

I think we should not provide a hacky way for setting "position=top". We really should go and implement wikipage-modules. I'm just not sure to which of these three bugs this here should be marked as duplicate.

None of those 3 are dupes. We now got:

  • bug 34958: Support for user-level resourceloader modules
  • bug 27488: Support for user scripts to have use load position (this will be solved naturally by 34958, but not marking as a dupe of it, bug 34958 is just one way of solving bug 27488).

These are currently filed under the MediaWiki core ResourceLoader component. That's fine for now but note that

  • User scripts are currently not loaded by ResourceLoader, they are "just" wiki pages loaded as raw scripts using plain HTML and JavaScript, nothing "MediaWiki"-ish about it. There is technically speaking no such feature as "user scripts" in MediaWiki.
  • Gadgets 3.0 will probably implement a feature that would replace (or introduce, depending on how you look at it) user scripts by allowing user-level repositories using JSON in the user space. At that point we could move these bugs to there, but lets keep it here for now.
He7d3r added a comment.Nov 1 2012, 8:35 PM

What about allowing the user to define modules at [[Special:MyPage/modules]], e.g.:


  • someModuleName
    • [[User:Foo/someModuleScript.js]]
    • [[User:Foo/moreModuleScript.js]]
    • [[User:Foo/someModuleStyle.css]]
    • [[User:Foo/moreModuleStyle.css]]
  • anotherModuleName
    • [[User:Foo/foo.js]]
    • [[User:Foo/bar.css]]
    • jquery.cookie (these are dependencies)
    • mediawiki.api
    • someModuleName
  • ...
Krinkle added a comment.EditedNov 1 2012, 8:52 PM

What format it will be in is not a problem. The major barrier is the infrastructure behind it. Having a local startup module, controlling cache properly, clashing module names, foreign sources etc.

The format you propose is not realistic because it doesn't make sense to invent a new format. We already solved this problem once in Gadgets with Gadgets-definition syntax. Which we then destroy in Gadgets 2.0 because it doesn't scale enough.

The format will be JSON because wikitext does not scale for this kind of thing (we need scripts, styles, dependencies, messages, load position, and possibly more: skinStyles, skinScripts etc.). We already solved the format problem in Gadgets 2.0.

To update, user scripts are now loaded by ResourceLoaderUserModule. However, it's still just loading a fixed bundle of scripts (e.g. vector.js and common.js, depending on skin), which is quite different than allowing users to delineate modules.

Krinkle changed the title from "ResourceLoader: Allow creation of wiki-modules on a user level" to "Implement ability to create wiki-modules at a user level".Nov 25 2014, 8:47 PM
Krinkle edited the task description. (Show Details)
Krinkle removed a project: Future-Release.
Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).
SamB added a subscriber: SamB.
He7d3r edited the task description. (Show Details)Apr 8 2015, 10:28 PM
He7d3r added a subscriber: Nux.
He7d3r changed the title from "Implement ability to create wiki-modules at a user level" to "Gadgets 3.0: Implement ability to create wiki-modules at a user level".Sep 19 2015, 1:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 19 2015, 1:11 PM
Danny_B added a subscriber: Danny_B.Feb 7 2016, 7:24 PM

Add Comment