-
Notifications
You must be signed in to change notification settings - Fork 139
Implement readFileSync for ZipTreeContainer #583
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
Conversation
v55 introduces the following new types. Here's their current level of support | ||
|
||
|Metadata Type|Support|Notes| | ||
|:---|:---|:---| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how this magic happens. commit flow I assume. Lemme know if I need to fix up something here.
"@salesforce/core": "^2.35.0", | ||
"@salesforce/kit": "^1.5.32", | ||
"@salesforce/ts-types": "^1.4.2", | ||
"archiver": "^5.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the third party dependency that got the deal done. https://www.npmjs.com/package/deasync. MIT licensed and around 1M downloads a week so seemed a safe choice. I'm following up on what I need to do for 3PP land.
done = true; | ||
throw error; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module covers doing exactly the ask here. Do something async but treat the current flow and synchronous.
This reverts commit da9c7ef.
What does this PR do?
Implements the readFileSync function in ZipTreeContainer.
I attempted to get this done without bringing in a third party module without success. Basically if TS/js wants to be sync/async there's no magic formula for getting around it. Also the zip module we are using
unzipper
has no support for reading a file synchronously.This PR brings in the deasync module that gets around this problem by providing a non-js solution for making an async flow synchronous.
What issues does this PR fix or reference?
Required for fixing @W-10120433@
Functionality Before
readFileSync was not implemented for ZipTreeContainer
Functionality After
readFileSync is implemented for ZipTreeContainer. Have verified that it fixes the issues found in https://github.com/forcedotcom/salesforcedx-vscode by linking the updated module locally.