Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

wagenet
Copy link
Member

@wagenet wagenet commented Mar 7, 2015

Depends on merge of emberjs/guides#63

@wagenet wagenet added the Cleanup label Mar 7, 2015
@mmun
Copy link
Member

mmun commented Mar 7, 2015

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 each as in with.

@wagenet
Copy link
Member Author

wagenet commented Mar 7, 2015

@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.

@mmun
Copy link
Member

mmun commented Mar 7, 2015

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.

@wagenet
Copy link
Member Author

wagenet commented Mar 19, 2015

@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(
Copy link
Member

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.

@rwjblue
Copy link
Member

rwjblue commented Mar 19, 2015

I recently did a bit of work in emberjs-build to ensure that the ember-template-compiler.js file has the ability to print deprecation warnings. Can you bump emberjs-build in the package.json to include 0.0.42 of emberjs-build?

"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' }
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wagenet - ping?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wagenet - Ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants