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

chore: migrate src/Connection to TypeScript #5694

Merged
merged 2 commits into from Apr 21, 2020
Merged

Commits on Apr 20, 2020

  1. chore: migrate src/Connection to TypeScript

    This commit migrates `src/Connection` to TypeScript. It also changes its
    exports to be ESM because TypeScript's support for exporting values to
    use as types via CommonJS is poor (by design) and so rather than battle
    that it made more sense to migrate the file to ESM.
    
    The good news is that TypeScript is still outputting to `lib/` as
    CommonJS, so the fact that we author in ESM is actually not a breaking
    change at all.
    
    So going forwards we will:
    
    * migrate TS files to use ESM for importing and exporting
    * continue to output to `lib/` as CommonJS
    * continue to use CommonJS requires when in a `src/*.js` file
    
    I'd also like to split `Connection.ts` into two; I think the
    `CDPSession` class belongs in its own file, but I will do that in
    another PR to avoid this one becoming bigger than it already is.
    
    I also turned off `@typescript-eslint/no-use-before-define` as I don't
    think it was adding value and Puppeteer's codebase seems to have a style
    of declaring helper functions at the bottom which is fine by me.
    
    Finally, I updated the DocLint tool so it knows of expected method
    mismatches. It was either that or come up with a smart way to support
    TypeScript generics in DocLint and given we don't want to use DocLint
    that much longer that didn't feel worth it.
    jackfranklin committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    f0bcdbb View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2020

  1. Configuration menu
    Copy the full SHA
    a1ece92 View commit details
    Browse the repository at this point in the history