Page MenuHomePhabricator

Add support for parsed messages in ResourceLoader (push to core)
Closed, DuplicatePublic

Description

Rather than load a JavaScript message parsing library, the mobile site pre-parses certain messages before passing them via ResourceLoader to the client:

http://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMobileFrontend.git/33a201b35c02f4a5eb2ac3af203f8d16228fee67/includes%2Fmodules%2FMFResourceLoaderParsedMessageModule.php

We should add support to ResourceLoaderFileModule for this.
Implementor: Please be sure to talk to someone in editing and agree on the approach before pushing a patch.

Event Timeline

Jdlrobson created this task.Jul 1 2015, 6:16 PM
Jdlrobson claimed this task.
Jdlrobson raised the priority of this task from to Lowest.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added subscribers: Glaisher, Moushira, Tgr and 11 others.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 1 2015, 6:16 PM

VisualEditor also does something like this, for messages which can't be parsed client-side (e.g. likely to contain wikitext templates).

@matmarex could we get together and come up with something that serves both our teams needs? It's now blocking T104474 :(

CONTENTLANG, SITENAME and int:mobile-frontend-search-content are the only things we parse right now. So we don't pre-parse anything which requires parameters (but the client wouldn't be able to translate these effectively)

MaxSem removed a subscriber: MaxSem.Aug 17 2015, 7:42 PM

I am not a fan of MF's current syntax of 'foo' => array( 'parse' ). I think having a separate 'parsedmessages' key might be better.

How does the MF implementation deal with cache invalidation of links/templates in the parsed message?

Jdlrobson renamed this task from Add support for parsed messages in core to Add support for parsed messages in ResourceLoader (push to core).Sep 2 2015, 3:12 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson set Security to None.
Jdlrobson removed Jdlrobson as the assignee of this task.Sep 2 2015, 3:33 PM
Jdlrobson moved this task from Backlog to Tasks on the MobileFrontend board.Nov 4 2015, 5:01 PM

Hmm, losing support for message parameters looks like a pretty big caveat worth mentioning.