Skip to content
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

[@types/bl] update bl types to v5 #52236

Merged
merged 12 commits into from Apr 9, 2021

Conversation

achingbrain
Copy link
Contributor

@achingbrain achingbrain commented Apr 7, 2021

The bl module has a file called BufferList.js that exports a class BufferList that is just the buffer list without node streams, the idea being you can use it in the browser without having to pull in a readable streams implementation, which has become more necessary since webpack 5 stopped bundling shims for node internals.

The main bl.js file exports BufferListStream that extends both the BufferList and the node Duplex stream.

I've attempted to represent the BufferList.js class here.

TS doesn't have multiple inheritance so I'm not sure how to represent the BufferListStream class without duplicating the methods of BufferList.

If changing an existing definition:

  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.

@typescript-bot typescript-bot added Edits Owners This PR adds or removes owners Popular package This PR affects a popular package (as counted by NPM download counts). Check Config Changes a module config files labels Apr 7, 2021
@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 7, 2021

@achingbrain Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

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": 52236,
  "author": "achingbrain",
  "headCommitOid": "da6f9c144f8baa730c5565e92f113de38cbeff86",
  "lastPushDate": "2021-04-09T13:01:52.000Z",
  "lastActivityDate": "2021-04-09T17:08:51.000Z",
  "maintainerBlessed": false,
  "mergeOfferDate": "2021-04-09T15:46:24.000Z",
  "mergeRequestDate": "2021-04-09T17:08:51.000Z",
  "mergeRequestUser": "achingbrain",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "bl",
      "kind": "edit",
      "files": [
        {
          "path": "types/bl/BufferList.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/bl/bl-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/bl/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "Bartvds",
        "reconbot",
        "benallfree"
      ],
      "addedOwners": [
        "achingbrain"
      ],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "benallfree",
      "date": "2021-04-09T15:45:50.000Z",
      "isMaintainer": false
    },
    {
      "type": "stale",
      "reviewer": "amcasey",
      "date": "2021-04-08T22:09:21.000Z",
      "abbrOid": "ed63713"
    }
  ],
  "ciResult": "pass"
}

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Apr 7, 2021
@typescript-bot
Copy link
Contributor

🔔 @Bartvds @reconbot @benallfree — 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.

@achingbrain
Copy link
Contributor Author

cc @rvagg maybe these could live the in bl module when the dust settles?

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 7, 2021
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Apr 7, 2021
@typescript-bot
Copy link
Contributor

@achingbrain The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

The bl module has a file called `BufferList.js` that is the buffer list
without node streams, the idea being you can use it in the browser without
having to pull in a readable streams implementation, which has become more
necessary since webpack 5 stopped bundling shims for node internals.

The main `bl.js` exports a class that extends both the buffer list and
the node Duplex stream.  It also has named exports for `BufferListStream`
(the same as the default export) and `BufferList` (the same as the class
from `BufferList.js`).

I've attempted to represent them here.  TS doesn't have multiple inheritance
so I'm not sure how to represent the `BufferListStream` class without
duplicating the methods of `BufferList`.
@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Apr 7, 2021
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Apr 7, 2021
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 7, 2021
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Apr 7, 2021
@typescript-bot
Copy link
Contributor

@achingbrain The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Apr 7, 2021
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Apr 7, 2021
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 7, 2021
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Apr 7, 2021
@typescript-bot
Copy link
Contributor

@achingbrain The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Apr 7, 2021
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Apr 7, 2021
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 7, 2021
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Apr 7, 2021
@typescript-bot
Copy link
Contributor

@achingbrain The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Apr 9, 2021
@typescript-bot
Copy link
Contributor

@achingbrain One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label Apr 9, 2021
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Apr 9, 2021
@typescript-bot
Copy link
Contributor

@benallfree, @amcasey Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@achingbrain
Copy link
Contributor Author

did you want to incorporate my PR that simplifies the BufferListStream typings?

I'm just trying the changes out on a few projects. I'd made a similar change initially but it didn't work out, though that may have just been user error..

@typescript-bot
Copy link
Contributor

Updated numbers for you here from ea060e8.

These typings are for a version of bl that doesn’t yet exist on master, so I’ve compared them with v4.1.

Comparison details 📊
4.1@master 5.0 in #52236 diff
Batch compilation
Memory usage (MiB) 74.2 73.0 -1.7%
Type count 8570 9285 +8%
Assignability cache size 920 1460 +59%
Language service
Samples taken 221 273 +24%
Identifiers in tests 221 273 +24%
getCompletionsAtPosition
    Mean duration (ms) 353.2 378.6 +7.2%
    Mean CV 9.8% 9.9%
    Worst duration (ms) 430.0 530.2 +23.3% 🔸
    Worst identifier str bls
getQuickInfoAtPosition
    Mean duration (ms) 350.1 380.8 +8.8%
    Mean CV 9.7% 8.6%
    Worst duration (ms) 421.6 478.9 +13.6%
    Worst identifier bl bls

Looks like there were a couple significant differences—take a look at worst-case duration for getting completions 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 Apr 9, 2021
@achingbrain
Copy link
Contributor Author

@benallfree I've applied your changes, they look good - thanks for the suggestions!

@typescript-bot
Copy link
Contributor

Updated numbers for you here from 7b403d2. Nice job, these numbers look better.

These typings are for a version of bl that doesn’t yet exist on master, so I’ve compared them with v4.1.

Comparison details 📊
4.1@master 5.0 in #52236 diff
Batch compilation
Memory usage (MiB) 73.6 69.6 -5.4%
Type count 8570 9260 +8%
Assignability cache size 920 1420 +54%
Language service
Samples taken 221 288 +30%
Identifiers in tests 221 288 +30%
getCompletionsAtPosition
    Mean duration (ms) 354.3 379.3 +7.0%
    Mean CV 9.9% 9.7%
    Worst duration (ms) 460.3 474.4 +3.1%
    Worst identifier num readUInt32LE
getQuickInfoAtPosition
    Mean duration (ms) 351.9 381.8 +8.5%
    Mean CV 9.4% 8.9%
    Worst duration (ms) 427.6 477.1 +11.6%
    Worst identifier offset toString

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

@typescript-bot typescript-bot added Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. and removed Perf: Worse typescript-bot determined that this PR has a negative impact on compilation performance. labels Apr 9, 2021
Copy link
Contributor

@benallfree benallfree left a comment

Choose a reason for hiding this comment

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

@achingbrain Thank you for all this awesome work! Looks good for sure now.

@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 Apr 9, 2021
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in New Pull Request Status Board Apr 9, 2021
@typescript-bot
Copy link
Contributor

@amcasey Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@achingbrain
Copy link
Contributor Author

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Apr 9, 2021
@typescript-bot typescript-bot merged commit 05bd273 into DefinitelyTyped:master Apr 9, 2021
@achingbrain
Copy link
Contributor Author

Ah @amcasey I may have jumped the gun a little - given #52236 (comment) are you happy with the lack of a v4 folder?

@amcasey
Copy link
Contributor

amcasey commented Apr 9, 2021

@achingbrain It's fine - it can be added on-demand later.

@typescript-bot
Copy link
Contributor

I just published @types/bl@5.0.0 to npm.

@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Edits Owners This PR adds or removes owners 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.

None yet

5 participants