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
args
in Glimmer components. In particular, I consistently see people struggling with how to understand updates toargs
what they can and cannot do with them. In this post, I hope to make it much clearer by working through an example of howargs
are passed from component to component, but in plain JavaScript: using a slightly simplified version of theComponent
API 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.