Last modified: 2014-11-19 02:57:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T52707, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50707 - VisualEditor: Separate ve.init and ve.platform
VisualEditor: Separate ve.init and ve.platform
Status: ASSIGNED
Product: VisualEditor
Classification: Unclassified
Technical Debt (Other open bugs)
unspecified
All All
: High enhancement
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks: 73593
  Show dependency treegraph
 
Reported: 2013-07-03 23:39 UTC by Krinkle
Modified: 2014-11-19 02:57 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2013-07-03 23:39:12 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 >

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links