Skip to content

Two way address bar#257

Merged
Gaurav0 merged 6 commits intoember-cli:masterfrom
Gaurav0:two_way_address_bar
Oct 28, 2015
Merged

Two way address bar#257
Gaurav0 merged 6 commits intoember-cli:masterfrom
Gaurav0:two_way_address_bar

Conversation

@Gaurav0
Copy link
Copy Markdown
Contributor

@Gaurav0 Gaurav0 commented Oct 28, 2015

This updates PR #248 with tests that pass reliably in PhantomJS

@joostdevries @rwjblue @alexspeller @stefanpenner Please review.

pangratz and others added 3 commits October 27, 2015 17:05
This change makes the address bar for the demo app functional, so
entering a new URL and pressing enter triggers a transition to that URL
in the demo app.
Comment thread app/components/address-bar.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to be sure, this will be fired when a new URL is entered and the element is blurred, right? In the previous commit, the action is only fired, when enter is pressed...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. But it seems that in testing, fillIn never fires the enter event, whatever you do.

http://stackoverflow.com/questions/28586314/trigger-an-inputs-action-from-an-acceptance-test#comment45530171_28596428

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@pangratz Yes, blurring now makes the page switch.

@pangratz
Copy link
Copy Markdown
Contributor

Apart from my comment, this looks good! Thanks for fixing my failing tests @Gaurav0 😄

I guess waiting for the iframe to be loaded could eventually be refactored using Ember.Test.registerWaiter, but this is out of the scope for this PR.

Comment thread tests/acceptance/routing-test.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

resolve(); should remove the need for done / async

@Gaurav0
Copy link
Copy Markdown
Contributor Author

Gaurav0 commented Oct 28, 2015

@joostdevries @rwjblue @alexspeller @stefanpenner @pangratz All comments addressed. Please let me know if ok to merge.

@joostdevries
Copy link
Copy Markdown
Member

lgtm 👍

Gaurav0 added a commit that referenced this pull request Oct 28, 2015
@Gaurav0 Gaurav0 merged commit 98dbf21 into ember-cli:master Oct 28, 2015
@Gaurav0 Gaurav0 deleted the two_way_address_bar branch October 28, 2015 20:01
@pangratz
Copy link
Copy Markdown
Contributor

wohoo, party! 🎉

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The idea was for the app code to do the waiting code, as it understands the async more closely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The problem with that is that one app sends the communication and a different app receives it. This isn't really "async", the main app just receives a communication and doesn't know when to stop and wait for it. The iframe app can't communicate to the main app except through this channel.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe an event on willTransition should be send in the demo app as well. I will try to look into this tomorrow...

@joostdevries
Copy link
Copy Markdown
Member

@stefanpenner @Gaurav0 I think this is a huge step forward. A next iteration on this would ideally restart the app with the provided route as initial state (so you can more effectively debug model hook issues). cc @rwjblue

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.

4 participants