# Feasible to move autosize library to 'discourse/lib'?

**URL:** https://meta.discourse.org/t/feasible-to-move-autosize-library-to-discourse-lib/41265
**Category:** Development
**Created:** [18 במרץ,‏ 2016,‏ 1:54pm UTC](https://meta.discourse.org/t/feasible-to-move-autosize-library-to-discourse-lib/41265 "2016-03-18T13:54:41Z")
**Posts on this page:** 3
**Page:** 1

<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: [18 במרץ,‏ 2016,‏ 1:54pm UTC](https://meta.discourse.org/t/feasible-to-move-autosize-library-to-discourse-lib/41265/1 "2016-03-18T13:54:41Z")

</div>

@eviltrout Would it be feasible to move the useful [`autosize`](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/admin/lib/autosize.js.es6) library you wrote from `admin/lib` to `discourse/lib`? I’ve come across it working on [Quick Messages](https://meta.discourse.org/t/quick-messages-plugin/39188) and would prefer to use a working existing solution in the project over a 3rd party, or my own, solution. [DivResizer](https://github.com/discourse/discourse/blob/master/vendor/assets/javascripts/div_resizer.js) doesn’t quite fit the purposes of a smaller chat textarea that does not occupy most of the composer.

The problem is that `admin` code is not available to clients where the user is not an admin (i.e. if a non-admin user’s client tries to import a module from `admin/lib`, it is unable to find it; I’m assuming this is by design for security purposes). The desire to autosize a textarea is relatively common, so it’s possible others may find it useful in the future as well.

[https://github.com/discourse/discourse/pull/4093](https://github.com/discourse/discourse/pull/4093)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [18 במרץ,‏ 2016,‏ 3:39pm UTC](https://meta.discourse.org/t/feasible-to-move-autosize-library-to-discourse-lib/41265/2 "2016-03-18T15:39:23Z")

</div>

Sure, no objections here. Merged.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [18 במרץ,‏ 2016,‏ 3:39pm UTC](https://meta.discourse.org/t/feasible-to-move-autosize-library-to-discourse-lib/41265/3 "2016-03-18T15:39:26Z")

</div>


