Gracefully upgrading a component to use block params?


I’m trying to wrap my head around the best approach to gracefully deprecate and then require the use of block params on a component.

I have a component that was developed some time ago, and is in wide use in my app as well as others. It uses “magic” to introduce a variable to the template, because that is the tool I had at the time:


I want to move to using block params, and @lightblade graciously contributed a PR to do just that… now it can be used as follows:

{{#nf-x-axis as |tick|}}

The problem is this breaks the original usage of the component. Meaning the former example will now render nothing.

I’m looking for a way to introduce the new feature, but add a deprecation warning to “old usage” cases.

There is additional discussion here:

Any help or suggestions are greatly appreciated.


…AAAANNDDD… while I was typing that the brilliant @jayphelps came up with a solution.