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

[sharp] Update typings to 0.23 #39001

Merged
merged 4 commits into from
Oct 15, 2019
Merged

[sharp] Update typings to 0.23 #39001

merged 4 commits into from
Oct 15, 2019

Conversation

fdebijl
Copy link
Contributor

@fdebijl fdebijl commented Oct 9, 2019

  • 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:
  • 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

typescript-bot commented Oct 9, 2019

@fdebijl Thank you for submitting this PR!

🔔 @lith-light-g @wooseopkim @BTOdell @JamieWoodbury - 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.

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

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

Comparison details 📊
0@master * in #39001 diff
Batch compilation
Type count 9326 9700 +4%
Assignability cache size 2938 3167 +8%
Language service
Samples taken 1775 355 -80%
Identifiers in tests 355 355 0%
getCompletionsAtPosition
    Mean duration (ms) 388.8 391.8 +0.8%
    Mean CV 12.7%
    Worst duration (ms) 507.3 490.4 -3.3%
    Worst identifier toBuffer background
getQuickInfoAtPosition
    Mean duration (ms) 420.4 403.9 -3.9%
    Mean CV 13.3%
    Worst duration (ms) 519.7 519.8 0.0%
    Worst identifier position right
System information
Node version v10.16.3
CPU count 2 2
CPU speed 2.394 GHz 2.294 GHz
CPU model Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
CPU Architecture x64 x64
Memory 6.8 GiB 6.8 GiB
Platform linux linux
Release 4.15.0-1041-azure 4.15.0-1059-azure

First off, note that the system varied slightly between these two runs, so you’ll have to take these measurements with a grain of salt.

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 Oct 9, 2019
@fdebijl
Copy link
Contributor Author

fdebijl commented Oct 10, 2019

More testing in my current project revealed that the parameters for the composite method are also outdated, Create should be a property of input when used instead of a string or Buffer. See the parameter list at https://sharp.pixelplumbing.com/en/stable/api-composite/ and https://github.com/lovell/sharp/blob/master/lib/composite.js#L72

I changed it into input?: string | Buffer | {create: Create};, but maybe that should be a separate type - someone more experienced with TS best practices will have to make that call.

A 100x100px black square being created as intended using the new typings.
A 100x100px black square being created as intended using the new typings.

@typescript-bot
Copy link
Contributor

Updated numbers for you here from ac2549a.

Comparison details 📊
master #39001 diff
Batch compilation
Memory usage (MiB) 67.8 66.9 -1.4%
Type count 9808 9815 0%
Assignability cache size 3200 3199 0%
Language service
Samples taken 355 355 0%
Identifiers in tests 355 355 0%
getCompletionsAtPosition
    Mean duration (ms) 354.4 349.2 -1.5%
    Mean CV 12.3% 12.3%
    Worst duration (ms) 452.8 471.0 +4.0%
    Worst identifier webp extend
getQuickInfoAtPosition
    Mean duration (ms) 363.3 357.3 -1.7%
    Mean CV 13.3% 13.2% -0.8%
    Worst duration (ms) 456.7 429.5 -6.0%
    Worst identifier toBuffer top

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

@typescript-bot typescript-bot moved this from Waiting for Reviewers to Review in Pull Request Status Board Oct 15, 2019
@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Oct 15, 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!

Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@andrewbranch andrewbranch merged commit a5000ae into DefinitelyTyped:master Oct 15, 2019
Pull Request Status Board automation moved this from Review to Done Oct 15, 2019
chivesrs pushed a commit to chivesrs/DefinitelyTyped that referenced this pull request Nov 19, 2019
* [sharp] Update typings to 0.23

* Move input to OverlayOptions and Create to input

* Switch array of OverlayOptions to simple type

* Fix indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Unmerged The author did not merge the PR when it was ready.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants