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 {{hasBlock}} and {{hasBlockParams}} in templates #689

Merged
merged 4 commits into from Jan 22, 2021

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Dec 23, 2020

@pzuraq pzuraq changed the title Deprecate {{hasBlock}} Deprecate {{hasBlock}} in templates Dec 23, 2020
@bertdeblock
Copy link
Member

👋 Should hasBlockParams be included in this RFC as well or should that be a separate one?

It seems:

{{#if hasBlockParams}}

{{/if}}

and

{{#if (has-block-params)}}

{{/if}}

accomplish the same thing as well.

@chancancode chancancode added this to the 4.0 milestone Jan 6, 2021
@chancancode
Copy link
Member

Yep let's add hasBlockParams to the RFC as well!

@chancancode
Copy link
Member

We discussed this on the framework core team meeting today. We are all 👍 but agreed logistically it's easier to add hasBlockParams to this RFC first.

@pzuraq
Copy link
Contributor Author

pzuraq commented Jan 11, 2021

Yeah, the only reason it was not part of this RFC was because the transform only documents that it works for hasBlock 🙃 will add it this week

@ijlee2
Copy link
Sponsor Member

ijlee2 commented Jan 15, 2021

Hi, @pzuraq. Could you update the link for Rendered? I think it's broken cause the RFC title changed of RFC no. Thanks.

@pzuraq pzuraq changed the title Deprecate {{hasBlock}} in templates Deprecate {{hasBlock}} and {{hasBlockParams}} in templates Jan 15, 2021
@rwjblue
Copy link
Member

rwjblue commented Jan 15, 2021

We discussed this at todays core team meeting, and are moving it into final comment period.

@rwjblue rwjblue added T-framework RFCs that impact the ember.js library T-templates labels Jan 15, 2021
Copy link
Contributor

@jelhan jelhan left a comment

Choose a reason for hiding this comment

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

Both {{has-block}} and {{has-block-params}} are currently documented as hasBlock and hasBlockParams in API docs. This might be very confusing when this deprecation lands.

Comment on lines +94 to +100
The `{{hasBlockParams}}` property is true if the component was given a default block,
and false otherwise. To transition away from it, you can use the `(has-block-params)`
helper instead.
Copy link
Contributor

@jelhan jelhan Jan 16, 2021

Choose a reason for hiding this comment

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

Suggested change
The `{{hasBlockParams}}` property is true if the component was given a default block,
and false otherwise. To transition away from it, you can use the `(has-block-params)`
helper instead.
The `{{hasBlockParams}}` property is true if the component was invoked with block
params for the default block, and false otherwise. To transition away from it, you can
use the `(has-block-params)` helper instead.

@rwjblue
Copy link
Member

rwjblue commented Jan 16, 2021

@jelhan - ya, totally agree! We'll need to ensure that the API docs are updated at the time the deprecation guide lands.

@pzuraq - Would you mind double checking the prose here to see if we need to explicitly call that out? I think it may be already included in the existing prose RE: "How we teach this", but would love a second set of 👀...

@knownasilya
Copy link
Contributor

Regarding implementing this, should this be a deprecation log on build? Since it's a build time transform?

@chancancode
Copy link
Member

I think either would be acceptable, but generally if we can do it at build time that would be preferable IMO.

@rwjblue
Copy link
Member

rwjblue commented Jan 21, 2021

Agree. Doing it in the build gives us easier access to actual line / column numbers which is very helpful.

brunoocasali added a commit to brunoocasali/ember-infinity that referenced this pull request Mar 30, 2021
snewcomer pushed a commit to adopted-ember-addons/ember-infinity that referenced this pull request May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Final Comment Period T-framework RFCs that impact the ember.js library T-templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants