Clearing up a common confusion with a worked example. Many developer assume this is more magic going on with Glimmer components’ arguments than there really is. Let’s see how they actually work!
Understanding args in Glimmer Components
One of the most consistent confusions I see as I support the LinkedIn.com migration to Ember Octane is how to think about
argsin Glimmer components. In particular, I consistently see people struggling with how to understand updates toargswhat they can and cannot do with them. In this post, I hope to make it much clearer by working through an example of howargsare passed from component to component, but in plain JavaScript: using a slightly simplified version of theComponentAPI with no autotracking in sight. By the end of the post, you should have a clear handle on what will and won’t work in the body of a Glimmer component—and, more importantly, why.