-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
[greasemonkey]: add generics to GM.getValue(string)
overload to avoid breaking change at 4.0.4
#62262
Conversation
@trim21 Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 11 days — please try to get reviewers! Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 62262,
"author": "trim21",
"headCommitOid": "2d91790c03f056d9b1b4626d3e7e73c84cdf7b8d",
"mergeBaseOid": "fcf20cf13fc35b699d9e5be2bc9c91bcc13f7952",
"lastPushDate": "2022-09-14T20:26:39.000Z",
"lastActivityDate": "2022-09-26T06:32:07.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "greasemonkey",
"kind": "edit",
"files": [
{
"path": "types/greasemonkey/greasemonkey-tests.ts",
"kind": "test"
},
{
"path": "types/greasemonkey/index.d.ts",
"kind": "definition"
}
],
"owners": [
"kotas",
"nikolay-borzov"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [],
"mainBotCommentID": 1247246566,
"ciResult": "pass"
} |
🔔 @kotas @nikolay-borzov — please review this PR in the next few days. Be sure to explicitly select |
@trim21 The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
GM.getValue
without default value callingGM.getValue
without default value calling to avoid breaking change at 4.0.4
GM.getValue
without default value calling to avoid breaking change at 4.0.4GM.getValue(string)
overload to avoid breaking change at 4.0.4
Sorry for bringing breaking changes. But what's stopping you from updating you code? |
Nothing, this PR just prevent breaking change. And in fact, the other overload |
Re-ping @kotas, @nikolay-borzov: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
I fail to understand why this PR exists providing:
|
Please fill in this template.
npm test <package to test>
.Select one of these and delete the others:
If changing an existing definition:
Neither, this fix a breaking change added at 4.0.4
previous PR #61907 says due to
no-unnecessary-generics
rule thatGM.getValue
without default value should beGM.getValue(name: string): Promise<GM.Value | undefined>
, but this will break old working code:it raise
Type 'Value | undefined' is not assignable to type 'Type | undefined'. Type 'string' is not assignable to type 'Type | undefined'.
or
raise
error TS2554: Expected 2 arguments, but got 1.
User can call it like
GM.getValue(key) as Type | undefined
but it still a breaking change when upgrading@types/greasemonkey
from 4.0.3 to 4.0.4.