I have this complete per:
https://github.com/discourse/discourse/pull/10939
But it will take a few days to merge, needs a careful review by @eviltrout and @joffreyjaffeux. We may want to use a different pattern internally.
Also this changes a signature on a key method so it may have impact on themes and plugins.