New Emoji picker feedback

It’s looking rad! I reviewed the code locally and here are some notes:

d-editor.js.es6

  • You should declare emojiPickerIsActive: false at the top of the component. Javascript is a lot faster when it knows the shape of objects in advance.

emoji-picker.js.es6

  • resolveTemplate calls should not happen in the main scope of the file. This might lead to confusing results when the resolver/app has not booted properly, or if a plugin wants to change something after you’ve already looked it up. I’d recommend instead looking up the template when you need it.

  • There are a bunch of constants that seem to be exported just so the acceptance test can clear them out. Instead, why not export a method called resetCache that will do the clearing? That way the test doesn’t need to know how the component is implemented. Also, exporting less things is generally better.

  • We discussed this briefly, but is there any way the @observes can be replaced with callbacks from the ember component lifecycle? If not that’s cool, I just want to know if you looked into it.

  • Why does _later exist and avoid doing async work in testing? Also, I suspect later is the wrong callback here. Perhaps you want Ember.run.scheduleOnce('afterRender', ...)?

  • unbindEvents seems to be doing a lot less than bindEvents – are we sure every event has been removed?

emoji-picker-raw.hbs.erb

  • If you use Emoji.url_for in the template, doesn’t that bake the current emoji set into the template? What happens if the emoji set changes and the template has already been baked like in production mode? I guess what I’m asking here is are we sure that changing the emoji set still works in production mode with this code?
9 Me gusta