Skip to content

[@types/underscore] Collection and Array Tests - Iteratee Cleanup#46634

Merged
typescript-bot merged 6 commits intoDefinitelyTyped:masterfrom
reubenrybnik:underscore-tests-iteratee-cleanup
Aug 11, 2020
Merged

[@types/underscore] Collection and Array Tests - Iteratee Cleanup#46634
typescript-bot merged 6 commits intoDefinitelyTyped:masterfrom
reubenrybnik:underscore-tests-iteratee-cleanup

Conversation

@reubenrybnik
Copy link
Copy Markdown
Contributor

@reubenrybnik reubenrybnik commented Aug 9, 2020

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

  • Replaces _ChainIteratee with Iteratee now that wrapped return types have been updated to return collection types where appropriate.
  • Makes it so the CollectionIterator key and collection parameters for sortedIndex include undefined as a possibility for when it is called to transform the value argument.
  • Updates iteratee type comments in tests to better match Underscore nomenclature.
  • Changes the default wrapped value for _Chain from T to T[] to better match what it used to be to reduce errors from functions that haven't been updated to use a correct wrapped value yet (e.g. array proxy functions). This also allows the simplification of many _Chain type references.

…have been updated to return collection types where appropriate.
… sortedIndex include undefined as a possibility for when it is called to transform the value argument.
…t but that I don't have a better solution for.
…what it used to be to reduce errors from functions that haven't been updated to use a correct wrapped value yet (e.g. array proxy functions).
@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 9, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Aug 9, 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": 46634,
  "author": "reubenrybnik",
  "owners": [
    "borisyankov",
    "jbaldwin",
    "ccurrens",
    "confususs",
    "jgonggrijp",
    "ffflorian",
    "regevbr",
    "peterblazejewicz",
    "reubenrybnik"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "3be612c",
  "headCommitOid": "3be612c0e680cbb07e35b022fd292db45507f54f",
  "mergeIsRequested": true,
  "stalenessInDays": 0,
  "lastPushDate": "2020-08-09T18:08:27.000Z",
  "lastCommentDate": "2020-08-11T20:38:29.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46634/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-11T19:58:22.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 #46634 diff
Batch compilation
Memory usage (MiB) 63.0 66.1 +4.9%
Type count 14021 14243 +2%
Assignability cache size 1662 1729 +4%
Language service
Samples taken 8068 8076 0%
Identifiers in tests 8068 8076 0%
getCompletionsAtPosition
    Mean duration (ms) 163.2 163.1 -0.1%
    Mean CV 8.7% 8.5%
    Worst duration (ms) 305.3 324.8 +6.4%
    Worst identifier resultUnionPartialMemoIterator mixedTypeRecordValueIterator
getQuickInfoAtPosition
    Mean duration (ms) 159.8 159.6 -0.1%
    Mean CV 9.2% 9.0% -2.0%
    Worst duration (ms) 338.0 345.8 +2.3%
    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 9, 2020
…as also what was historically assumed there by iterators if nothing else.
@typescript-bot
Copy link
Copy Markdown
Contributor

Updated numbers for you here from 5a9a5c7.

Comparison details 📊
master #46634 diff
Batch compilation
Memory usage (MiB) 63.2 66.8 +5.6%
Type count 14021 14243 +2%
Assignability cache size 1662 1729 +4%
Language service
Samples taken 8068 8076 0%
Identifiers in tests 8068 8076 0%
getCompletionsAtPosition
    Mean duration (ms) 201.4 203.1 +0.9%
    Mean CV 6.7% 6.8%
    Worst duration (ms) 366.2 436.8 +19.3%
    Worst identifier _ _
getQuickInfoAtPosition
    Mean duration (ms) 196.3 198.2 +1.0%
    Mean CV 6.8% 6.9% +1.6%
    Worst duration (ms) 403.1 491.2 +21.9% 🔸
    Worst identifier extractChainTypes extractChainTypes

Looks like there were a couple significant differences—take a look at worst-case duration for getting quick info at a position to make sure everything looks ok.

@typescript-bot typescript-bot added Perf: Worse typescript-bot determined that this PR has a negative impact on compilation performance. and removed Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. labels Aug 9, 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.

I have some comments, but overall it looks OK to me.

@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 and removed Self Merge This PR can now be self-merged by the PR author or an owner Owner Approved A listed owner of this package signed off on the pull request. labels Aug 10, 2020
@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 11, 2020
@reubenrybnik
Copy link
Copy Markdown
Contributor Author

Ready to merge

@typescript-bot typescript-bot merged commit 5ed5e96 into DefinitelyTyped:master Aug 11, 2020
chivesrs pushed a commit to chivesrs/DefinitelyTyped that referenced this pull request Sep 2, 2020
…rray Tests - Iteratee Cleanup by @reubenrybnik

* Replacing _ChainIteratee with Iteratee now that wrapped return types have been updated to return collection types where appropriate.

* Making it so the CollectionIterator key and collection parameters for sortedIndex include undefined as a possibility for when it is called to transform the value argument.

* Updating iteratee type comments in tests to better match Underscore nomenclature.

* Updating a test to reflect a compromise that I'm not super happy about but that I don't have a better solution for.

* Changing the default wrapped value for _Chain to T[] to better match what it used to be to reduce errors from functions that haven't been updated to use a correct wrapped value yet (e.g. array proxy functions).

* Also updating the default V for Underscore <T, V> to T[] since that was also what was historically assumed there by iterators if nothing else.
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
…rray Tests - Iteratee Cleanup by @reubenrybnik

* Replacing _ChainIteratee with Iteratee now that wrapped return types have been updated to return collection types where appropriate.

* Making it so the CollectionIterator key and collection parameters for sortedIndex include undefined as a possibility for when it is called to transform the value argument.

* Updating iteratee type comments in tests to better match Underscore nomenclature.

* Updating a test to reflect a compromise that I'm not super happy about but that I don't have a better solution for.

* Changing the default wrapped value for _Chain to T[] to better match what it used to be to reduce errors from functions that haven't been updated to use a correct wrapped value yet (e.g. array proxy functions).

* Also updating the default V for Underscore <T, V> to T[] since that was also what was historically assumed there by iterators if nothing else.
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: Worse typescript-bot determined that this PR has a negative impact on 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.

3 participants