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
jquery: Specialize .val() for elements with known value types #66801
Conversation
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
@andersk Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 66801,
"author": "andersk",
"headCommitOid": "5b98d0468e07c4134fcbbf2f0459f50990ea9e73",
"mergeBaseOid": "027ee9cdb7d69d3a06d8420341e9231e10bfaa77",
"lastPushDate": "2023-09-22T20:54:02.000Z",
"lastActivityDate": "2023-10-04T22:21:47.000Z",
"mergeOfferDate": "2023-10-04T19:27:12.000Z",
"mergeRequestDate": "2023-10-04T22:21:47.000Z",
"mergeRequestUser": "andersk",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "jquery",
"kind": "edit",
"files": [
{
"path": "types/jquery/JQuery.d.ts",
"kind": "definition"
},
{
"path": "types/jquery/test/val.ts",
"kind": "test"
},
{
"path": "types/jquery/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [
"leonard-thieu",
"borisyankov",
"choffmeister",
"Steve-Fenton",
"Diullei",
"tasoili",
"seanski",
"Guuz",
"ksummerlin",
"basarat",
"nwolverson",
"derekcicerone",
"AndrewGaspar",
"seikichi",
"benjaminjackman",
"JoshStrobl",
"johnnyreilly",
"DickvdBrink",
"King2500",
"terrymun",
"martin-badin",
"princefishthrower"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "johnnyreilly",
"date": "2023-10-04T19:26:26.000Z",
"isMaintainer": true
}
],
"mainBotCommentID": 1732022687,
"ciResult": "pass"
} |
|
🔔 @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @JoshStrobl @johnnyreilly @DickvdBrink @King2500 @terrymun @martin-badin @princefishthrower — please review this PR in the next few days. Be sure to explicitly select |
|
Re-ping @leonard-thieu, @borisyankov, @choffmeister, @Steve-Fenton, @Diullei, @tasoili, @seanski, @Guuz, @ksummerlin, @basarat, @nwolverson, @derekcicerone, @AndrewGaspar, @seikichi, @benjaminjackman, @JoshStrobl, @johnnyreilly, @DickvdBrink, @King2500, @terrymun, @martin-badin, @princefishthrower: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
|
Hey @andersk - I couldn't see an example in your tests that demonstrates the HTML Input case you mention in the description. I might just be missing it. I can see you handling the scenarios for single and multi-selected, but not the one that demonstrates the input with the expected |
|
@Steve-Fenton We never expect DefinitelyTyped/types/jquery/test/val.ts Lines 1 to 10 in 5b98d04
|
|
@andersk Yep. I missed it! Thanks for that. |
|
@johnnyreilly this looks okay to me! |
|
@andersk: Everything looks good here. I am ready to merge this PR (at 5b98d04) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@leonard-thieu, @borisyankov, @choffmeister, @Steve-Fenton, @Diullei, @tasoili, @seanski, @Guuz, @ksummerlin, @basarat, @nwolverson, @derekcicerone, @AndrewGaspar, @seikichi, @benjaminjackman, @JoshStrobl, @johnnyreilly, @DickvdBrink, @King2500, @terrymun, @martin-badin, @princefishthrower: you can do this too.) |
|
Ready to merge |
If the user explicitly provides a specific element class like
$<HTMLInputElement>("input").val(), this lets us infer the result asstring | undefinedrather thanstring | number | string[] | undefined.Please fill in this template.
npm test <package to test>.Select one of these and delete the others:
If changing an existing definition: