Last modified: 2014-11-18 20:51:11 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 T59952, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57952 - VisualEditor: Pre-fetch modules to improve speed for end-users
VisualEditor: Pre-fetch modules to improve speed for end-users
Status: ASSIGNED
Product: VisualEditor
Classification: Unclassified
Initialisation (Other open bugs)
unspecified
All All
: High enhancement
: ---
Assigned To: Editing team bugs – take if you're interested!
: performance
Depends on:
Blocks: ve-performance
  Show dependency treegraph
 
Reported: 2013-12-03 22:32 UTC by Ori Livneh
Modified: 2014-11-18 20:51 UTC (History)
3 users (show)

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


Attachments

Description Ori Livneh 2013-12-03 22:32:58 UTC
First impressions count! You can make the initial experience of loading VE substantially faster by prefetching the modules on a standard article page if the DOM isn't busy.

What I have in mind is something like this:

    $( window ).load( function () {
        if ( !mw.loader.store.enabled ) {
            return;
        }

        setTimeout( function () {
            var modules = [
                'ext.visualEditor.base',
                'ext.visualEditor.core'
                'ext.visualEditor.data',
                'ext.visualEditor.icons-vector',
                'ext.visualEditor.mediawiki',
                'ext.visualEditor.viewPageTarget',
                'ext.visualEditor.viewPageTarget.icons-vector',
            ]

            mw.loader.using( modules.filter( function ( module ) {
                var key = mw.loader.store.getModuleKey( module );
                return key in mw.loader.store.items;
            } ) );

        }, 0 );
    } );


You'd need to ensure that the modules don't execute automatically somehow.
Comment 1 Roan Kattouw 2013-12-03 22:42:19 UTC
It's fine for them to execute automatically, nothing happens until .activate() is invoked.

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


Navigation
Links