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 the non-block {{with}} syntax #10584

Merged
merged 1 commit into from
Apr 3, 2015
Merged

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

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?

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

@mmun
Copy link
Member

mmun commented Mar 7, 2015

👍

@@ -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.",
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 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}}.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point.

@wagenet
Copy link
Member Author

wagenet commented Mar 19, 2015

Rebased.

"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" }
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 point to the new location, c/d?

@wagenet wagenet force-pushed the deprecate-non-block-with branch 2 times, most recently from d5181a4 to aeb5571 Compare April 3, 2015 19:19
@rwjblue
Copy link
Member

rwjblue commented Apr 3, 2015

Looks like a few failures in the deprecation.

@wagenet
Copy link
Member Author

wagenet commented Apr 3, 2015

@rwjblue fixed now.

rwjblue added a commit that referenced this pull request Apr 3, 2015
Deprecate the non-block {{with}} syntax
@rwjblue rwjblue merged commit 86dc098 into master Apr 3, 2015
@rwjblue rwjblue deleted the deprecate-non-block-with branch April 3, 2015 22:15
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.

3 participants