Skip to content

Commit

Permalink
Merge pull request #19657 from mixonic/mixonic/remove-hasBlock-hasBlo…
Browse files Browse the repository at this point in the history
…ckParams

Remove hasBlock and hasBlockParams
  • Loading branch information
rwjblue authored Jul 21, 2021
2 parents cc45f94 + 5561896 commit 561d569
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 315 deletions.
8 changes: 4 additions & 4 deletions packages/@ember/-internals/glimmer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
*/

/**
`{{has-block}}` indicates if the component was invoked with a block.
`{{(has-block)}}` indicates if the component was invoked with a block.
This component is invoked with a block:
Expand Down Expand Up @@ -187,15 +187,15 @@
{{/if}}
```
@method hasBlock
@method has-block
@for Ember.Templates.helpers
@param {String} the name of the block. The name (at the moment) is either "main" or "inverse" (though only curly components support inverse)
@return {Boolean} `true` if the component was invoked with a block
@public
*/

/**
`{{has-block-params}}` indicates if the component was invoked with block params.
`{{(has-block-params)}}` indicates if the component was invoked with block params.
This component is invoked with block params:
Expand Down Expand Up @@ -242,7 +242,7 @@
{{/if}}
```
@method hasBlockParams
@method has-block-params
@for Ember.Templates.helpers
@param {String} the name of the block. The name (at the moment) is either "main" or "inverse" (though only curly components support inverse)
@return {Boolean} `true` if the component was invoked with block params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,13 +1357,10 @@ moduleFor(
this.assertStableRerender();
}

['@test GH#18732 hasBlock works within a yielded curried component invoked within mustaches']() {
expectDeprecation(
`\`hasBlock\` is deprecated. Use \`has-block\` instead. ('my-app/templates/components/component-with-has-block.hbs' @ L1:C5) `
);
['@test GH#18732 (has-block) works within a yielded curried component invoked within mustaches']() {
this.registerComponent('component-with-has-block', {
ComponentClass: Component.extend(),
template: '<div>{{hasBlock}}</div>',
template: '<div>{{(has-block)}}</div>',
});

this.registerComponent('yielding-component', {
Expand All @@ -1382,14 +1379,10 @@ moduleFor(
this.assertText('false');
}

['@test GH#18732 has-block works within a yielded curried component invoked with angle bracket invocation (falsy)']() {
expectDeprecation(
`\`hasBlock\` is deprecated. Use \`has-block\` instead. ('my-app/templates/components/component-with-has-block.hbs' @ L1:C5) `
);

['@test GH#18732 (has-block) works within a yielded curried component invoked with angle bracket invocation (falsy)']() {
this.registerComponent('component-with-has-block', {
ComponentClass: Component.extend(),
template: '<div>{{hasBlock}}</div>',
template: '<div>{{(has-block)}}</div>',
});

this.registerComponent('yielding-component', {
Expand All @@ -1408,14 +1401,10 @@ moduleFor(
this.assertText('false');
}

['@test GH#18732 has-block works within a yielded curried component invoked with angle bracket invocation (truthy)']() {
expectDeprecation(
`\`hasBlock\` is deprecated. Use \`has-block\` instead. ('my-app/templates/components/component-with-has-block.hbs' @ L1:C5) `
);

['@test GH#18732 (has-block) works within a yielded curried component invoked with angle bracket invocation (truthy)']() {
this.registerComponent('component-with-has-block', {
ComponentClass: Component.extend(),
template: '<div>{{hasBlock}}</div>',
template: '<div>{{(has-block)}}</div>',
});

this.registerComponent('yielding-component', {
Expand Down
Loading

0 comments on commit 561d569

Please sign in to comment.