eviltrout announced a major rewrite of the Discourse site header using widget code to improve performance, claiming an 8x rendering speed increase. While users like Falco confirmed the speed improvements on mobile, the update initially introduced numerous regressions, including broken navigation, missing icons, and menu issues. Several bugs were quickly identified and fixed by the team.
Plugin developers faced challenges adapting to the new structure. emanuelet reported broken plugin outlets, but eviltrout provided the decorateWidget API as a solution for customizing headers. Discussions arose regarding the migration of other components, such as the topic list, to widgets. DeanMarkTaylor and fantasticfears sought methods to add custom links to the hamburger menu; eviltrout subsequently added support for hamburger-menu:generalLinks. However, DeanMarkTaylor noted that external links were incorrectly routed to the Discourse domain, a bug eviltrout promptly fixed. By the end of the thread, eviltrout confirmed the feature was stable for production use, though plugin authors were encouraged to update their code to the new API.
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.