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

[Discussion] Recommend using async/await for prompting #836

Closed
6 of 8 tasks
rishabh3112 opened this issue Apr 20, 2019 · 20 comments
Closed
6 of 8 tasks

[Discussion] Recommend using async/await for prompting #836

rishabh3112 opened this issue Apr 20, 2019 · 20 comments

Comments

@rishabh3112
Copy link
Member

rishabh3112 commented Apr 20, 2019

Do you want to request a feature or report a bug?

Discussion

What is the current behavior?
Currently, we are writing promise chains for prompting, which reduces readability as we nest deeper and deeper.

If the current behavior is a bug, please provide the steps to reproduce.

N/A

What is the expected behavior?
Using async/await for prompting. Example:
https://github.com/rishabh3112/webpack-scaffold-starter/blob/78889a176932ab2c5dadfb2c1d3946cc813bfda5/index.js#L57-L63

If this is a feature request, what is motivation or use case for changing the behavior?
N/A
Please paste the results of webpack-cli info here, and mention other relevant information such as programming language.
N/A


If it looks fine to all, I would PR for migrating generators in webpack-cli, webpack-scaffold-pwa and webpack-scaffold-vue

List of generators to be migrated

@anshumanv
Copy link
Member

👍 for this, would lead to much cleaner code.

@ematipico
Copy link
Contributor

ematipico commented Apr 20, 2019

We still support node 6, we can't remove them.
Although we can consider it to the next major version (which already uses them), look at the next branch.

If it looks fine to all, I would PR for migrating generators in webpack-cli, webpack-scaffold-pwa and webpack-scaffold-vue

The title says async/await but here talk about generators. Which one do you refer to?

@rishabh3112
Copy link
Member Author

I meant to migrate prompting() of yeoman generators to async/await.
For example add-generator, etc we have in CLI

@rishabh3112
Copy link
Member Author

Also, as we are using TS, we don't need to worry as TSC will polyfill based on our target while compilation.

@ematipico
Copy link
Contributor

Sounds good so!

@anshumanv
Copy link
Member

anshumanv commented Apr 21, 2019

Picking addon generator if it's cool 🤚

@misterdev
Copy link
Contributor

If it's ok I can include this change into the refactor of the init generator I'm currently working on :)

@rishabh3112
Copy link
Member Author

Sure, let me make a checklist of all the generators, when on laptop, and lets collaborate 🤓

@dhruvdutt
Copy link
Member

dhruvdutt commented Apr 22, 2019

I'm working on the remove generator. 😁 😅

@anshumanv
Copy link
Member

anshumanv commented Apr 22, 2019

Just a heads up to prevent extra work, add is done here - #843 😄

@misterdev
Copy link
Contributor

I think @anshumanv is talking about the add generator :)

@rishabh3112
Copy link
Member Author

rishabh3112 commented Apr 22, 2019

Have updated the issue with who is on what✔
Look and work accordingly

@jamesgeorge007
Copy link
Member

@rishabh3112 @ematipico @misterdev I would love to give it a try in-order to refactor packages/serve. Let me know if it is within the scope here.

@rishabh3112
Copy link
Member Author

Yes it is, feel free to send a PR 🙂

@evenstensberg
Copy link
Member

This would be great and we can refactor to use that. Reason for not having it in the first place was to support legacy node version, but minimal supported now is v.8 and it was introduced in 7.6, so go ahead

@evenstensberg
Copy link
Member

Init generator is probably most important to use this first with, then add

@evenstensberg
Copy link
Member

Anything missing here @rishabh3112 ?

@rishabh3112
Copy link
Member Author

Yes, opened to flag existing scaffold developers to use async/await for thiers scaffolds too.

Even though this can be opened in individual repos but I think having things centralized in the first iteration would be better.

@evenstensberg
Copy link
Member

This is mostly on us, if we implement async await in our generators, that will fix the issue. Is that done? I think we've implemented that already

@rishabh3112
Copy link
Member Author

Yup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants