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

Feature/async await cleanup 1 #53

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

aesqe
Copy link
Contributor

@aesqe aesqe commented Jan 4, 2019

In short: I've converted some of the more used filesystem functions to use sync methods.

getPlatformConfig
setPlatformConfig
getPlatformRootDir
getPlatformExtensionsDir
loadExtensionJson
addToExtensionsJs
cache getValue, setValue
clearTokens
authorizeRequests
setHostEnvName
parseCredentials
getLinkedDirectories
setLinkedDirectories
linkExtension
linkDirectory
unlinkDirectory
getAnalyticsVisitor
getCacheFilePath
readJsonFile
writeJsonFile
handleError
containsBuildTask
getPackageJson
savePackageJson
addLocalDependency
linkLocalDependencies
isPlatformDirectory

I've also removed all the redundant return awaits at function endings.

As far as I can tell, there's no upside to using async methods for ~1ms file reading operations in a command line tool running in a single threaded node process. And I believe it also makes the CLI code easier to read and follow.

I'm pretty sure that I didn't remove every await call where it's not needed any more, but it's not a problem since it'll resolve to the same value.

Please comment away :)

@aesqe aesqe changed the base branch from master to develop January 4, 2019 16:05
Copy link
Contributor

@Definitely-Not-Vlad Definitely-Not-Vlad left a comment

Choose a reason for hiding this comment

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

Could not find anything I would consider questionable.

As far as I'm concerned, merge away, however, I'd like you to publish this under a 0.11.0-alpha version or whatever the version is, I forget. I'd like to test this out thoroughly before we set it as latest on npm, if you don't mind. I don't expect any issues, but: "Trust, but verify."

@aesqe
Copy link
Contributor Author

aesqe commented Apr 12, 2019

I'd like to test this out thoroughly before we set it as latest on npm, if you don't mind. I don't expect any issues, but: "Trust, but verify."

Why would I mind, this really needs to be tested before it's released as stable 😄

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.

2 participants