-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🏗 ♻️ Fix type errors in /build-system/tasks/e2e #33166
Conversation
4e788a0
to
b2d0ac1
Compare
Hey @estherkim! These files were changed:
|
b8aef5f
to
66087f5
Compare
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.
Getting closer to zero errors! LGTM with a few more comments. Okay to merge after they are addressed and CI is green.
Browser, // eslint-disable-line no-unused-vars | ||
JSHandle, // eslint-disable-line no-unused-vars | ||
Page, // eslint-disable-line no-unused-vars | ||
ElementHandle: PuppeteerHandle, // eslint-disable-line no-unused-vars |
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.
Is there a way to avoid these?
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.
I could condense them, or else I could try to do some dynamic typing or just drop type enforcement. I'll update this PR soon with all these condensed to just puppeteer
.
* @param {function(CONDITION, function(VALUE): ?DERIVED): Promise<RES>} wait | ||
* @param {function(VALUE): MUTANT} mutate | ||
* @return {function(CONDITION, function(MUTANT): ?DERIVED): Promise<RES>} | ||
* @template CONDITION | ||
* @template MUTANT | ||
* @template DERIVED | ||
* @template VALUE | ||
* @template RES | ||
*/ | ||
function wrapWait(wait, mutate) { | ||
return (condition, opt_mutate) => { | ||
opt_mutate = opt_mutate || ((x) => x); | ||
opt_mutate = opt_mutate || ((x) => /** @type {*} */ (x)); | ||
return wait(condition, (value) => opt_mutate(mutate(value))); | ||
}; | ||
} |
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 was a heck of a puzzle. More than open to changing type names etc...
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.
Go for it!
* fix errors in /tasts/e2e * update typing in puppeteer-controller * solve controller-promise typing puzzle
* fix errors in /tasts/e2e * update typing in puppeteer-controller * solve controller-promise typing puzzle
/build-system/tasks/e2e is directory which contains the largest number of type errors of any of build-system tasks. This PR is intended to be non functional and should resolve all simple type errors within the subdirectory. After this lands there will still be a handful of non trivial errors requiring functional changes that will be fixed as part of another PR.
#28387