Skip to content

Commit

Permalink
Merge pull request #19638 from nlfurniss/remove-deprecated-with
Browse files Browse the repository at this point in the history
Remove deprecated with
  • Loading branch information
chancancode committed Jul 18, 2021
2 parents 0158265 + 2510312 commit e1577fb
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 704 deletions.
28 changes: 0 additions & 28 deletions packages/@ember/-internals/glimmer/index.ts
Expand Up @@ -88,34 +88,6 @@
@public
*/

/**
Use the `{{with}}` helper when you want to alias a property to a new name. This is helpful
for semantic clarity as it allows you to retain default scope or to reference a property from another
`{{with}}` block.
If the aliased property is "falsey", for example: `false`, `undefined` `null`, `""`, `0`, `NaN` or
an empty array, the block will not be rendered.
```app/templates/application.hbs
{{! Will only render if user.posts contains items}}
{{#with @model.posts as |blogPosts|}}
<div class="notice">
There are {{blogPosts.length}} blog posts written by {{@model.name}}.
</div>
{{#each blogPosts as |post|}}
<li>{{post.title}}</li>
{{/each}}
{{/with}}
```
@method with
@for Ember.Templates.helpers
@param {Object} options
@return {String} HTML string
@deprecated Use '{{#let}}' instead
@public
*/

/**
`{{yield}}` denotes an area of a template that will be rendered inside
of another template.
Expand Down
Expand Up @@ -352,38 +352,6 @@ moduleFor(
this.assertText('number: EVEN0number: ODD1number: EVEN2number: ODD3');
}

['@test [DEPRECATED] dynamic partials in {{#with}}']() {
this.registerPartial('_thing', '{{t}}');

expectDeprecation(() => {
this.render(
strip`
{{#with this.item.thing as |t|}}
{{partial t}}
{{else}}
Nothing!
{{/with}}`,
{
item: { thing: false },
}
);
}, /`{{#with}}` is deprecated\./);

this.assertStableRerender();

this.assertText('Nothing!');

expectDeprecation(() => {
runTask(() => set(this.context, 'item.thing', 'thing'));
}, 'The use of `{{partial}}` is deprecated, please refactor the "thing" partial to a component');

this.assertText('thing');

runTask(() => set(this.context, 'item', { thing: false }));

this.assertText('Nothing!');
}

['@test dynamic partials in {{#let}}']() {
this.registerPartial('_thing', '{{t}}');

Expand Down

0 comments on commit e1577fb

Please sign in to comment.