Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/85637
Change subject: ResourceLoader: pass jQuery twice to 'implements' module wrapper
......................................................................
ResourceLoader: pass jQuery twice to 'implements' module wrapper
This must be done in two parts. A follow-up change will update the wrapper
signature in ResourceLoader::makeLoaderImplementScript to bind the arguments to
'$' and 'jQuery'.
Because almost all event-handling and DOM interaction is mediated by jQuery,
ResourceLoader could provide a per-module breakdown of the work performed on
each page view by passing each module a copy of the jQuery object that wraps
certain functions (like jQuery.fn.on) in module-aware profiling code. I expect
that profiling would only be enabled on a small fraction of requests. The
effect on ordinary page-views would be a possible small speed-up as a result of
jQuery look-ups resolving in module (rather than global) scope, but I expect
the difference to be neglible and it is not a part of my motivation.
Because ResourceLoader must bind both '$' and 'jQuery' to module scope, we pass
jQuery twice. A separate commit will update the wrapper function's signature in
ResourceLoader::makeLoaderImplementScript. This has to happen separately to
ensure that no module binds jQuery to undefined due to being loaded by an
out-of-sync version of mediawiki.js.
Change-Id: I0c9edac359ceb16fc273de1e51ea70322f18353e
---
M resources/mediawiki/mediawiki.js
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/37/85637/1
diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js
index 741e231..2ce626e 100644
--- a/resources/mediawiki/mediawiki.js
+++ b/resources/mediawiki/mediawiki.js
@@ -1003,7 +1003,7 @@
nestedAddScript(
script, markModuleReady, registry[module].async, 0 );
} else if ( $.isFunction(
script ) ) {
registry[module].state
= 'ready';
- script( $ );
+ script( $, $ );
handlePending( module );
}
} catch ( e ) {
--
To view, visit https://gerrit.wikimedia.org/r/85637
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c9edac359ceb16fc273de1e51ea70322f18353e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits