New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axis block params #31
Conversation
9a23c08
to
caa0eee
Compare
This looks great. The only problem I see is we need a way to gracefully deprecate usage that isn't using block params. Otherwise this releases and "boom" all the axis in my projects break. ;) I'm not entirely sure how to do this. Perhaps @stefanpenner or @jayphelps have thoughts? One idea would be to hold on this PR (keeping it in another branch) for one release, and add a deprecation message in a release, then update it on the next release? It seems like there should be a way to default a block param. I just can't find it. |
i beleive one could detect the lookup of tick as a property and not a block param / keyword |
I just found that simply passing the component a template does not receive the block arguments. Component blocks are compiled differently than regular templates. |
@stefanpenner ... so are you saying one could create a property tick: Ember.computed(function() {
Ember.Logger.error('OMG, you forgot "as |tick|" on your nf-x-axis component!');
}), That would be helpful, I guess. Not necessarily graceful. Perhaps a combination of that and the deprecation message? |
What do you mean? |
@Blesh Standalone template ( Also, I think I slightly misunderstood what you mean by "gracefully deprecate usage". The default template was intended for that purpose, but I guess you meant the originally injected |
@Lightblade I guess what I'm saying is that the following doesn't render anything: {{#nf-x-axis}}
<text>{{tick.value}}</text>
{{/nf-x-axis}} If that's the case, the moment a developer upgrades, all of their graph axes will be broken. To be clear, I want to move to block params, but I want to be able to do so incrementally, and I'm having a hard time wrapping my head around the best course of action. |
I agree. But this actually renders nothing in the current version:
I'm thinking of having the none block-param version prints out a deprecation message. But find some way to make both syntax work in the current version. |
How bout this? Graceful deprecation. |
Looks good. I'll find some way to work that into the PR. |
Very awesome, guys! I'm excited about this PR. |
Done. @jayphelps @Blesh Please review. |
@Lightblade can you squash your commits please? 👯 |
Get around the problem of standalone template not receiving blockArguments allow axis ticks to work w/ or w/o block param added deprecation messages for tick non block form
451ad1f
to
b90d41e
Compare
Done. |
Awesome! Tested this out and it looks great! Thanks, Ming. |
Thanks @Lightblade! |
You're welcome! |
Hi Ben,
This PR fixes #4.
Ming