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

Upgrade types for uuid@8.3.0 #46395

Merged
merged 3 commits into from Aug 12, 2020

Conversation

ctavan
Copy link
Contributor

@ctavan ctavan commented Jul 28, 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).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/uuidjs/uuid#api-summary
  • 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.

Closes #46477.

@typescript-bot typescript-bot added Critical package Author is Owner The author of this PR is a listed owner of the package. labels Jul 28, 2020
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Jul 28, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Jul 28, 2020

@ctavan Thank you for submitting this PR!

This is a live comment which I will keep updated.

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
  • ✅ Most recent commit is approved by 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": 46395,
  "author": "ctavan",
  "owners": [
    "iamolivinius",
    "felipeochoa",
    "cjbarth",
    "LinusU",
    "ctavan"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "d044ae5",
  "headCommitOid": "d044ae595df707da86d75a05ce3555a42df61e28",
  "mergeIsRequested": true,
  "stalenessInDays": 0,
  "lastPushDate": "2020-08-07T07:26:35.000Z",
  "lastCommentDate": "2020-08-12T05:51:56.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46395/files",
  "hasMergeConflict": false,
  "authorIsOwner": true,
  "isFirstContribution": false,
  "popularityLevel": "Critical",
  "anyPackageIsNew": false,
  "packages": [
    "uuid"
  ],
  "files": [
    {
      "path": "types/uuid/index.d.ts",
      "kind": "definition",
      "package": "uuid"
    },
    {
      "path": "types/uuid/interfaces.d.ts",
      "kind": "definition",
      "package": "uuid"
    },
    {
      "path": "types/uuid/uuid-tests.ts",
      "kind": "test",
      "package": "uuid"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-08-11T23:07:58.000Z",
  "reviewersWithStaleReviews": [
    {
      "reviewedAbbrOid": "cd9f7a1",
      "reviewer": "rbuckton",
      "date": "2020-08-05T19:04:33Z"
    },
    {
      "reviewedAbbrOid": "d87e8c8",
      "reviewer": "RyanCavanaugh",
      "date": "2020-07-28T15:48:09Z"
    }
  ],
  "approvalFlags": 4,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Contributor

🔔 @iamolivinius @felipeochoa @cjbarth @LinusU — 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 typescript-bot added the The CI failed When GH Actions fails label Jul 28, 2020
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Jul 28, 2020
@typescript-bot
Copy link
Contributor

@ctavan 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 Jul 28, 2020
@typescript-bot typescript-bot moved this from Needs Author Action to Needs Maintainer Review in New Pull Request Status Board Jul 28, 2020
@typescript-bot
Copy link
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 #46395 diff
Batch compilation
Memory usage (MiB) 62.4 65.0 +4.0%
Type count 9022 9037 0%
Assignability cache size 1649 1649 0%
Language service
Samples taken 122 172 +41%
Identifiers in tests 122 172 +41%
getCompletionsAtPosition
    Mean duration (ms) 298.9 299.0 0.0%
    Mean CV 10.7% 9.5%
    Worst duration (ms) 355.1 386.9 +9.0%
    Worst identifier Buffer e3
getQuickInfoAtPosition
    Mean duration (ms) 300.2 299.0 -0.4%
    Mean CV 10.7% 10.4% -2.6%
    Worst duration (ms) 373.2 379.1 +1.6%
    Worst identifier randoms node

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 Jul 28, 2020

export type NIL = string;

export enum Version {
Copy link
Member

Choose a reason for hiding this comment

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

This object doesn't exist at runtime; it should not be an enum. It'd actually be nice to remove this file entirely and fold it into the parent file, since there's no uuid/interfaces module

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, you are right about both, the enum and inlining the interface definitions (I inherited that structure and – being rather new to TypeScript typings – never questioned it).

If I inline uuid/interfaces how do I go about only exporting the named exports that are actually exported by the uuid module? I'm getting

All declarations in this module are exported automatically. Prefer to explicitly write 'export' for clarity. If you have a good reason not to export this declaration, add 'export {}' to the module to shut off automatic exporting.

errors if I don't export all types. I've seen https://stackoverflow.com/a/51970377/1053532 but what is preferred in DefinitelyTyped? Adding export {} or declaring a namespace?

Pointing me to a module where this is done correctly would be enough, I can then make the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RyanCavanaugh friendly ping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW I went for the export {} route.

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Jul 28, 2020
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Needs Author Action in New Pull Request Status Board Jul 28, 2020
@typescript-bot
Copy link
Contributor

@ctavan 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 or comments. If you disagree with the reviewer's comments, you can "dismiss" the review using GitHub's review UI. Thank you!

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

@RyanCavanaugh 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?

@ctavan
Copy link
Contributor Author

ctavan commented Jul 31, 2020

I have inlined the type definitions into index.d.ts and removed interfaces.d.ts as suggested in the review. I've also removed the Version enum.

It would be great to prefer this PR over #46477 since the other PR contains some subtle differences with respect to return types that are not in line with how the authors of uuid define the API.

@ctavan
Copy link
Contributor Author

ctavan commented Aug 5, 2020

Just resolved merge conflicts that were introduced due to #46557

@ctavan
Copy link
Contributor Author

ctavan commented Aug 5, 2020

@rbuckton could you have a look at this one?

@typescript-bot typescript-bot moved this from Needs Maintainer Review to Needs Author Action in New Pull Request Status Board Aug 5, 2020
@typescript-bot
Copy link
Contributor

@ctavan 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 or comments. If you disagree with the reviewer's comments, you can "dismiss" the review using GitHub's review UI. Thank you!

@ctavan ctavan requested a review from rbuckton August 6, 2020 08:34
@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label Aug 6, 2020
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Aug 6, 2020
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Aug 6, 2020
@typescript-bot
Copy link
Contributor

@rbuckton, @RyanCavanaugh 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?

@ctavan
Copy link
Contributor Author

ctavan commented Aug 6, 2020

CI failure seems unrelated to this changeset.

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Aug 6, 2020
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Needs Author Action in New Pull Request Status Board Aug 6, 2020
@typescript-bot
Copy link
Contributor

@ctavan 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 Aug 7, 2020
@typescript-bot typescript-bot moved this from Needs Author Action to Needs Maintainer Review in New Pull Request Status Board Aug 7, 2020
@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Aug 11, 2020
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Author to Merge in New Pull Request Status Board Aug 11, 2020
@typescript-bot
Copy link
Contributor

@ctavan Everything looks good here. Great job! I am ready to merge this PR on your behalf.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@iamolivinius, @felipeochoa, @cjbarth, @LinusU: you can do this too.)

@ctavan
Copy link
Contributor Author

ctavan commented Aug 12, 2020

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Aug 12, 2020
@typescript-bot typescript-bot merged commit 5ac9294 into DefinitelyTyped:master Aug 12, 2020
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Aug 13, 2020
chivesrs pushed a commit to chivesrs/DefinitelyTyped that referenced this pull request Sep 2, 2020


* Revert "added typing for "validate" function added in uuid release 8.3.0 (DefinitelyTyped#46557)"

This reverts commit c50f120.

* Upgrade types for uuid@8.3.0

* Export v1/v4 options
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020


* Revert "added typing for "validate" function added in uuid release 8.3.0 (DefinitelyTyped#46557)"

This reverts commit c50f120.

* Upgrade types for uuid@8.3.0

* Export v1/v4 options
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 Maintainer Approved Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. 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