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

RFC#286 | Implement block let helper as syntax #16076

Merged
merged 1 commit into from
Jan 8, 2018
Merged

Conversation

locks
Copy link
Contributor

@locks locks commented Jan 6, 2018

I have started implementing RFC#286 so developers can start trying it out.

Tasks

  • Add feature flag
  • Implement block let
  • Document implementation
  • Add tests

@locks locks requested a review from mmun January 6, 2018 12:20
@locks locks force-pushed the implement-let-helper branch from b08938d to 0612091 Compare January 7, 2018 05:31
@locks locks changed the title WIP | RFC#286 | Implement block let helper as syntax RFC#286 | Implement block let helper as syntax Jan 7, 2018
@locks locks force-pushed the implement-let-helper branch from 0612091 to 060e47b Compare January 7, 2018 22:26

```handlebars
{{#let
(concat post ' | The Ember.js Blog' )
Copy link
Member

Choose a reason for hiding this comment

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

nitpick, (concat post ' | The Ember.js Blog')

return `{{#let ${cond} as |test|}}${truthy}{{else}}${falsy}{{/let}}`;
}

['@test keying off of `undefined` does not render']() {
Copy link
Member

@GavinJoyce GavinJoyce Jan 7, 2018

Choose a reason for hiding this comment

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

I find the description a little hard to parse. Perhaps something like @test a key with an undefined value renders nothing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, the tests were adapted from {{with}} and this should not actually pass 🤔 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It passes because undefined renders as ``, hah. Adapted the test for {{let}}.

@locks locks force-pushed the implement-let-helper branch 4 times, most recently from 6d592ac to 8c48a63 Compare January 8, 2018 00:14
{{/let}}
```

@method let
Copy link
Contributor Author

@locks locks Jan 8, 2018

Choose a reason for hiding this comment

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

I am not sure what other annotations to put here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@locks locks force-pushed the implement-let-helper branch from 8c48a63 to 056feb1 Compare January 8, 2018 13:53
that receives a lot of options and you want to clean up the invocation.

For the following example, the template receives a `post` object with
`content` and `title` properties, and a `user` object with `firstName`
Copy link
Member

Choose a reason for hiding this comment

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

I don't see a user object passed in the example below, maybe that was from a prior iteration?

`content` and `title` properties, and a `user` object with `firstName`
and `lastName` properties.

We are going to call the `my-post` component, passing a title with is
Copy link
Member

Choose a reason for hiding this comment

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

s/with is/which is/

@locks locks force-pushed the implement-let-helper branch from 056feb1 to 614e893 Compare January 8, 2018 14:50
@locks locks force-pushed the implement-let-helper branch from 614e893 to 69c1628 Compare January 8, 2018 14:51
@locks locks merged commit 2cd02df into master Jan 8, 2018
@locks locks deleted the implement-let-helper branch January 8, 2018 15:24
@mmun mmun removed their request for review January 8, 2018 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants