Built-in input helpers in Ember.js: when should they be used?

18 June 2019

I want to thank Robert Jackson and Stefan Penner for their discussions and guidance on the subject and for reviewing this blog post. Jan Buschtöns for ember-on-modifier and Chris Garrett for his relentless work on Octane. And everybody else who makes this framework more awesome by the day.

With the arrival of angle-bracket syntax for component invocation for built-in Ember helpers, the question of whether it's good practice to use them has come to the fore again. I'll try to summarize the status quo as of Ember 3.10, in which the possibility of calling these helpers via angle-brackets (via <Input ...>, <LinkTo ...>, etc.) has landed.

Oh, cute, Ember can do checkboxes!

I didn't mean to do it, I really didn't.

I recently discovered you can have two-way bound checkboxes in Ember.js via the built-in {{input type="checkbox" checked=...}} helper. I shared my discovery on Twitter which sparked a discussion on whether using two-way bound helpers in Ember is still justified sometimes.

Ember has a built-in checkbox component? Who knew? I certainly didn’t. https://t.co/oUMxtplIYv

— Balint Erdi (@baaz) June 4, 2019

Most tweets came from Robert Jackson and Stefan Penner who have both been contributing enormously to the Ember ecosystem and had somewhat differing views on the subject. To me, they were both really convincing so I was very happy to see they went on to record a video discussion that Rob then shared on YouTube:

I encourage you to watch the whole thing. I also added the summary of the video as a comment so that you can jump to any section you're interested in.

Below I'll first write the notes I took from the video and then distill the knowledge that I've extracted from it plus earlier blog posts, RFCs and comments.

I'm going to post my notes as a comment on the video, so if you plan to watch it, feel free to skip them and go to the conclusions (scroll down a bit).

Notes on video discussion

Conclusions

Having spent a good amount of time putting this together, I realize some concrete examples would be in order – I'll follow up with some in another blog post.

Share on Twitter