Hiding components from view in Ember is super simple. There are several options to control a component’s visibility:
template conditionals (if, unless)
classNames and classNameBindings
toggling the hidden attribute of the wrapping element
Did you know you could also hide a component by using the component property isVisible? If you answered no, you’re not alone. Actually, that’s one of the main motivations behind the newly drafted RFC (Request for Comments) to deprecate its usage. Furthermore, the property is not used by Ember internally, it’s undefined unless it’s set, and it overrides any inline styles you might have set on your component earlier. So, ask yourself, do we really need it? Are the other approaches sufficient? Head over to the original proposal and give your feedback!
As a heads up if you’re currently using Copy or Copyable in your projects: the plan is to move their functionality to a separate add-on. Expect to see this coming soon as a deprecation in your app and if you want to learn more about the motivation behind that change, check out the original proposal here.
Last week’s newsletter stated that the htmlSafe function and RFC#319 (add an html-safe helper) made Strings safe (as in: it dealt with security concerns for you). This is incorrect. In fact, the function does nothing in regards to security and using it will only mark a String as safe to not be escaped by Glimmer. The “safe” part of htmlSafe is so misleading that most of the conversation in RFC#319 is centered around renaming the function and the helper entirely.
It’s official! The command line tool ember-cli-update is now the way to upgrade your Ember apps to newer versions. Moreover, the addon gained a couple of new and exciting features recently:
Thanks to added support for the ember-qunit-codemod not only upgrading your Ember app, but also bringing it on par with the new Ember QUnit Testing API as described in the original RFC#232 is only a few commands away.
First, upgrade your Ember app from your current version to your anticipated version using the specified —from and —to flags. After resolving all merge conflicts that might arise, run ember-cli-update with the dedicated —run-codemods flag subsequently; you will now get all the new shiny things of the new Ember QUnit Testing API in your existing test suite automagically. ✨
Already fond of ember-cli-update and looking for ways to show support? Your help is wanted in bringing several parts of the documentation in the Ember ecosystem up-to-date to spread the word about ember-cli-update.
You can check out the related quest issue and claim any of the sub tasks here.
Is there this one question about Ember, Ember Data, Glimmer, Ember CLI or a specific Ember addon that you have been pondering about for a while and that you can’t find an answer to? You already tried your luck asking your colleagues in the office, other Emberistas at local meetups; maybe you even posted your question on a social media platform or a Slack channel but you never received a satisfying reply to your query?
If that’s the case, then Readers’ Questions is just for you. In the form of a Q & A members of the Ember Team will answer your questions - and we will post their answer in one of the future editions of the Ember.js Times!
Submit your own short and sweet question under bit.ly/ask-ember-core. And don’t worry, there are no silly questions, we appreciate them all - promise! 🤞