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

Fix react-sound playStatus #40592

Merged
merged 1 commit into from
Nov 27, 2019
Merged

Fix react-sound playStatus #40592

merged 1 commit into from
Nov 27, 2019

Conversation

PaitoAnderson
Copy link
Contributor

Please fill in this template.

Fixes leoasis/react-sound#86

  • 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/leoasis/react-sound#props
  • 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.
  • 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
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 #40592 diff
Batch compilation
Memory usage (MiB) 112.9 113.8 +0.9%
Type count 22149 22148 0%
Assignability cache size 53079 53079 0%
Language service
Samples taken 44 39 -11%
Identifiers in tests 44 39 -11%
getCompletionsAtPosition
    Mean duration (ms) 604.3 620.8 +2.7%
    Mean CV 9.2% 10.5%
    Worst duration (ms) 726.3 785.0 +8.1%
    Worst identifier callbackFn playStatus
getQuickInfoAtPosition
    Mean duration (ms) 604.7 604.7 0.0%
    Mean CV 10.9% 12.1% +11.0%
    Worst duration (ms) 742.1 759.4 +2.3%
    Worst identifier onPause playStatus

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 Nov 22, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 22, 2019

@PaitoAnderson Thank you for submitting this PR!

🔔 @koss-lebedev - 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.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@koss-lebedev
Copy link
Contributor

hi @PaitoAnderson , what is the benefit of this approach over using an enum? The enum is exported, so you can safely import PlayStatus and use its values

@PaitoAnderson
Copy link
Contributor Author

While the typing works, I got a runtime error of Uncaught TypeError: Cannot read property 'Playing' of undefined.

import ReactSound, { PlayStatus } from 'react-sound';
<ReactSound url="/sounds/sample.mp3" playStatus={PlayStatus.Playing} />

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Nov 27, 2019
@typescript-bot
Copy link
Contributor

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

@amcasey
Copy link
Contributor

amcasey commented Nov 27, 2019

@koss-lebedev if the enum declaration in the typings doesn't reflect an export of the underlying code (which it appears not to), it won't work at runtime (when the typings aren't available).

@amcasey amcasey merged commit 5028419 into DefinitelyTyped:master Nov 27, 2019
@typescript-bot
Copy link
Contributor

@PaitoAnderson Thank you for submitting this PR!

Code Reviews

Because this PR edits the configuration file, it can be merged once it's reviewed by a DT maintainer.

🔔 @koss-lebedev - 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.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Only a DT maintainer can merge 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",
  "pr_number": 40592,
  "author": "PaitoAnderson",
  "owners": [
    "koss-lebedev",
    "PaitoAnderson"
  ],
  "dangerLevel": "ScopedAndConfiguration",
  "headCommitAbbrOid": "761cd68",
  "headCommitOid": "761cd68cf4ca6b20839c13fd0350eb53a11385b3",
  "mergeIsRequested": false,
  "stalenessInDays": null,
  "lastCommitDate": "1970-01-01T00:00:00.000Z",
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/40592/files",
  "hasMergeConflict": false,
  "authorIsOwner": true,
  "isFirstContribution": false,
  "popularityLevel": "Well-liked by everyone",
  "anyPackageIsNew": false,
  "packages": [
    "react-sound"
  ],
  "files": [
    {
      "filePath": "types/react-sound/index.d.ts",
      "kind": "definition",
      "package": "react-sound"
    },
    {
      "filePath": "types/react-sound/react-sound-tests.tsx",
      "kind": "package-meta",
      "package": "react-sound"
    }
  ],
  "otherApprovalCount": 0,
  "ownerApprovalCount": 0,
  "maintainerApprovalCount": 1,
  "hasDismissedReview": false,
  "travisResult": "pass",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 4,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Contributor

@PaitoAnderson 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 with the exact text

Ready to merge

and I'll merge it the next time I look at this PR.

@typescript-bot typescript-bot added Maintainer Approved Author is Owner The author of this PR is a listed owner of the package. and removed Unmerged The author did not merge the PR when it was ready. labels Apr 28, 2020
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. Maintainer Approved Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Status Typing
4 participants