Skip to content

TS: New typings inferior to former @types ones #3878

Closed
@SimonSchick

Description

@SimonSchick

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.12
  • Platform / OS version: Irrelevant
  • URLs (if applicable):
  • Node.js version: Irrelevant

What steps will reproduce the problem?

Please include code that reproduces the issue.

Update puppeteer
2.
Check typings.
3.
They are worse.

What is the expected result?

Typings should be at least at DT quality.

What happens instead?

  • Various types have become Function
    • Callbacks in waitFor/evaluate-ish functions.
  • Various types have come Object
    • Often incorrect such as jsonValue or json (should be 'unknown' instead)
    • Used instead of more precise dictonary object when used for headers and waitFor options.
  • Various specific overloads are missing that make requires less type assertions.

Both types should not be used as they are extremely broad.

FYI I consider this a breaking change as I cannot easily revert to DT typings without explicitly downgrading puppeteer, it also broke our builds.

Activity

aslushnikov

aslushnikov commented on Feb 1, 2019

@aslushnikov
Contributor

@SimonSchick thank you for letting us know and sorry for breaking you. We'll push a 1.12.1 without d.ts file shortly

SimonSchick

SimonSchick commented on Feb 1, 2019

@SimonSchick
Author

Obviously: I really appreciate you adding those, it's great they we don't need to maintain them separately anymore, but they need some fine tuning :)

Also worth noting is that typings for

image

would also be nice :)

SimonSchick

SimonSchick commented on Feb 1, 2019

@SimonSchick
Author
JoelEinbinder

JoelEinbinder commented on Feb 1, 2019

@JoelEinbinder
Contributor

They are included and all passed at at https://github.com/GoogleChrome/puppeteer/blob/master/utils/doclint/generate_types/test/test.ts

Seems like there is some untested functionality though. If you could sending a PR adding failing code to that file (just leave it commented out) it would be super helpful!

SimonSchick

SimonSchick commented on Feb 1, 2019

@SimonSchick
Author

Ah yea, I didn't see it there, and yea the tests are far from complete, I will see if I get around to it.

added a commit that references this issue on Feb 1, 2019
aslushnikov

aslushnikov commented on Feb 1, 2019

@aslushnikov
Contributor

1.12.1 is out now with removed index.d.ts file. I'll keep this issue open to track progress on making our generated index.d.ts better and maybe eventually ship them again.

SimonSchick

SimonSchick commented on Feb 1, 2019

@SimonSchick
Author

See DefinitelyTyped/DefinitelyTyped#32723, I added a few extra tests, should help you a bit.

Also, it seems your generated generated some interfaces multiple times, see PageMetricsPayload

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @pocesar@aslushnikov@SimonSchick@JoelEinbinder@jrandolf-2

        Issue actions

          TS: New typings inferior to former @types ones · Issue #3878 · puppeteer/puppeteer