Spin box component - looking for feedback


#1

Looking to get some feedback from all you ember gurus on a little component I just released; ember-spin-box (demo).

As I am still fairly new to ember, I created this component partly for the learning experience, and also because I had the need for it in an application I am working on, and wasn’t able to find anything similar implemented with ember components/views that fit my requirements.

Would love to get some feedback not only on the component’s features and implementation, but also on how my project and code is structured, how the production build is distributed/used, ect. For example, I am just defining my Ember.Component within a closure, and making it available to the end-user’s application via Ember.Handlebars.helper(). Not sure if this is the best way to go, or if there is a more canonical method of defining and exposing a component for third party consumption.


#2

Looks nice , will come in handy soon :smile:


#3

Nicely done. Congratulation. I already know here I’m going to use it. :smile:


#4

looks very good indeed - could think of a couple of usages for it, thanks a lot for sharing! :smiley:


#5

@billdami very nice demo! I like it. A couple considerations:

  • are you using a custom tagname for your component?
  • how about using ic-styles for the css?
  • travis ci setup?
  • how about using testem to drive the tests?
  • how about distributing amd, cjs too?

Checkout this post Repo as a blueprint (boilerplate) for authoring components to distribute I used this blueprint repo to base my setup and distribution on https://github.com/realityendshere/emberella-component-blueprint


#6

Thanks for all the positive feedback guys! If you come across any bugs or have a feature request, please don’t hesitate to submit an issue or a pull request, they are welcomed and appreciated. :smile:

@pixelhandler Thanks for linking that component blueprint repo, I will definitely be giving it a try for any future components I write, and may even refactor this one to use it as well, to help with creating amd/cjs builds and organizing my testing environment for testem/travis ci.

Regarding using ic-styled for the css, that does look interesting and I may consider using it, however I was trying to keep this as lightweight as possible and avoid any dependencies (although it does look like it is pretty tiny itself).

I’m not using a custom tagName for the component in the interest of rendering valid HTML, but I noticed that ic-styled’s readme also recommends using custom tagNames, is this an accepted practice nowadays?


#7

Hey @billdami, thank you for writing the spin box component. I ran into an issue with your use of Ember.Handlebars.compile inside the component, because this will break as soon as you use the Handlebars runtime version, as it does not include template compilation support. This is the default in tools like Ember App Kit and ember-cli, so I guess quite a few people will run into this as soon as they deploy to production.

But other than that, what a nice component! \o/ Thank you so much! :smile:


#8

@ralph thanks for the heads up, completely forgot about precompiling the templates for the production version. I will have that fixed very shortly. :smile:


#9

looks good @billdami and badass @ralph on catching that stuff.


#10

@billdami A lot Thanks for that KEEP GOING!!!


#11

Hey, I am starting using ember like a month ago and it was so easy to use the spin-box but what i need to do is to show images instead of a range of numbers or an array of words. What do you think i should to? Is it possible with ember? Would this be a feature for this spin-box?

Thank you very much.