Page MenuHomePhabricator

VisualEditor: Fix dependency issues between ve.js and ve.init.platform
Closed, ResolvedPublic

Description

In ve.js, function ve.msg:
// TODO: Fix dependency issues between ve.js and ve.init.platform

I don't know how this should be fixed exactly, Timo put this comment in in 407de829dd8f2e51c22a8378dc70c79fc6645d1e . I did notice that running the VE tests from Special:JavaScriptTest doesn't work because ve.msg() errors out with 've.init.platform' undefined.


Version: unspecified
Severity: normal

Details

Reference
bz45175

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:39 AM
bzimport set Reference to bz45175.

(In reply to comment #0)

In ve.js, function ve.msg:
// TODO: Fix dependency issues between ve.js and ve.init.platform

I don't know how this should be fixed exactly, Timo put this comment in in
407de829dd8f2e51c22a8378dc70c79fc6645d1e . I did notice that running the VE
tests from Special:JavaScriptTest doesn't work because ve.msg() errors out
with
've.init.platform' undefined.

Indeed, that's the reason why. They sometimes fail, and sometimes work.

It appears to be a race-condition and/or absent dependency that should be fixed or lazy-loaded or something else to make sure one has the other.

This is currently blocking us from enabling QUnit for extension VisualEditor as the race-condition is happening consistently in Chrome, Safari and PhantomJS.

I tracked it down to the calls to ve.msg from the global scope, such as:

@@ ve.ce.Surface.static.$phantomTemplate = $ (.. ) .attr( {

		'title': ve.msg( 'visualeditor-aliennode-tooltip' ),

Change-Id: I47d7d92495974572194700c98a219d22ecbfaf4b