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

Remove hasBlock and hasBlockParams #19657

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/@ember/-internals/glimmer/index.ts
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
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