Page MenuHomePhabricator

Timeline: too many requests for components
Closed, DeclinedPublic

Description

Author: sergey.chernyshev

Description:
As I reported on the dev list earlier, SIMILE Timeline code was carried over as many files instead of the bundle (not sure if they added the bundle later then it was initially used).

Long term solution would be to incorporate their code as is separating all SMW specific code into SMW_timeline.js (or something like that) and have some one-line switch within JS or PHP configuration option to switch between easy to debug multi-file option and much faster bundled version.

As I remember Markus was going to ask people at SAIL to help with this.

Meanwhile, I made a simple workaround by just combining most of JS and CSS code for timeline (and minifying JS).

The result is one timeline-api.js (plus two for i10n which I didn't want to dig into) and one timeline.css both residing in skins/SimileTimeline/ folder. I renamed original timeline-api.js into timeline-api-debug.js and called combined, but uncompressed version timeline-api-uncompressed.js.

For minifying JS code, I used Douglas Crockford's JSmin (http://javascript.crockford.com/jsmin.html) as least intrusive minifier (later, I might re-minify it with YUI Compressor - http://developer.yahoo.com/yui/compressor/ which is supposed to be better and even less intrusive).

The resulting code is just 4 HTTP requests (which can potentially be converted to 2 if i10n code will be merged into main body of code) instead of 23 requests and just 25K (if gzipped).

Next step might be a Makefile with shell script to combine all that before checking into SVN, maybe be even combining all SMW's JS and CSS together.


Version: unspecified
Severity: minor

Details

Reference
bz12590

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:05 PM
bzimport set Reference to bz12590.

sergey.chernyshev wrote:

Tarball with combined JS (also minified) and CSS, plus old JS and combined JS (in pre-minified state)

attachment timeline.tgz ignored as obsolete

sergey.chernyshev wrote:

A set of scripts to compress timeline code

Instead of just providing the code, I wrote a Unix shell script, Makefile and a patch to do the conversion on the fly (uses ruby version of jsmin http://javascript.crockford.com/jsmin for compression - feel free to replace with version in your preferred language).

It must be ungzipped into extensions/SemanticMediaWiki/skins/SimileTimeline folder.

make compress

will do compression

make uncompress

will return the original state.

Attached:

Re-assign to extension developer for triage/comments.

sergey.chernyshev wrote:

Unfortunately, my patch doesn't work on latest version.

I also tried to plug Simile's latest version of the Timeline, but it didn't work as is. I think it's worth switching to their latest version (and link it in SVN - they have bundled code and many code fixes, I believe.

The Semantic MediaWiki developers requested in https://phabricator.wikimedia.org/T64114 to move their task tracking to https://github.com/SemanticMediaWiki and to close remaining tasks in Wikimedia Phabricator. If you still face the problem reported in this task in a supported version of SMW, please feel free to transfer your report to https://github.com/SemanticMediaWiki/SemanticResultFormats/issues . We are sorry for the inconvenience.