Follows-up 9d390a09cd. It already wraps the only=script requests
for 'site' and 'user', but forgot about 'user.groups' which is
not 'scripts' but 'combined' (as regular module requests).
That request responds with mw.loader.implement whih will be absent
if the environment is unsupported.
With normal module requests, this is naturally covered by those
requests not being fired from mw.loader in the first place but
with hardcoded requests like these the condition wrap with
document.write is unfortunately required in the current reality.
Change-Id: Ib3a7378d0c44e601760fbbc5174da09bd7b7f492
* Inline canExpandStylesheetWith().
* Make resolve() take an array of module names instead of being flexible
(taking either a string or an array). It's a private method, so it doesn't
need to have a cute API.
* Use simple string concatenation rather than [].join in pad()
* Make allReady() more efficient by having it bail early as soon as any
non-ready module is encountered.
* Add anyFailed(), which is a complement to allReady().
* Remove filter(). In more than one place, it was used to check whether a
module in some specified state existed in a list of modules, which is
inefficient, since filter() continues iterating through the array of modules
after finding a match and because it constructed an array with the matches,
which was not needed.
* Replace some verbose array iteration with $.grep / $.map / $.each.
Change-Id: I22a2f824488ba39d03b546ac8560f551a3198d7f
Follows-up 2ea420eed8. Without this, the startUp() is never called,
and mw.config remains undefined which caused some of the examples
to no longer work properly.
Also move onerror handler to first <script> (follows-up a64a07d).
Exceptions from other code (eg. startup or mediawiki modules),
were not being caught.
Also include 'error' in the line being logged from onerror.
Change-Id: I3956da40b0bd862acab6d4552932aa609c17d569
* Make logging function not depend on 'mw' existing.
* Add window.onerror handler.
* Keep exporting to mw.log because that's what existing examples
use and is what uses should copy for interoperability with the
regular runtime.
Change-Id: I2925532035974343125e34084f9ac7c8dd1fa279
This is just the db part. The changes to UI validation code will
come in a dependent patch later.
This changes the max size of various *_comment, *_description
and *_reason fields to be 767 bytes. This size is chosen to
be consistent with the largest we can get away with while
still having covering indexes.
It also unifies the various data types of these fields to
varbinary. (Note, this was previously done and reverted in
r80547, but I don't think the reason for revert applies to
the edit summary fields)
MyISAM has a much smaller max index size, and this wouldn't
work with that storage engine. However, none of these fields
are used in default indexes (only in WMF indexes), so this
should not be an issue for anyone using MyISAM. Postgress
and sqlite already supported the larger edit summary size.
Note: This patch increases min mysql version to 5.0.3.
Bug: T6715
Change-Id: I8558e80a18e4591f07f2c3e80f792ea4435c4e71
The profileIn/profileOut pair should be covered by the Xhprof profiling
of the method calls it was wrapping.
The profileDBIn/profileDBOut pair are covered by profiling done by the
Database class.
Nothing in extensions in Gerrit is calling anything besides the
profileIn/profileOut pair (and likely those are only to avoid core
formerly throwing exceptions from internal profileDBIn/profileDBOut
calls), and nothing in core or extensions-in-Gerrit is using the methods
for fetching profiling data.
The methods are left as stubs for now to allow for backwards
compatibility in extensions.
Change-Id: I05ba4e2762dc86d5e2bafc183dce701239b43f5c
This patch adds a metric data service object to the IContextSource interface,
with full support for StatsD meters, gauges, counters and timing metrics, via
the liuggio/statsd-php-client, which this patch also introduces.
Usage example:
$stats = $context->getStats();
$stats->increment( 'resourceloader.cache.hits' );
$stats->timing( 'resourceloader.cache.rtt', $rtt );
The metrics are flushed to a StatsD server, which may be specified via the
'StatsdServer' configuration key. If no such configuration key exists, the
metrics are discarded.
The StatsD client supplants MediaWiki's StatCounter class. wfIncrStats()
will continue to work, but it will delegate to the StatsD data object.
Change-Id: Ie10db1c154d225971398e189737de7c560bf0f90
Restbase, the REST content API service, is to be queried instead of
Parsoid by current Parsoid users (most importantly VE). This patch
introduces the Restbase virtual REST service class and transparently
maps Parsoid calls into Restbase ones if parsoidCompat is set when
creating the service object.
Additionally, $wgVirtualRestConfig is introduced in DefaultSettings.php. This
is a first step towards global service configuration and management.
Bug: T89066
Change-Id: I4d4043e5052327bbd789331f1c05b607c45fe7cb
* The data directory can now be set via the construction params
* A standalone factory method now replaces the subclass
* Also made mDatabaseFile protected
Change-Id: I1791fd4f630e5c121fa7f68f473411a7c12d0c97
* Move configuration to /jsduck.json per standard. This way
it can be run as plain '$ jsduck' without needing a maintenance
script or custom Jenkins job. Similar to JSHint, JSCS, Grunt,
and Gem etc.
* Move --processes=0 from maintenace script into config file.
This should've been in the config file all along and serves as
workaround for https://github.com/senchalabs/jsduck/issues/525.
* Use grunt-contrib-copy instead of a symlink for resources.
For local development a symlink works fine, but for publishing
from Jenkins to doc.wikimedia.org the /docs/js/ directory needs
to be standalone. This was previously done with a manual post-build
step that added an additional rsync, but this logic should be
in the repository so that the doc entry point can be simplified
and standardised to 'npm run-script doc' for all projects.
Change-Id: Iaaaac50ee78dd9ff8f24f1ef3a3685ad51cf33b2
The Chinese conversion table is substantially updated to fix a lot of
bugs reported in recent years, and the script generating conversion
table (LanguageZh.php) is also modified to facilitate the maintenance.
Zh-sg and zh-my is set to fallback to zh-cn to improve reading
experience, since there is only trivial difference among them, just like
zh-hk and zh-mo. Further optimization for zh-sg and zh-my will be
performed in local conversion table of Chinese WikiProjects.
Bug: T91620
Change-Id: I1bb0315d6d7a2c9653905654d933942e362bcc42