Repository navigation
[gtag.js] Replace function overload with generics - #66939
Merged
Merged
Conversation
Contributor
|
@HugeLetters Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment which I will keep updated. 1 package in this PRCode ReviewsThis PR can be merged once it's reviewed by a DT maintainer. 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": 66939,
"author": "HugeLetters",
"headCommitOid": "d335d833b0344b65d6d71518fa81ca48b0b28f7b",
"mergeBaseOid": "9b0635e961b26ce033e49062b4e0d60485b1567f",
"lastPushDate": "2023-10-05T15:14:15.000Z",
"lastActivityDate": "2023-10-06T16:40:55.000Z",
"mergeOfferDate": "2023-10-06T16:40:39.000Z",
"mergeRequestDate": "2023-10-06T16:40:55.000Z",
"mergeRequestUser": "HugeLetters",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Popular",
"pkgInfo": [
{
"name": "gtag.js",
"kind": "edit",
"files": [
{
"path": "types/gtag.js/index.d.ts",
"kind": "definition"
}
],
"owners": [
"rokt33r",
"KsAkira10"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "rbuckton",
"date": "2023-10-06T16:39:55.000Z",
"isMaintainer": true
}
],
"mainBotCommentID": 1749110842,
"ciResult": "pass"
} |
Contributor
|
🔔 @Rokt33r @KsAkira10 — please review this PR in the next few days. Be sure to explicitly select |
HugeLetters
commented
Oct 5, 2023
rbuckton
approved these changes
Oct 6, 2023
Contributor
Author
|
Ready to merge |
Contributor
|
Ready to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npm test <package to test>.Changes
These changes don't change the behavior for the end-user but switching from overloads to generics brings a much nicer autocomplete as shown in the videos below. TS picks-up argument types from the correct function branch and recognizes on which branch you're from the first argument.
See microsoft/TypeScript#26892
old-overload.mov
new-generics.mov