make Greenwood CLI and plugins async
through and through
#823
Labels
CLI
enhancement
Improve something existing (e.g. no docs, new APIs, etc)
good first issue
Good for newcomers
Plugins
Greenwood Plugins
Milestone
Type of Change
Summary
Coming out of #532 , where I had tried to do some
async
operations in theprovider
of a plugin, that it dawned on me that should we really be better committed to, and consistently, implementingasync
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 supportasync
and non-async functions alike, with one API. This is becauseawait
will automatically wrap return values inPromise
, so in that wayasync
is backwards compatible, unlike a sync versionThis would also be a good time to fix "faux" async where we use it inside for
forEach
andreduce
functions, which when actually forced into anasync
context, fall apart, since those Array methods are sync. We should probably use morefor ... in
.Bonus, the- I think this is now handled as part of #948async
variants offs
methods can take an instance ofURL
natively, so we wouldn't have to usepathToFileURL
in those situation.Notes
Request
/Response
/URL
/ etc) #948async
, like middlewares for the server or bundling, since order matters. But anywhere else where we can parallelize, we should.async
provider pluginsOR
Should use sync more, in sync cases like within a map or filter.
The text was updated successfully, but these errors were encountered: