Last modified: 2012-04-16 09:16:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28805, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26805 - ResourceLoaderStartUpModule.php extendability
ResourceLoaderStartUpModule.php extendability
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Trevor Parscal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-19 03:26 UTC by Michael Dale
Modified: 2012-04-16 09:16 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
small patch to add hook to startup module to extend set of modules loaded at startup (1.51 KB, patch)
2011-02-09 20:20 UTC, Michael Dale
Details
updated patch with hooks documentation (2.25 KB, patch)
2011-03-05 00:49 UTC, Michael Dale
Details

Description Michael Dale 2011-01-19 03:26:46 UTC
Some minor changes to ResourceLoaderStartUpModule.php would help towards a path of extendability. ie the module set ( jQuery and MediaWiki ) should be a local method or variable so that extending classes can override "startup" library includes.
Comment 1 Michael Dale 2011-02-09 20:20:46 UTC
Created attachment 8114 [details]
small patch to add hook to startup module to extend set of modules loaded at startup

This is needed if you want your "loaderScripts" to have access to any shared framework code.
Comment 2 Roan Kattouw 2011-02-22 21:25:38 UTC
Could you explain in more detail what this is needed for?
Comment 3 Michael Dale 2011-02-22 21:39:44 UTC
This is needed for providing "core" functionality to module Loaders. ( There is no way to add a dependency to a loaderScripts ). When your loader Script is dependent on framework code, extending the startup modules is a way to express this dependency. 

You can see how its used in TimedMediaHandler extension.
Comment 4 Roan Kattouw 2011-03-04 10:51:31 UTC
(In reply to comment #1)
> Created attachment 8114 [details]
> small patch to add hook to startup module to extend set of modules loaded at
> startup
> 
* BEWARE: the round() call in the 'version' => setting has been removed, so this patch won't apply cleanly. Take care to resolve the conflict in a way that doesn't reintroduce the round() call
* foreach( $modules as $moduleName){ doesn't conform to whitespace conventions

OK otherwise
Comment 5 Roan Kattouw 2011-03-04 10:55:14 UTC
(In reply to comment #4)
> OK otherwise
Two more things:
* The hook should be documented in docs/hooks.txt
* These docs should mention that this feature is to be used sparingly and for lightweight modules, as modules added through this hook will *always* be loaded, unconditionally (well except for people using ancient browsers)
Comment 6 Michael Dale 2011-03-05 00:49:38 UTC
Created attachment 8243 [details]
updated patch with hooks documentation

Added hook documentation in updated patch. 

Roan I still see round( max( on line 169 of ResourceLoaderStartUpModule as of version r82575
Comment 7 Roan Kattouw 2011-03-05 20:58:59 UTC
(In reply to comment #6)
> Created attachment 8243 [details]
> updated patch with hooks documentation
> 
> Added hook documentation in updated patch. 
> 
Looks good now, except that "module scripts" in the hook documentation (last two words) should be "loader scripts". Feel free to commit after changing that.

> Roan I still see round( max( on line 169 of ResourceLoaderStartUpModule as of
> version r82575
Right, I apparently forgot to take that instance out. I will remove the round() call some time after you commit.
Comment 8 Roan Kattouw 2011-03-20 17:17:48 UTC
Patch applied in r84401.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links