Skip to content

refactor(node): Move Buffer definition to buffer.d.ts#45845

Merged
weswigham merged 1 commit intoDefinitelyTyped:masterfrom
ExE-Boss:types/node/buffer/move-from-globals
Jul 6, 2020
Merged

refactor(node): Move Buffer definition to buffer.d.ts#45845
weswigham merged 1 commit intoDefinitelyTyped:masterfrom
ExE-Boss:types/node/buffer/move-from-globals

Conversation

@ExE-Boss
Copy link
Copy Markdown
Contributor

@ExE-Boss ExE-Boss commented Jul 2, 2020

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: chore(node): declutter NodeJS namespace #44814 (comment)
  • 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.
  • Include tests for your changes
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

@typescript-bot typescript-bot added Where is GH Actions? GH Actions didn't give a response to this PR Critical package Author is Owner The author of this PR is a listed owner of the package. Untested Change This PR does not touch tests labels Jul 2, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jul 2, 2020

@ExE-Boss Thank you for submitting this PR!

This is a live comment which I will keep updated.

This PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Have you considered adding tests to cover the change you're making? Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you.

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ❌ Only a DT maintainer can approve changes without tests

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 45845,
  "author": "ExE-Boss",
  "owners": [
    "Microsoft",
    "DefinitelyTyped",
    "jkomyno",
    "a-tarasyuk",
    "alvis",
    "r3nya",
    "btoueg",
    "brunoscheufler",
    "smac89",
    "touffy",
    "DeividasBakanas",
    "eyqs",
    "Flarna",
    "Hannes-Magnusson-CK",
    "KSXGitHub",
    "hoo29",
    "kjin",
    "ajafff",
    "islishude",
    "mwiktorczyk",
    "mohsen1",
    "n-e",
    "octo-sniffle",
    "galkin",
    "parambirs",
    "eps1lon",
    "SimonSchick",
    "ThomasdenH",
    "WilcoBakker",
    "wwwy3y3",
    "samuela",
    "kuehlein",
    "j-oliveras",
    "bhongy",
    "chyzwar",
    "trivikr",
    "nguymin4",
    "yoursunny",
    "qwelias",
    "ExE-Boss",
    "Ryan-Willpower",
    "peterblazejewicz",
    "addaleax",
    "JasonHK"
  ],
  "dangerLevel": "ScopedAndUntested",
  "headCommitAbbrOid": "5e1cafd",
  "headCommitOid": "5e1cafd86505aa420ee2eaaaa8e75e25fac80592",
  "mergeIsRequested": false,
  "stalenessInDays": 3,
  "lastCommitDate": "2020-07-02T15:12:04.000Z",
  "lastCommentDate": "2020-07-02T15:12:04.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/45845/files",
  "hasMergeConflict": false,
  "authorIsOwner": true,
  "isFirstContribution": false,
  "popularityLevel": "Critical",
  "anyPackageIsNew": false,
  "packages": [
    "node"
  ],
  "files": [
    {
      "filePath": "types/node/buffer.d.ts",
      "kind": "definition",
      "package": "node"
    },
    {
      "filePath": "types/node/globals.d.ts",
      "kind": "definition",
      "package": "node"
    },
    {
      "filePath": "types/node/ts3.2/base.d.ts",
      "kind": "definition",
      "package": "node"
    },
    {
      "filePath": "types/node/ts3.2/buffer.d.ts",
      "kind": "definition",
      "package": "node"
    },
    {
      "filePath": "types/node/ts3.2/globals.d.ts",
      "kind": "definition",
      "package": "node"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 0,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Copy Markdown
Contributor

@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 #45845 diff
Batch compilation
Memory usage (MiB) 100.8 99.6 -1.2%
Type count 16923 16923 0%
Assignability cache size 4994 4994 0%
Language service
Samples taken 46 46 0%
Identifiers in tests 46 46 0%
getCompletionsAtPosition
    Mean duration (ms) 578.4 604.8 +4.6%
    Mean CV 12.9% 12.0%
    Worst duration (ms) 758.2 752.8 -0.7%
    Worst identifier assert a
getQuickInfoAtPosition
    Mean duration (ms) 567.6 597.8 +5.3%
    Mean CV 12.2% 12.1% -0.1%
    Worst duration (ms) 745.0 714.7 -4.1%
    Worst identifier assert a

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 Where is GH Actions? GH Actions didn't give a response to this PR labels Jul 2, 2020
@weswigham weswigham merged commit a58ce42 into DefinitelyTyped:master Jul 6, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

I just published @types/node@14.0.16 to npm.

@ExE-Boss ExE-Boss deleted the types/node/buffer/move-from-globals branch July 6, 2020 22:22
jablko added a commit to jablko/DefinitelyTyped that referenced this pull request Jul 6, 2020
jablko added a commit to jablko/DefinitelyTyped that referenced this pull request Jul 7, 2020
jablko added a commit to jablko/DefinitelyTyped that referenced this pull request Jul 7, 2020
sandersn added a commit that referenced this pull request Jul 8, 2020
@sandersn
Copy link
Copy Markdown
Contributor

sandersn commented Jul 8, 2020

This breaks pouchdb-core and its dependents, which weren't tested due to a bug in DefinitelyTyped-tools. I'm going to revert this for now.

@sandersn
Copy link
Copy Markdown
Contributor

sandersn commented Jul 8, 2020

Looks like a workaround that should work, doesn't because of a bug in the compiler: microsoft/TypeScript#39504

Change export { Buffer } to:

import B = globalThis.buffer
export { B as Buffer }

sandersn added a commit that referenced this pull request Jul 8, 2020
#45956)

* Revert "refactor(node): Move `Buffer` definition to `buffer.d.ts` (#45845)"

This reverts commit a58ce42.

* put back reference to globals.d.ts in ts3.2
ngbrown pushed a commit to ngbrown-forks/DefinitelyTyped that referenced this pull request Jul 11, 2020
ngbrown pushed a commit to ngbrown-forks/DefinitelyTyped that referenced this pull request Jul 11, 2020
…finitelyTyped#4… (DefinitelyTyped#45956)

* Revert "refactor(node): Move `Buffer` definition to `buffer.d.ts` (DefinitelyTyped#45845)"

This reverts commit a58ce42.

* put back reference to globals.d.ts in ts3.2
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
…finitelyTyped#4… (DefinitelyTyped#45956)

* Revert "refactor(node): Move `Buffer` definition to `buffer.d.ts` (DefinitelyTyped#45845)"

This reverts commit a58ce42.

* put back reference to globals.d.ts in ts3.2
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. Critical package Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Untested Change This PR does not touch tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants