Page MenuHomePhabricator

MobileFrontend: Implement ResourceLoader (tracking)
Closed, ResolvedPublic

Description

Go to http://fr.m.wikipedia.org/wiki/Wikip%C3%A9dia:Accueil%20principal?title=Wikip%C3%A9dia:Accueil_principal&mobileaction=toggle_view_mobile in beta mode

Open console
I get the error ""Uncaught ReferenceError: wgPageContentLanguage is not defined"


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=44070

Details

Reference
bz41340

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:11 AM
bzimport set Reference to bz41340.
bzimport added a subscriber: Unknown Object (MLST).

That doesn't look like a ResourceLoader environment.

Where is the startup module, its mw.config and the page-specific and user-specific mw.config and mw.user output from OutputPage?

(In reply to comment #1)

That doesn't look like a ResourceLoader environment.
Where is the startup module, its mw.config and the page-specific and
user-specific mw.config and mw.user output from OutputPage?

Ah, I didn't enter "beta" mode (via search menu, Configurations, toggle "Beta", save, reload).

Okay, so it does output the startup module, but does so incorrectly and the rest of the environment does indeed not look like how ResourceLoader presents it self usually (appears re-invented/hardcoded for mf).

OutputPage does / ResourceLoader expects:

  • startup module in the <head> before any load.php script
  • <head> needs to contain mw.user and mw.config
  • <head> will output top queue (if any)
  • <body> will output bottom queue

Right now MF does:

  • startup module at bottom of <body>
  • <body> will output bottom queue

Tracking down the error in particular it looks like "Uncaught ReferenceError: wgPageContentLanguage is not defined" is just the first in a long sequence of errors caused by the invalid environment.

OutputPage does / ResourceLoader expects:

  • startup module in the <head> before any load.php script
  • <head> needs to contain mw.user and mw.config
  • <head> will output top queue (if any)
  • <body> will output bottom queue

Also: oldschool raw styles/scripts added by extensions in head/body respectively, such as geoiplookup in CentralNotice which provides the "Geo" global variable.

Right now MF does:

  • startup module at bottom of <body>
  • <body> will output bottom queue

Tracking down the error in particular it looks like "Uncaught ReferenceError:
wgPageContentLanguage is not defined" is just the first in a long sequence of
errors caused by the invalid environment.

  • Bug 31675 has been marked as a duplicate of this bug. ***

ResourceLoader is now implemented in mobile. There are a few bugs to perfect it's implementation. I don't think the existence of this tracking bug is useful anymore. Feel free to disagree.

jgonera wrote:

I'm afraid there is still something we're missing. JavaScript tests page loads JS at the bottom instead of top (as it does in desktop) for some reason which breaks PhantomJS runner after applying this changeset: https://gerrit.wikimedia.org/r/#/c/50442/

jgonera wrote:

After reconsidering this, I'll open a separate bug.

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptJan 28 2016, 6:12 PM