# A versioned API for client side plugins

**URL:** https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051
**Category:** Development
**Tags:** rest-api
**Created:** [February 23, 2016, 7:20pm UTC](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051 "2016-02-23T19:20:31Z")
**Posts on this page:** 1
**Showing post:** 20

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [February 25, 2016, 3:12pm UTC](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051/20 "2016-02-25T15:12:49Z")

</div>

This is great! I’ve always been a bit anxious that the hooks and outlets I’ve been using for plugins would suddenly disappear.

Just wanted to share my experience with this playing around with it this morning.

For my [ratings plugin](https://github.com/angusmcleod/discourse-ratings), I had to migrate this template for the `poster-name-right` outlet (which no longer exists.)

 ![](https://global.discourse-cdn.com/meta/original/3X/4/8/48bd92d76754c03a0694cb8dbe09134cacd5aae9.png)

I initially futzed around with trying to reproduce this logic exactly in the `decorateWidget` hook, i.e. getting the `d-rating` component, set its properties and then turning it into html. But this both didn’t work and felt wrong.

Then I remembered that I had already made a [little helper to generate rating html for the topic list](https://github.com/angusmcleod/discourse-ratings/blob/master/assets/javascripts/lib/render-rating.js.es6). So I ended up with this, which works well.

 ![](https://global.discourse-cdn.com/meta/original/3X/7/3/739a98302a3c25636642cdd7860ba812b67b85d0.png)

The helper looks like this.

 ![](https://global.discourse-cdn.com/meta/original/3X/8/e/8e69b6d4a1ca8955ce16b808e3d1bfdd988ac26c.png)

I’m still a little uncomfortable about `helper.widget.container.lookup('controller:topic')` though. That feels a bit long winded.

---

_[View the full topic](https://meta.discourse.org/t/a-versioned-api-for-client-side-plugins/40051)._
