Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
ember-power-select
Advanced tools
Ember Power Select is an Ember-first select component modeled after Select2.
Ember Power Select works in Ember 1.13.9+ or 2.0+, including beta and canary, with no deprecations whatsoever.
As any other ember-cli addon, run:
ember install ember-power-select
Check the full documentation with live examples at www.ember-power-select.com and please open an issue if something doesn't work or is not clear enough.
Good docs are important :)
About browers compatibility I just tested it in modern browsers but there is no technical reason it wouldn't work in IE9+. If you find any problem please file an issue.
Why reinvent the wheel when there are already good framework-agnostic libraries out there that are battle tested and can be wrapped?
— Your brain, now.
Believe me, I tried. And it worked for a while. Two good ember examples of addons doing that are ember-cli-selectize and https://github.com/iStefo/ember-select-2.
However this approach has inherent downsides.
By accepting to use a framework agnostic library one needs to renounce to take advantage of the more higher level primitives that Ember and HTMLBars provide.
Let's say that you need to build a mildly complex select which, as you type in a search-box, shows you a list of users that match that search with their avatars, names, and other information, and if there is no match it shows some message. When you select one user you navigate to the user profile.
Using components and blocks this can be expressed very naturally.
{{#my-select search=(action "findUsers") onchange=(action "seeProfile") as |user|}}
<img src="{{user.avatarUrl}}" alt="{{t 'alts.avatar-of' user=user.fullName}}">
<strong>{{user.fullName}}</strong>
<em>{{user.email}}</em>
{{else}}
<img src="sad-face.svg">
<p>{{t "users.sorry-no-matches-try-again"}}</p>
{{/my-select}}
This is the kind of expressiveness I wanted to find but is actually not possible to achieve translating between the "Ember world" where we solve problems in terms of actions and templates and the lower level world of those libraries where things are expressed in terms of events and DOM nodes.
Even for things that are not impossible to do, translating between the bindings and data structures we use in ember and those in the libraries requires a surprising amount of glue code and is a very tricky task.
Also those libraries tend to be quite complex and bloated with functionality not directly related with the task they have to solve, like internationalization for example. We don't need that code making this libraries weight ~100KB when we already have better and more natural ways to do it already.
I thought that we deserved a select component for ember projects built with from scratch with ember in mind. That also allowed this library to weight <10KB (JS + CSS + images) when gzipped.
FAQs
The extensible select component built for ember
The npm package ember-power-select receives a total of 37,578 weekly downloads. As such, ember-power-select popularity was classified as popular.
We found that ember-power-select demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.