| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Magnify clip isn't present in print styling
* Print and screen thumbborder are different
* Print thumbinner and thumbimage borders are absent
Bug: T287965
Change-Id: Ie1dac57412da7da3e73eb39ef20a6077923860d6
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Upgrade Vue to @vue/compat version 3.2.23
* Migrate Vue.createMwApp to Vue 3 API
* Add backwards-compatible wrapper emulating Vue 2 behavior for
new Vue( { el: '#foo', ... } ) and
new Vue( ... ).$mount( '#foo' )
* Make @vue/composition-api an alias for vue, for b/c
* Convert resources/src/vue/ to ES6
* Ignore resource/src/vue/ for jsduck, since it doesn't support ES6
* VueComponentParser: Remove check for only one root node
Bug: T251974
Co-Authored-By: Lucas Werkmeister <lucas.werkmeister@wikimedia.de>
Depends-On: Ica0c0d0d6247383796d39199e50a9aff917f5b53
Change-Id: Ibd618765f962f57984994604c61b1aff9e6a778d
|
|
|
|
|
|
|
|
| |
Follow up to I076fddda07dd734f76277376ba6361bff68b7c36
Also, adds a comment about -legacy being frozen.
Change-Id: Iced54fb31c967975248bfc9908d904fa41824307
|
|\ |
|
| |
| |
| |
| |
| |
| | |
This helps highlight what's different between the two.
Change-Id: I076fddda07dd734f76277376ba6361bff68b7c36
|
| |
| |
| |
| |
| | |
Bug: T254646
Change-Id: I2b120f0b9c9e1dc1a6c216bfefa3f2463efe1001
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows the backend to do whatever it can to ensure atomicity, and
is also easier to read, since the intent is obvious.
Change-Id: Ibbfecd92a2c6d9a5997ca37ea101e068bd1e8202
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
== Background ==
The `user.options` module is private, and thus has to be embedded in
the page HTML. This data is quite large. For example, on enwiki the
finalized mw.user.options object is about 3KB serialized/compressed
(7KB uncompressed).
The `user.defaults` module is an implementation detail of
`user.options`, and was created to accomplish mainly two things:
* Save significant data transfers by allowing it to be cached
client-side without being part of the article.
* Ensure consistency between articles and allow faster deployment of
changes, by not being part of the cacheable article HTML.
All our pageviews already load `user.defaults`, as a dependency of
the popular `mediawiki.api` and `mediawiki.user` modules. These are
used by `mediawiki.page.ready` (queued on all pages), and on Wikipedia
these are also loaded on all pages by ULS, VisualEditor, EventLogging,
and more.
As such, in practice, bundling "user.defaults" with "mediawiki.base"
will not cause the data to be loaded more often than before.
== What ==
* Add virtual "user.json" package file with the same data that
was previously exported by ResourceLoaderUserDefaultsModule,
and pass it to mw.user.options.set() from base module's entry point.
An alternative way would be to use a "user.js" file, which would
return a generated "mw.user.options.set()" expression. I went
for exporting it as JSON for improved maintainability (reducing
the amount of JS code written in PHP), and because it performs
slightly better. The JS file would implicitly come with a file
closure (tiny bit more bytes), and would then be lazy executed
(tiny bit more time).
The chosen approach allows the browser to compile the JSON
off-the-main-thread ahead of time while the module response downloads.
Then when the module executes, we can reference the JSON object
and use it directly.
* Update internal dependency from `user.options`.
* Remove `user.defaults` module without deprecation. It is an internal
module with no direct use anywhere in Git (Codeseach), and no use
anywhere on-wiki (Global Search).
Change-Id: Id3916f94f75078808951863dea2b3a9c71b0e30c
|
|\ \
| | |
| | |
| | | |
makeLoaderImplementScript()"
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This private method checked for debug mode, and generated the wrapping
code in either spacious form or condensed form.
The important thing to note is that $scripts being wrapped here are
always in original form, and thus the returned string still needs to
be minified before we transfer it to the client.
The only caller is makeModuleResponse(), which passes the result
to filter() for minification as-needed. Hence we don't need the extra
complication here of manually minifying it for production, we can let
the minifier take care of that instead.
Bug: T32956
Change-Id: I80559c0c257bf5c08c015373d845a6c992dc9e0b
|
|\| | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
== Why and what ==
It is important that we don't cache the result of minifying the
`user.options` blob, because it varies on every page (details below).
But, it is okay to minify it.
Today, we don't minify it because the only content of this blob is
one line of JSON, and that JSON is already generated without spaces.
I would like to start minifying it so that:
1. The "mw.loader.implement" wrapper will get minified. Right now
we maintain a copy of the wrapper that is minified by hand. In the
next patch, I will remove this, which will introduce whitespace
for "user.options" unless we enable the minifier.
2. We can remove more complexity and state internally without worrying
about whether it will still be minified.
3. We can make the output even smaller by not having to preserve the
`/*nomin*/` instruction behind. This instruction is used today
mainly for cases where minification might break the output, so it
is important to preserve in case it is concatenated and passed to
the minifier a second time later. But, for user options we don't
need this protection, and so we can save a few bytes by removing
this instruction at the same time.
== Background ==
Act 1
In 2014, with task T84960, we determined that caching of `user.tokens`
minification is problematic for system stability and also not useful.
* This module contains security tokens that are different for every
pageview and for every user. This means every time we generate a
web response, we have different tokens, and thus generate different
<script> content, and thus there is no use of caching the result,
because we would never use it. The next time we get a different
script, and will have to minify it again. That's okay, it's small
and takes no time at all to minify.
* If we stored it in the cache, it would not only be useless, it would
also compromise the effectiveness of the php-apcu cache for all other
parts of MediaWiki, because when APCu is full, it will have to delete
unrelated caches to make space, thus causing more calculations to
be repeated in other places.
In commit 6fa48939 (I6016e4b0) we simply changed the script generation
to disable caching when minifying the private 'user.tokens'
module, which solved the task.
Act 2
In 2015, with commit b7eb243d92 (Id6f514206), the minification logic
was changed from "per response" to "per module within response",
and as part of that the logic was also generalised from being just
for `user.tokens` to be for "private modules", which is essentially
the same (since user.tokens is the most common private module), but
was preparation for a few other things:
* Some extensions (like AdvancedSearch) also create their own private
modules and thus benefit from this automatically.
* In later years we would add support for previewing user scripts
and gadgets, which turns a public module temporarily into a private
one to be able to execute it with the previewed script content.
These also don't need to be cached, and this correctly disabled
caching for those.
* We have "user.options", which is similar to "user.tokens", but does
not change on every page view. It does not need to be cached
because it is so small that is about as fast to just minify it
than to go through the cost of hashing, keying and querying the
cache.
* We have merged `user.tokens` into `user.options`.
Act 3
Then, with commit ca30efa30 (Ic1d802ee20) this was automation was
removed in favour of the FILTER_NOMIN instruction which disabled both
caching *and* minification. The was accepted because we realized that
we don't need minification for the "user.options" blob because it is
just one line of JSON, and the JSON is already generated without
whitespace.
Change-Id: I6d125fc89d8964325ec068a0746b00810e155858
|
| |
| |
| |
| | |
Change-Id: I955283c9df1601ab4fa69b472268194210f30bb4
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Created new ResourceLoaderContext::getUserIdentity
For anon requests no user identity is created.
Change-Id: I07084e8949a634dbb0b45e3fa51af2dbb28bdab4
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The null check for the class property packageFiles needs change to
check the return value of the function instead, because Phan would
report an issue that a null value is used in the foreach.
Phan does not understand the relation between the return value and the
class property.
When using a local variable then Phan can check
that the value is never null when used.
Change-Id: I48ac8a8fe55ae7b4e13bc94d2f2d2ede01fbc68b
|
|\ \ \
| |_|/
|/| | |
|
| |/
| |
| |
| | |
Change-Id: Ie8566c0e441d77ecd9cdf1220996deebdcd77fa7
|
|/
|
|
|
|
|
| |
implode is documented as taking a string[], not mixed with int or null.
Explicitly cast or remove those instead of the implicit handling by PHP.
Change-Id: I0fac52c861bf85e09571b61a899b7a041aa77914
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Do it self to avoid the global state of the Timing class within the
resourceloader.
Replaced the deferred update with a scoped callback to send stats on all
possible return path for the called function, but directly when needed
and not deferred, which can make wrong times.
The old code was using a fix mark set be
MediaWiki::doPostOutputShutdown, where a defered send does not has
impact of the send stats
Change-Id: I5fec6a73db3e7c3ac6a6ac33bb293727ae3a38ca
|
| |
| |
| |
| |
| |
| |
| | |
User::isRegistered is part of the UserIdentity interface,
which makes moving from heavy User class to UserIdentity easier.
Change-Id: If44bfd398694c509272b3f89c93473b2e3c05759
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since T192623 the startup code has used its own function,
domEval, instead of relying on the jQuery globalEval method.
Follow-up: Icdd5d76546a6c265a8e941c4e9b28f73bf9dd028
Change-Id: Ic1d0e02597c3e335acb7e0407e077dd4e62f3982
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
No longer used from there by the mediawiki.cookie module
No deployed javascript tries to use these, but a few undeployed
extensions do, so added to release notes.
Bug: T291760
Follow-up: I600332cdb738f0b443549948b9f070f3ccfa12aa
Change-Id: Ia02048137f191b950ae789a9d206c1d9afbce83a
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Inject `wgForeignUploadTargets` and `wgEnableUploads` via a
virtual file instead of always adding them to mw.config.
Added a comment about them in the release notes since wgEnableUploads
was used by an (undeployed) extension, but we can make the
breaking change because their inclusion was marked as
@internal.
Bug: T292017
Change-Id: Ib1635b1864963c6c03c4a80e15048a898b8eaf90
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This feature was removed in 2013 (Ia8d79b4a, T49504), with further
remnants removed in (1965df8df3, I7c24128f7b1).
* Simplify the code of transformCssMedia() as it now only needs to
support printable=yes.
* Remove query parameter abstraction from test cases, use query
array directly.
* Remove internal use of the $handheld parameter.
Function signature of makeLoaderQuery() left in-tact for
compatibility with $extraData. This will be deprecated and removed
in a follow-up commit.
Bug: T49504
Bug: T32956
Change-Id: Id16ef3f4630538de1887ac2327eb317c6c6b1f9d
|
| | |
| | |
| | |
| | |
| | | |
Bug: T291601
Change-Id: I6375aa97faa794caad74546ebc5e7040ead38129
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
In all cases where the client registry is used, the `noscript` module
is inapplicable. Additionally, make it illegal to have a module
include the 'noscript' module as a dependency.
Bug: T291735
Change-Id: I5846f2c19b003989b56b12628b385fd37049483b
|
|/
|
|
|
|
|
|
|
|
|
| |
It's already shipped when $wgParserEnableLegacyMediaDOM is disabled, but
having separate config for it will allow us to leave it enabled should
we re-enable $wgParserEnableLegacyMediaDOM and still have content in
the cache that needs styling.
Bug: T292498
Bug: T51097
Change-Id: I027d3a718b0c1a3eebe4b55983540ad2f28d229a
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Follows-up Ieaf04e0c289646dd5 which changed internal references to
bool(true) for 'debug' to the integer DEBUG_ constants, and introduced
a new debug=2 parameter.
In the refactor, I missed the setDebug() calls for
DerivativeResourceLoaderContext, which were still passing a boolean,
but more importantly were effectively passing debug=1 even if the
pageview carried debug=2. This isn't a problem yet in production since
debug=2 is currently identical in behaviour to debug=1.
The impact of this issue is mainly noticed through secondary CSS
requests. The URLs for primary stylesheets, and JS modules was already
forwarding the current "debug" version.
Test Plan:
* Open Main_Page?action=edit&debug=2
* Before this patch, e.g. on mediawiki.org today, secondary
stylesheet requests (part of a JS module) have debug=1.
For example "modules=jquery.makeCollapsible.styles&only=styles".
* After this, everything has debug=2 when the page view has debug=2.
Bug: T85805
Change-Id: Ia8fba4e30397bc5890033f13417b6739b0f83c38
|
| |
| |
| |
| |
| |
| | |
Use local variable instead
Change-Id: If90f510558a138b2294a57c7bbb9dc53ea355f9c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Always null, and no longer used. It was deprecated in favour of
wgCommentCodePointLimit which should be used instead.
Originally added in 2018 for T185948 as 255 or null, depending on
$wgCommentTableSchemaMigrationStage. In 2019, (I1479c73774e, T166733),
the comment migration was removed and the variable became always null,
and in change I876b02f45fc all remaining uses were removed in favour
of wgCommentCodePointLimit.
Bug: T291730
Bug: T227047
Change-Id: I0d48985026c96b9a5734a6409c88dc9cd6b2ae8a
|
| |
| |
| |
| |
| |
| |
| | |
That JavaScript function was inlined
Follow-up: I6c71ed70b3b308d7b2f67924637e23b08467035f
Change-Id: I1ae2dc01cc1755223283e3df2ab543e9c65cdc30
|
|/
|
|
| |
Change-Id: I6d0577124d852103f485ffdc819876a13f6641c3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since $wgSkipSkins is meant to only 'remove skin from preferences',
it should not affect parsing with them.
So these skins need to be allowed here.
To achive this, this patch adds getInstalledSkins() method to SkinFactory
to provide the complete. The method supersedes getSkinNames() which does
the same thing but with ambiguous name.
Description of getAllowedSkins() has been corrected as it was slightly incorrect.
Bug: T237856
Change-Id: I0889b823d27f1a2830cc0205f5a21ed4de744e08
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The native "foreign module source" feature, as used by the GlobalCssJs
extension, did not work correctly in debug mode as the urls returned
by the remote wiki were formatted as "/w/load.php...", which would
be interpreted by the browser relative to the host document, instead
of relative to the parent script.
For example:
1. Page view on en.wikipedia.org.
2. Script call to
meta.wikimedia.org/w/load.php?debug=true&modules=ext.globalCssJs.user&user
This URL is formatted by getScriptURLsForDebug on en.wikipedia.org,
when building the article HTML. It knows the modules is on Meta, and
formats it as such.
So far so good.
3. meta.wikimedia.org responds with an array of urls for sub resources.
That array contained URLs like "/w/load.php...only=scripts".
These were formatted by getScriptURLsForDebug running on Meta,
no longer with a reason to make it a Meta-Wiki URL as it isn't
perceived as cross-wiki. It is indistinguishable from debugging
a Meta-Wiki page view from its perspective.
This patch affects scenario 3 by always expanding it relative to the
current-request's wgServer. We still only do this in debug mode. There
is not yet a need to do this in non-debug mode, and if there was we'd
likely want to find a way to avoid it in the common case to keep
embedded URLs short.
The ResourceLoader::expandUrl() method is similar to the one in
Wikimedia\Minify\CSSMin.
Test Plan:
* view-source:http://mw.localhost:8080/w/load.php?debug=1&modules=site
For Module base class.
Before, the array entries were relative. After, they are full.
* view-source:http://mw.localhost:8080/w/load.php?debug=1&modules=jquery
For FileModule.
Before, the array entries were relative. After, they are full.
* view-source:http://mw.localhost:8080/wiki/Main_Page?debug=true
Unchanged.
* view-source:http://mw.localhost:8080/wiki/Main_Page
Unchanged.
Bug: T255367
Change-Id: I83919744b2677c7fb52b84089ecc60b89957d32a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
=== Why
* More speed
In debug mode, the server should regenerate the startup manifest
on each page view to ensure immediate effect of changes. But,
this also means more version recomputation work on the server.
For most modules, this was already quite fast on repeat views
because of OS-level file caches, and our file-hash caches and
LESS compile caches in php-apcu from ResourceLoader.
But, this makes it even faster.
* Better integration with browser devtools.
Breakpoints stay more consistently across browsers when the
URL stays the same even after you have changed the file and
reloaded the page. For static files, I believe most browsers ignore
query parameters. But for package files that come from load.php,
this was harder for browsers to guess correctly which old script URL
is logically replaced by a different one on the next page view.
=== How
Change Module::getVersionHash to return empty strings in debug mode.
I considered approaching this from StartupModule::getModuleRegistrations
instead to make the change apply only to the client-side manifest.
I decided against this because we have other calls to getVersionHash
on the server-side (such as for E-Tag calculation, and formatting
cross-wiki URLs) which would then not match the version queries that
mw.loader formats in debug mode.
Also, those calls would still be incurring some the avoidable costs.
=== Notes
* The two test cases for verifying the graceful fallback in production
if version hash computations throw an exception, were moved to a
non-debug test case as no longer happen now during the debug
(unminified) test cases.
* Avoid "PHP Notice: Undefined offset 0" in testMakeModuleResponseStartupError
by adding a fallback to empty string so that if the test fails,
it fails in a more useful way instead of aborting with this error
before the assertion happens. (Since PHPUnit generally stops on the
first error.)
* In practice, there are still "version" query parameters and E-Tag
headers in debug mode. These are not module versions, but URL
"combined versions" crafted by getCombinedVersion() in JS and PHP.
These return the constant "ztntf" in debug mode, which is the hash
of an empty string. We could alter these methods to special-case
when all inputs are and join to a still-empty string, or maybe we
just leave them be. I've done the latter for now.
Bug: T235672
Bug: T85805
Change-Id: I0e63eef4f85b13089a0aa3806a5b6f821d527a92
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is in preparation for making all version hashes the empty string
in debug mode, which will make things faster to work with, but also
helps solve T235672 in an easy way client-side without having to
add additional complexity to the mw.loader client that is specific
to debug mode.
Bug: T235672
Change-Id: I43204f22dfbcf5d236b35adc5b35df3da8021bad
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our basic support has been updated and Firefox supports replacement
`resolution` since version 8 or 16, depending which data source
one checks.
WebKit's support is a bit more complex and it seems like safest bet is
to leave its vendor prefix in for now.
Bug: T277803
Change-Id: I752f0b67672759824099b4b78892d143344e766f
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When boolean values are minified, they get replaced by `!0` and
`!1` for true and false respectively. Since the mw.loader code wants
to check if the store is *disabled*, it uses `!$VARS.storeEnabled`,
which gets converted to either `!!0` or `!!1`. Inverting the variable
passed to the JavaScript code saves an extra character from the
response size, and makes the code a bit clearer.
The next version of the Minify library removes the conversion of
true and false to `!0` and `!1`, meaning that `!$VARS.storeEnabled`
will either be `!true` or `!false` - after this patch it become `false`
or `true` instead, resulting in the same number of characters in the
first case but two fewer in the second.
This should have no impact on the functionality.
Change-Id: I0cc3de3d2d43fc5ead65b471bc246dcd5bc4ae1e
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit bc200b6a1a22305ac071a1162c1e64c3fe1964ab reapplying
the patch. It has been modified slightly to temporarily work
with the beta cluster's unsupported configuration.
Bug: T207038
Change-Id: Ie86a5b59fbf93a400796a4cac3724207830092b5
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 33ac451d3d170cef87e999df2beae95be1f31f5a.
Reason for revert: /wiki/Special:Version TypeError: Argument 1 passed to ResourceLoaderSkinModule::getRelativeSizedLogo() must be of the type array, boolean given, called in includes/resourceloader/ResourceLoaderSkinModule.php on line 600
Change-Id: Iddeb33d6165169dc106e9beb3e4a703a4b97eeb6
|
| | |
| | |
| | |
| | |
| | | |
Bug: T207789
Change-Id: I358d2aa4b7e08a6507c87277dcfd29413efd0d6c
|
|/ /
| |
| |
| |
| |
| |
| | |
Addition and remove of suppression needs to be done with the version
update.
Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
|