-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Deprecate the non-block {{with}} syntax #10584
Conversation
if (node.program && node.program.blockParams.length) { | ||
throw new Error('You cannot use keyword (`{{with foo as bar}}`) and block params (`{{with foo as |bar|}}`) at the same time.'); | ||
} | ||
|
||
Ember.deprecate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Ember.deprecate work in Node where this is used? Are deprecations displayed to the user in ember-cli?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should work, but I'll try to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. It works in tests, but it could be different in actual usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also set a flag here and then do the actual deprecation in the {{with}}
helper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like doing it in the transform is preferred since we get the alerts at compile time.
👍 |
@@ -73,7 +73,7 @@ export function withHelper(params, hash, options, env) { | |||
} else { | |||
Ember.deprecate( | |||
"Using the context switching form of `{{with}}` is deprecated. " + | |||
"Please use the keyword form (`{{with foo as bar}}`) instead.", | |||
"Please use the block form (`{{#with foo as |bar|}}`) instead.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be "block params" not "block" since both the good and bad forms are actually blocks. The thing we want to convey is that they should use the block param instead of {{#with foo as bar}}.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
4776104
to
16dfc07
Compare
16dfc07
to
f283359
Compare
Rebased. |
f283359
to
60e06bb
Compare
"Using {{with}} without block syntax is deprecated. " + | ||
"Please use standard block form (`{{#with foo as |bar|}}`) instead.", | ||
false, | ||
{ url: "http://emberjs.com/guides/deprecations/#toc_deprecate-non-block-params-with-syntax" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this needs to be updated to point to the new location, c/d?
d5181a4
to
aeb5571
Compare
Looks like a few failures in the deprecation. |
aeb5571
to
9985469
Compare
@rwjblue fixed now. |
Deprecate the non-block {{with}} syntax
Depends on merge of emberjs/guides#63