Last modified: 2014-11-19 02:57:19 UTC
This will likely get done before or as part of the splitting of repositories. Basically our init hasn't been init for a long time. We load a lot of classes (ext.visualEditor.base and ext.visualEditor.mediawiki) before the ViewPageTarget and ViewPageTarget also quite a lot of code around it and its dependencies. I propose (and if agreed, intend to do): * Rename ve.init to ve.platform: - ve.init.Platform becomes ve.platform.Environment - ve.init.mw.Target becomes ve.platform.MwTarget - etc. * The (new) ve.init will define a very thin "ve" object: - 'instances' property - 'support' property containing boolean values for 'es5', 'contentEditable' and perhaps later (as in, from a different module) extend it with things like 'svg' so we don't have to repeat > ( document.createElementNS && document.createElementNS( 'http://www.w3.org/2000/svg', 'svg' ).createSVGRect over 5 times like we do now (just ve.support.svg, like jQuery.support) The following are currently in MediaWiki platform only (always have been, even before the recent setup split (bug 50612) that should be and now will be part of the core init (now that we'll actually have a core init): * Feature detection (ve.support) * Browser sniffing (ve.support.browsers.{whitelist,blacklist}) So for a platform like SA or MW: -- ve.init.js > ve = { instances: [], support: .. }; -- ve.init.mw.js (or ve.platform.MwInit?) > if !ve.support: > // Platform can decide how to return, fallback etc.. > return; > > Set up skin stuff to bind edit clicks, handle url queries etc. > > onEditClick: > load mw platform > > load plugins > > > load VisualEditor.core > var target = new ve.platform.Mw[ViewPage]Target( .. ) </ rough draft , brain dump >