Skip to content

Conversation

@kiwiupover
Copy link
Contributor

No description provided.

@kiwiupover
Copy link
Contributor Author

I have a bit more work to do 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.

Replace by line #28

Copy link
Member

Choose a reason for hiding this comment

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

✔️ should yield to block, when the yield is embedded in a each helper

@kiwiupover kiwiupover force-pushed the glimmer-yield-tests branch from eb6c66d to 5c3d7e7 Compare March 30, 2016 14:40
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced by #7

Copy link
Member

Choose a reason for hiding this comment

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

✔️ can yield to block

@kiwiupover kiwiupover force-pushed the glimmer-yield-tests branch from 5c3d7e7 to 88706df Compare March 30, 2016 14:59
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced by #196

@kiwiupover kiwiupover force-pushed the glimmer-yield-tests branch 2 times, most recently from 428c69d to 2ea60b2 Compare March 30, 2016 15:21
@kiwiupover
Copy link
Contributor Author

@chancancode this is ready for you, mate.

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 seems to me that parentView is not yet implemented yet in glimmer2?

I could be totally wrong and I just need to figure out what the hell I'm doing.

Copy link
Member

Choose a reason for hiding this comment

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

It should be implemented. There may be bugs, though.

Copy link
Member

Choose a reason for hiding this comment

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

"virtual view" is no longer terminology in Ember. yield should not introduce a view perhaps?

Copy link
Member

Choose a reason for hiding this comment

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

s/outer context/original context/

@wycats
Copy link
Member

wycats commented Apr 5, 2016

Meta-comment: if you decided not to do the full INUR for a given test, can you write a comment in the test explaining why?

@kiwiupover
Copy link
Contributor Author

Thanks for the review @wycats I will get these addressed.

@kiwiupover kiwiupover force-pushed the glimmer-yield-tests branch 2 times, most recently from 2d4e703 to 422016a Compare April 9, 2016 21:04
Copy link
Contributor

Choose a reason for hiding this comment

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

can you drop the divs and just do just assert HelloHelloHelloHelloHello?

@kiwiupover
Copy link
Contributor Author

I pulled a lot of the DOM out of the test cases. I'm totally willing to put that back if we feel that would be valuable. @krisselden

@kiwiupover kiwiupover force-pushed the glimmer-yield-tests branch from c5adb23 to 13b10ad Compare April 9, 2016 22:34
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to do something like

this.assertComponentElement(this.nthChild(0).firstChild, { tagName: 'div', attrs: {class: 'yielding' } });

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chadhietala the nthChild method seems to be more of a nthSibling method.

The DOM that this test produces is

<div id='ember342'>
   <div id='ember344'>
      <div class='yielding'></div>
   </div>
</div>

Hence the your assertion suggestion will not work.

Is there a need for a help to asset deep into a DOM tree?

I have updated to the test to be simpler. Here

@chadhietala
Copy link
Contributor

Just that one nit, otherwise LGTM.

@kiwiupover kiwiupover force-pushed the glimmer-yield-tests branch from 13b10ad to 41d5595 Compare April 11, 2016 03:00
@kiwiupover
Copy link
Contributor Author

@wycats @chadhietala This is ready for review.

@chadhietala am I doing the a full INUR on the test that need the full treatment.

Copy link
Member

Choose a reason for hiding this comment

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

We can add a simple curly to the block to make sure it updates:

this.registerComponent('yield-comp', { template: '<div>[In layout] {{yield}}</div>' });

// I
this.render('{{#yield-comp}}[In block: {{foo}}]{{/yield-comp}}', { foo: "foo" });
this.assertText('[In layout] [In block: foo]');

// N
this.assertStableRerender();

// U
this.runTask(() => set(this.context, 'foo', 'bar');
this.assertText('[In layout] [In block: bar]');

// R
this.runTask(() => set(this.context, 'foo', 'foo');
this.assertText('[In layout] [In block: foo]');

@kiwiupover kiwiupover force-pushed the glimmer-yield-tests branch from 41d5595 to 2e8b89a Compare April 13, 2016 05:46
@kiwiupover
Copy link
Contributor Author

@chancancode @chadhietala @krisselden

I have update the first few tests to do a full INUR by adding some curlies at @chancancode promoting. Also I removed all jQuery crap.

The parentView test is the only test not doing a full INUR.

Also I think we need more testing for the yield helper ie {{yield foo}}, {{yield 'title'}} and {{yield this}} to name a few. This PR replaces the HTMLbar test. I can open an issue for more complete {{yield}} tests.

@krisselden krisselden merged commit 5020f54 into emberjs:master Apr 13, 2016
@chancancode
Copy link
Member

Thanks @kiwiupover 🎉 🎉 🎉 🎉 🎉

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.

5 participants