I’ve just merged another client side performance improvement for Discourse. Our site header has been re-written using the widget code that gave us a huge performance increase within topics.
The site header is present on every page and our benchmarks showed that it often took up 1/4 of the initial rendering time of a Discourse page. With the new code, it renders roughly 8x faster than before, which should be a significant improvement on android devices.
Since this is a major re-write, the odds of it including regressions are quite high, so I’d like to warn everyone now that if you are following the tests-passed branch of Discourse you might want to wait a few days before updating unless you are comfortable helping us track down bugs.
In the meantime, please use this topic to report any issues you encounter and I’ll be fixing them as quickly as I can.
Fixes
Navigating directly between topics wasn’t updating the title of the topic
Clicking categories was not closing the menu
Cmd / Shift clicking links didn’t open them in new tabs
Topic status icons were missing in topics
HTML entities were missing from titles
Weird resizing of home logo
Right clicking on the logo in Firefox was broken
Middle clicking on user notifications was broken
Missing alt tag on user notifications
Akismet link was missing
Widget setting for custom home logo urls
Similar topics stopped displaying
Search menu would lose the context
Header positioned oddly in Safari
Middle clicking search should open it in a new tab
Why? That topic list code was already restructured to reduce the number of Ember calls, and was one of the major perf improvements in previous release (I think 1.2 maybe?)
Well the API is not going to change now, and all the widgets support the decorateWidget things for inserting elements. I’d encourage all the plugin authors to update to the new API and please ask me questions if you need pointers!
My site uses a plugin that put a little icon for Mumble in the header with a server display, but I don’t know how much it’s used outside of us. I was planning to just wait for Babble/Quick Messages to update and use them as a reference to try and update the Mumble plugin.
It’s not possible to decorate other place yet. And I am not sure how to capture click event for this.
I can submit a PR to add a decorator for the right spot. Moreover, I wish I can decorate panel (panelContents) at will, i.e. messing around order, stuffs other than links. Don’t know whether this idea makes any sense.