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

make Greenwood CLI and plugins async through and through #823

Open
1 of 5 tasks
thescientist13 opened this issue Dec 18, 2021 · 0 comments
Open
1 of 5 tasks

make Greenwood CLI and plugins async through and through #823

thescientist13 opened this issue Dec 18, 2021 · 0 comments
Labels
CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) good first issue Good for newcomers Plugins Greenwood Plugins
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Dec 18, 2021

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Coming out of #532 , where I had tried to do some async operations in the provider of a plugin, that it dawned on me that should we really be better committed to, and consistently, implementing async in Greenwood.

Details

The main issue is that to do something like this, everything has to become async, which is fine, but we just have to design around it so that we can support async and non-async functions alike, with one API. This is because await will automatically wrap return values in Promise, so in that way async is backwards compatible, unlike a sync version

This would also be a good time to fix "faux" async where we use it inside for forEach and reduce functions, which when actually forced into an async context, fall apart, since those Array methods are sync. We should probably use more for ... in.

Bonus, the async variants of fs methods can take an instance of URL natively, so we wouldn't have to use pathToFileURL in those situation. - I think this is now handled as part of #948


Notes

OR

Should use sync more, in sync cases like within a map or filter.

@thescientist13 thescientist13 added chore unit testing, maintenance, etc Plugins Greenwood Plugins CLI labels Dec 18, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Dec 18, 2021
@thescientist13 thescientist13 self-assigned this Dec 18, 2021
@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) and removed chore unit testing, maintenance, etc labels Mar 15, 2022
@thescientist13 thescientist13 removed their assignment Mar 15, 2022
@thescientist13 thescientist13 added good first issue Good for newcomers and removed v0.28.0 labels Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) good first issue Good for newcomers Plugins Greenwood Plugins
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant