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
Remove return Promise.resolve()
statements from the codebase
#422
Changes from 13 commits
2a83b21
7b99b1b
ca16ef7
6cdf964
fecde12
d2d2a97
762244b
9cc53ac
c1f73c0
12c2b54
89cfffd
5a3e581
71923f7
c329a92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,14 +132,13 @@ export class DatabaseInternals { | |
constructor(public database: Database) {} | ||
|
||
/** @return {Promise<void>} */ | ||
delete(): Promise<void> { | ||
async delete(): Promise<void> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How will this be supported in browsers that don't support async/await. Last time I asked - this wasn't being polyfilled. If it is - that may be a big polyfill. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think TypeScript supports async/await and has downlevel helpers to make the generated code work in ES3/ES5 (https://blog.mariusschulz.com/2016/12/09/typescript-2-1-async-await-for-es3-es5) but we need to see what the resulting code size change is... |
||
(this.database as any).checkDeleted_('delete'); | ||
RepoManager.getInstance().deleteRepo((this.database as any).repo_ as Repo); | ||
|
||
(this.database as any).repo_ = null; | ||
(this.database as any).root_ = null; | ||
this.database.INTERNAL = null; | ||
this.database = null; | ||
return Promise.resolve(); | ||
} | ||
} |
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.
Because you are doing this in the base tsconfig, any helper fxns, across all packages, that match this flag will be required via
tslib
. As such, we need to add thetslib
dependency to all packages using this base config not just the 3 usingasync
/await
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.
You're right, done in 12c2b54. I've omitted
*-types
packages as stated in the commit message.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.
Perfect, thanks!