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

Allow promise for locals function in blueprints #4025

Merged
merged 4 commits into from
Mar 17, 2016

Conversation

knownasilya
Copy link
Contributor

This is a WIP for moving ember-cli/rfcs#7 forward.
Basically you can test it with ember new [name] --blueprint https://github.com/knownasilya/app-blueprint.git

The issue is that you cannot select inquirer options using your keys. Basically this is the output:

screen shot 2015-05-06 at 11 31 47 am

"Leaflet" is the default here, and hitting up/down creates those characters below.

@knownasilya
Copy link
Contributor Author

cc @stefanpenner

@knownasilya
Copy link
Contributor Author

Probably something to do with readline, maybe here: https://github.com/ember-cli/ember-cli/blob/master/lib/ui/index.js#L126

@knownasilya
Copy link
Contributor Author

@MajorBreakfast you contributed to that code, do you have any thoughts about this issue?

@MajorBreakfast
Copy link
Contributor

I knew about this bug, but didn't investigate further at the time. My solution was to use one of the other input styles.

@knownasilya
Copy link
Contributor Author

Hum, maybe @SBoudrias has some thoughts.

@SBoudrias
Copy link

In Inquirer, we mute the input with mute-stream. Maybe something is overridding it?

@knownasilya
Copy link
Contributor Author

@stefanpenner do you have any ideas about this issue?

@stefanpenner
Copy link
Contributor

@stefanpenner do you have any ideas about this issue?

unfortunately nothing concrete. It would seem like we need a more complex UI stack here. Basically, when we move to inquirer, we likely need to "end" the previous UI session, then "resume" it once the inquirer step has completed.

I suspect this would also make a good refactoring. Unfortunately, short of this, I am unaware of another approach. This of course does not mean that this isn't possible, so further investigation likely is a good idea.

@knownasilya
Copy link
Contributor Author

@stefanpenner where is the "previous UI session"?

@Turbo87
Copy link
Member

Turbo87 commented Mar 15, 2016

@knownasilya what's the state of this PR? anyone still working on it? is it still relevant?

@knownasilya
Copy link
Contributor Author

I think it's still relevant, and by itself it's pretty much finished. It's the other pieces to the puzzle that need to be figured out.

@iheanyi
Copy link
Contributor

iheanyi commented Mar 17, 2016

This should be fixed by my PR #5621.

@knownasilya
Copy link
Contributor Author

A little stumped why the other tests are failing, the result from _process looks fine..

@stefanpenner
Copy link
Contributor

#5621 is scheduled for merge

};

return merge({}, standardLocals, customLocals);
return Promise.resolve(this.locals(options))
Copy link
Contributor

Choose a reason for hiding this comment

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

lets use the constructor form here, in-case locals throws.

return new Promise(function(resolve) {
  resolve(this.locals(options);
}.bind(this))

This ensures the function returns a promise correctly, and this.locals behaves like other functions who's return value may be a promise.

@stefanpenner
Copy link
Contributor

left 1 comment, once addressed we can merge.

@knownasilya
Copy link
Contributor Author

@stefanpenner change made, but I still don't know why the tests are broken.

@stefanpenner
Copy link
Contributor

@homu r+

@homu
Copy link
Contributor

homu commented Mar 17, 2016

📌 Commit a8a9465 has been approved by stefanpenner

@homu
Copy link
Contributor

homu commented Mar 17, 2016

⌛ Testing commit a8a9465 with merge 22be3e0...

homu added a commit that referenced this pull request Mar 17, 2016
Allow promise for locals function in blueprints

This is a WIP for moving ember-cli/rfcs#7 forward.
Basically you can test it with `ember new [name] --blueprint https://github.com/knownasilya/app-blueprint.git`

The issue is that you cannot select inquirer options using your keys. Basically this is the output:

![screen shot 2015-05-06 at 11 31 47 am](https://cloud.githubusercontent.com/assets/34726/7496673/89c54f94-f3e3-11e4-9ca8-c559cd985982.png)

"Leaflet" is the default here, and hitting up/down creates those characters below.
@homu
Copy link
Contributor

homu commented Mar 17, 2016

☀️ Test successful - status

@homu homu merged commit a8a9465 into ember-cli:master Mar 17, 2016
@knownasilya knownasilya deleted the locals-promise branch March 19, 2018 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants