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

feat(puppeteer): 2.0 #40284

Merged
merged 2 commits into from
Nov 19, 2019
Merged

feat(puppeteer): 2.0 #40284

merged 2 commits into from
Nov 19, 2019

Conversation

SimonSchick
Copy link
Contributor

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/GoogleChrome/puppeteer/releases/tag/v2.0.0
  • 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.

Rinse and repeat (one last time) #40061

Changes:

  • Removed 0.x
  • Updated 1.x to 2.x in place

Rationale:

  • 0.x (unstable) is 2 years old and no longer maintained, the package will remain
  • 1.x Moved to own folder, package currently has ~250k downloads per week and will probably need minor maintenance in the future.
  • 2.x VERY few changes major release was due to dropping node v6. Used opportunity to bump to TS 3.0 and change some instances of any to unknown for improved type safety.

@typescript-bot typescript-bot added this to Needs Author Attention in Pull Request Status Board Nov 10, 2019
@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Nov 10, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 10, 2019

@SimonSchick Thank you for submitting this PR!

Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes.

In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day!

@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 10, 2019

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

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

@SimonSchick
Copy link
Contributor Author

SimonSchick commented Nov 13, 2019

@RyanCavanaugh what's the current timeline for allowing removing typings? Would you recommend I alter my PR to not remove the v0 ones? I kinda want this PR done 🙂

@Aankhen
Copy link
Contributor

Aankhen commented Nov 14, 2019

I’m waiting with bated breath for this one!

As an aside, if you’ve bumped up the minimum TypeScript version to 3.0, it might make sense to use tuple types for things like page.evaluate. I have a WIP version of this, if you’re interested.

@SimonSchick
Copy link
Contributor Author

Feel free to suggest the diff and/or point me to your fork with the commit (I can cherrypick it)

@typescript-bot typescript-bot added New Definition This PR creates a new definition package. Author is Owner The author of this PR is a listed owner of the package. labels Nov 15, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 15, 2019

@SimonSchick The Travis 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
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?

puppeteer/v2

These typings are for a package that doesn’t yet exist on master, so I don’t have anything to compare against yet! In the future, I’ll be able to compare PRs to puppeteer with its source on master.

Comparison details for puppeteer/v2 📊
Batch compilation
Type count 19225
Assignability cache size 38172
Language service measurements
Samples taken 1179
Identifiers in tests 1179
getCompletionsAtPosition
    Mean duration (ms) 641.0
    Mean CV 8.4%
    Worst duration (ms) 786.5
    Worst identifier evaluate
getQuickInfoAtPosition
    Mean duration (ms) 638.2
    Mean CV 8.6%
    Worst duration (ms) 766.3
    Worst identifier v
System information
Node version v12.13.0
CPU count 2
CPU speed 2.294 GHz
CPU model Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
CPU Architecture x64
Memory 6.8 GiB
Platform linux
Release 4.15.0-1061-azure

puppeteer/v1

Comparison details for puppeteer/v1 📊
master #40284 diff
Batch compilation
Memory usage (MiB) 106.3 114.6 +7.8%
Type count 19212 19226 0%
Assignability cache size 38170 38181 0%
Language service
Samples taken 1175 1175 0%
Identifiers in tests 1175 1175 0%
getCompletionsAtPosition
    Mean duration (ms) 641.3 628.0 -2.1%
    Mean CV 8.3% 8.5%
    Worst duration (ms) 793.9 774.6 -2.4%
    Worst identifier devicePixelRatio $$eval
getQuickInfoAtPosition
    Mean duration (ms) 636.3 626.5 -1.5%
    Mean CV 8.5% 9.0% +5.4%
    Worst duration (ms) 809.3 751.8 -7.1%
    Worst identifier s fileChooser

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 15, 2019
@Aankhen
Copy link
Contributor

Aankhen commented Nov 15, 2019

Feel free to suggest the diff and/or point me to your fork with the commit (I can cherrypick it)

I’ve pushed the (no longer WIP) changes to my fork. I was going to open a PR against your branch, but that became difficult because I had also rebased to pull in the changes from master, so the diff was huge. Note that I separated my changes into two commits: one to create a ts3.1 directory with the same definitions, and one to actually use 3.1 features in that directory. (Otherwise the specific changes would have been lost.)

I also just realized that I’ve marked it as requiring 3.1 or greater when I actually meant 3.0.

@Aankhen
Copy link
Contributor

Aankhen commented Nov 15, 2019

@SimonSchick
Copy link
Contributor Author

@Aankhen I tried to manually apply the diff from the last commit, unfortunately I'm getting a few errors, specifically on page.evaluate* calls, see my feat/puppeteer-2.0-tuples branch :)

@typescript-bot typescript-bot removed the Author is Owner The author of this PR is a listed owner of the package. label Nov 16, 2019
@typescript-bot
Copy link
Contributor

@SimonSchick The Travis 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
Copy link
Contributor

typescript-bot commented Nov 16, 2019

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

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

@Aankhen
Copy link
Contributor

Aankhen commented Nov 16, 2019

@Aankhen I tried to manually apply the diff from the last commit, unfortunately I'm getting a few errors, specifically on page.evaluate* calls, see my feat/puppeteer-2.0-tuples branch :)

Where are you getting the errors? If you mean you’re getting TypeScript errors complaining about the rest args, I got the same ones, because it won’t be parsed by 3.0 by default. I believe it will only be parsed by 3.0 when you run the tests.

@SimonSchick
Copy link
Contributor Author

I'm using 3.6 in vscode, I'd ask you to checkout my branch and see for yourself.

@typescript-bot
Copy link
Contributor

@SimonSchick The Travis 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
Copy link
Contributor

@SimonSchick The Travis 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
Copy link
Contributor

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

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

@Aankhen
Copy link
Contributor

Aankhen commented Nov 16, 2019

I'm using 3.6 in vscode, I'd ask you to checkout my branch and see for yourself.

I’ve checked out SimonSchick/DefinitelyTyped@3a84f88 and I’ve got types/puppeteer/index.d.ts open in VS Code. I’m not seeing any errors.

@SimonSchick
Copy link
Contributor Author

See
image

@Aankhen
Copy link
Contributor

Aankhen commented Nov 16, 2019

Thanks! That’s why I was asking where the error was, heh. I spent a few hours on this and fixed that, but the complexity keeps increasing, and it’s contagious. I think it’s something a more experienced developer would have to implement. For the moment, I’m going to drop the idea. Thank you for trying to integrate the changes, though.

@sheetalkamat sheetalkamat merged commit c431735 into DefinitelyTyped:master Nov 19, 2019
Pull Request Status Board automation moved this from Review to Done Nov 19, 2019
@typescript-bot
Copy link
Contributor

I just published @types/carlo@0.9.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/html5-to-pdf@3.1.1 to npm.

@typescript-bot
Copy link
Contributor

I just published @types/puppeteer@2.0.0 to npm.

@SimonSchick SimonSchick deleted the feat/puppeteer-2.0 branch November 30, 2019 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Definition This PR creates a new definition package. 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).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants