-
-
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 {{each in}} syntax #10583
Deprecate {{each in}} syntax #10583
Conversation
Is there a test ensuring that the inline-with-key form is deprecated? For example, {{each item in items itemViewClass="post"}} You should also throw a similar deprecation in the AST transform for |
@mmun Do you mean this https://github.com/emberjs/ember.js/pull/10583/files#diff-8600fa262132288b94b079e49d7e42a6R817 ? One question we should answer for both this as #10584 is whether we should have deprecation warnings in the AST transform or in the helper itself. |
I'd prefer to get as many deprecations at compile time as possible, so that you don't have to hope they stumble into them. It's easy to pull the line numbers off the AST nodes as well. It keeps the helper code clean too. |
9cf5bc2
to
2737218
Compare
@mmun Deprecations have been moved into the transform. |
@@ -44,6 +44,13 @@ TransformEachInToHash.prototype.transform = function TransformEachInToHash_trans | |||
throw new Error('You cannot use keyword (`{{each foo in bar}}`) and block params (`{{each bar as |foo|}}`) 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.
Need to import Ember from 'ember-metal/core';
for this to work in node-land.
I recently did a bit of work in emberjs-build to ensure that the |
2737218
to
bbe7954
Compare
"Using the 'each in' form of {{each}} is deprecated. " + | ||
"Please use the block form (`{{#each foo as |bar|}}`) instead.", | ||
false, | ||
{ url: 'http://emberjs.com/guides/deprecations/#toc_deprecate-non-block-params-each-helper-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 the new url.
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.
@wagenet - ping?
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.
@wagenet - Ping?
Depends on merge of emberjs/guides#63