Skip to content

[@types/underscore] Collection and Array Tests - Shortening Cleanup#46799

Merged
typescript-bot merged 4 commits intoDefinitelyTyped:masterfrom
reubenrybnik:underscore-tests-shortening-cleanup
Aug 17, 2020
Merged

[@types/underscore] Collection and Array Tests - Shortening Cleanup#46799
typescript-bot merged 4 commits intoDefinitelyTyped:masterfrom
reubenrybnik:underscore-tests-shortening-cleanup

Conversation

@reubenrybnik
Copy link
Copy Markdown
Contributor

@reubenrybnik reubenrybnik commented Aug 15, 2020

This is the second of three planned cleanup PRs for #45201 and includes the following changes:

  • Shortens most touched lines in index.d.ts to 80 characters or less.
  • Removes a few redundant value types in _Chain that the linter and I missed.
  • Shortens test variable names.
  • Moves test variables to the top of the file so they can be reused outside of combinatorial tests and adds more prominent headers to test groups.
  • Updates all common test variables to declare const.
  • Removes a few variables declared within the scopes of specific functions and replaces them with references to common variables.
  • Makes a few minor updates to summary comment text.

No logic changes are made in this PR. IntersectingMixedTypeRecord is consolidated with MixedTypeRecord, and StringRecordOrUndefined is dropped in favor of using StringRecord | undefined.

As an additional item of cleanup, I'm going to claim that this fixes #7931 even though #45304 is actually what fixed it since I'd like to close that issue and I didn't know about the effect that the word "fix" has back when I was doing that PR.

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Author is Owner The author of this PR is a listed owner of the package. labels Aug 15, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Aug 15, 2020

@reubenrybnik Thank you for submitting this PR!

This is a live comment which I will keep updated.

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

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": 46799,
  "author": "reubenrybnik",
  "owners": [
    "borisyankov",
    "jbaldwin",
    "ccurrens",
    "confususs",
    "jgonggrijp",
    "ffflorian",
    "regevbr",
    "peterblazejewicz",
    "reubenrybnik"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "5baece9",
  "headCommitOid": "5baece9b1cea7decbeb8637f800d2a68135f47c9",
  "mergeIsRequested": true,
  "stalenessInDays": 0,
  "lastPushDate": "2020-08-15T02:53:22.000Z",
  "lastCommentDate": "2020-08-17T21:32:53.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46799/files",
  "hasMergeConflict": false,
  "authorIsOwner": true,
  "isFirstContribution": false,
  "popularityLevel": "Popular",
  "anyPackageIsNew": false,
  "packages": [
    "underscore"
  ],
  "files": [
    {
      "path": "types/underscore/index.d.ts",
      "kind": "definition",
      "package": "underscore"
    },
    {
      "path": "types/underscore/underscore-tests.ts",
      "kind": "test",
      "package": "underscore"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-08-17T19:46:37.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 2,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @borisyankov @jbaldwin @ccurrens @confususs @jgonggrijp @ffflorian @regevbr @peterblazejewicz — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot
Copy link
Copy Markdown
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #46799 diff
Batch compilation
Memory usage (MiB) 60.7 69.2 +14.0%
Type count 14532 14711 +1%
Assignability cache size 1782 1754 -2%
Language service
Samples taken 8425 8350 -1%
Identifiers in tests 8425 8350 -1%
getCompletionsAtPosition
    Mean duration (ms) 205.8 200.7 -2.5%
    Mean CV 6.7% 6.9%
    Worst duration (ms) 420.9 449.7 +6.9%
    Worst identifier _ _
getQuickInfoAtPosition
    Mean duration (ms) 201.1 196.5 -2.3%
    Mean CV 6.9% 7.1% +3.9%
    Worst duration (ms) 534.8 470.6 -12.0%
    Worst identifier extractChainTypes extractChainTypes

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Aug 15, 2020
Copy link
Copy Markdown
Contributor

@jgonggrijp jgonggrijp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very thorough job, all smooth. I'm very happy with the shorter lines and names. Great work, Mike!

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Aug 17, 2020
@reubenrybnik
Copy link
Copy Markdown
Contributor Author

Thanks @jgonggrijp, glad you're happy with the result here! Thanks for looking over this admittedly somewhat daunting-looking set of changes 😅

@reubenrybnik
Copy link
Copy Markdown
Contributor Author

Ready to merge

@typescript-bot typescript-bot merged commit 6fd37a5 into DefinitelyTyped:master Aug 17, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

I just published @types/underscore@1.10.22 to npm.

chivesrs pushed a commit to chivesrs/DefinitelyTyped that referenced this pull request Sep 2, 2020
…rray Tests - Shortening Cleanup by @reubenrybnik

* Shortening test type and variable names and reorganizing tests.

* Updating section headers to be uniform.

* Cleaning up summary comments and a few unnecessary _Chain values not caught by linting and making all lines for changed functions 80 characters long or less.

* Using a constant tuple instead of a generic array for deepProperty.
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
…rray Tests - Shortening Cleanup by @reubenrybnik

* Shortening test type and variable names and reorganizing tests.

* Updating section headers to be uniform.

* Cleaning up summary comments and a few unnecessary _Chain values not caught by linting and making all lines for changed functions 80 characters long or less.

* Using a constant tuple instead of a generic array for deepProperty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author is Owner The author of this PR is a listed owner of the package. Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Underscore: chained reduce returns wrong type

3 participants