About this board

Previous discussion was archived at User talk:Roan Kattouw (WMF)/Archive 1 on 2015-07-10.

Chris troutman (talkcontribs)
The Technical Barnstar
Thanks for solving Phabricator task T177825! I was one of the many Wikipedians that wasn't getting pings.
Reply to "A barnstar for you!"
Nirmos (talkcontribs)


What do you think about moving the categories out of the editable area?

Currently, categories are allowed anywhere in the wikitext (there can be non-category wikitext between two categories), formatted in any way (there can be two categories in one line). Wouldn't it be nicer if the categories were moved out of the editable area altogether? That way, there can be an underlying structure that allows for nice programming (HotCat wouldn't have to be 123kb), and end users would never be in contact with the underlying code for the categories. They would just change, add and remove the categories they want.

The way I see it, there are three reasons why this would be desirable:

  1. It would be easier for end users to get and set categories.
  2. It would reduce edit conflicts: Diligent patrollers like adding categories to new pages immediately as they are created, and new users like making many small edits. See the problem here?
  3. It would completely erase edits like changing "category:Blah" to "Category:Blah".

What do you think?

Roan Kattouw (WMF) (talkcontribs)

I agree that that would be a good thing to do, and there are some old tasks for this in Phabricator (T2167, T2201, T29312 and probably others that I can't find right now). The reason those tasks are so old (and their numbers so low) is because this is a difficult problem. There's an RfC for "multi-content revisions" that may address this problem, along with many other things, but that's a big chunk of work and will probably take a long time.

Reply to "Categories"

Sponsor development of features in Flow?

TitusiMW (talkcontribs)

Roan, I really like to have a small set of additional features in the Flow extension.

Is there any way for me to sponsor or support development? Thanks!

Reply to "Sponsor development of features in Flow?"

Function to update notifications

Nirmos (talkcontribs)

Hi! Is there any JavaScript function I can call to update #pt-notifications-alert and/or #pt-notifications-notice?

Reply to "Function to update notifications"
Nirmos (talkcontribs)

I just have to ask, is there a reason we aren't able to get the user name of IPs? mw.user.getName() returns null for IPs. At first, I thought maybe this is because of some security or privacy concern, but I'm not sure that makes any sense. Does it have to do with caching?

Ideally, mw.user.getName() should return the IP for IPs, and if you want to differentiate between IPs and logged-in users you would use mw.user.isAnon(), and mw.user.isAnon() would have to be reworked to no longer rely on mw.user.getName(). Unfortunately, that would be a breaking change for code that relies on comparing mw.user.getName() with null to tell IPs and logged-in users apart, but maybe that would be acceptable with enough communication (tech news, mailing lists, console.log)?

Roan Kattouw (WMF) (talkcontribs)

The reason is because the mw.config values are in a JSON blob that's embedded in the page, and page views for anons are cached (and therefore are reused between different IPs). This is also why the bar at the top right where your user name appears shows "Not logged in" instead of the IP.

MediaWiki can be configured to show the IP there, but that setting is incompatible with the Varnish cache that WMF uses, so it's only there for 3rd-party wikis.

Nirmos (talkcontribs)

Ahh, so it is because of cache. Okay, thanks for answering.

Nirmos (talkcontribs)

Ok, but what about making a new method called mw.user.getIP and make it async like mw.user.getGroups? Would that be acceptable?

Roan Kattouw (WMF) (talkcontribs)

I believe it would be. Like getGroups all it would need to do is send an API request for meta=userinfo

Nirmos (talkcontribs)
Nirmos (talkcontribs)

Hi. I have some questions about modularization. If I want to get my own name, I can either type mw.config.values.wgUserName or mw.user.getName(), but if I want to get the page name, the only option seems to be mw.config.values.wgPageName. The only thing I can find in mw.page is watch. So, my question is, will more stuff be added to mw.page in the future? Will it be something like mw.page.getPageName() in the future? Is the work with modularization abandoned or ongoing? Will the values in mw.config.values eventually be deprecated once they've been in a module long enough? Is there a Phabricator task about this? I did find phab:T133277 which is called "Modularization of JS code", but that appears to be something much more specific than what I'm talking about.

Roan Kattouw (WMF) (talkcontribs)

Side note: you should use mw.config.get( 'wgFoo' ) instead of mw.config.values.wgFoo.

I don't think there's a specific task about this (perhaps @Timo Tijhof (WMF) would know) but an idea I've proposed before is to expose config variables per module instead of globally. This could change mw.config.get() to something else, but we'd probably keep the old one around for backwards compatibility. As for mw.page, I'm not aware of any immediate plans to move more stuff into there.

I wouldn't say the modularization work is abandoned, but it's not particularly active either. Perhaps a better way to describe its status would be "dormant" or "moving slowly". The task you found is specific to one extension (RevisionSlider).

Nirmos (talkcontribs)

Is there a reason I should use mw.config.get( 'wgFoo' ) over mw.config.values.wgFoo? mw.config.get( 'wgFoo' ) fails silently with trailing spaces, even though it is unambiguous, see this edit for instance. mw.config.values.wgFoo is much more robust and fails loudly.

Roan Kattouw (WMF) (talkcontribs)

The main reason is that mw.config.values.foo is using an internal implementation detail, not the public API. The public API is mw.config.get( 'foo' ). So the latter is considered cleaner, but both work. You're right though that louder failures for misspelled config variables would be good.

Krinkle (talkcontribs)
Reply to "Modularization"
Nirmos (talkcontribs)

Hi. I really want to help develop MediaWiki, but I need some help to get started. I have Windows 10 Home. When I type "vagrant up" in Git Bash, it says

==> default: Verifying Hyper-V is enabled...
The Hyper-V cmdlets for PowerShell are not available! Vagrant
requires these to control Hyper-V. Please enable them in the
"Windows Features" control panel and try again.

Does this mean that I have to upgrade to Windows 10 Pro, or do I need to do something in PowerShell? I'm kind of lost.

Nirmos (talkcontribs)
Roan Kattouw (WMF) (talkcontribs)

Sorry, I was on vacation when you posted your first comment, so I missed it.

I don't know anything about Vagrant, I don't use it myself. I also haven't used Windows in many years, so I'm afraid I can't be of much help here. I'll also ping @BDavis (WMF) who does a lot of Vagrant work. Even if the solution is simple and not directly Vagrant-related, I'm hoping we can add it to the documentation here on mediawiki.org so people won't have to ask this question in the future.

BDavis (WMF) (talkcontribs)

The last version of Windows I used was NT 4.5, so this fancy new Hyper-V stuff is not anything I've played with. These instructions at MSDN might help @Nirmos out.

Reply to "Vagrant"

נסיון עם עברית

MSchottlender-WMF (talkcontribs)

This is a Hebrew RTL test.

Reply to "נסיון עם עברית"
Catrope (talkcontribs)

Testing notificatoin emails

Reply to "Test topic"

Please participate in discussion on updated "Enforcement issues" text

MediaWiki message delivery (talkcontribs)
Reply to "Please participate in discussion on updated "Enforcement issues" text"