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/Puppeteer to TypeScript #5789

Merged
merged 2 commits into from May 5, 2020

Conversation

jackfranklin
Copy link
Collaborator

No description provided.

@@ -25,7 +25,7 @@ for (const className in api) {
// Expose alias for deprecated method.
Page.prototype.emulateMedia = Page.prototype.emulateMediaType;

const Puppeteer = require('./lib/Puppeteer');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed lib/Puppeteer to export as a named export which is the pattern the vast majority of files use in the codebase. It also plays nicer with TypeScript and outputting as CommonJS.

This does mean that if someone has const Puppeteer = require('puppeteer/lib/puppeteer') it would break, but I don't think we should consider that a breaking change (src/ should be considered internal + we could change its structure/files at any point).

@mathiasbynens WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

found 3 matches on GitHub for this pattern: https://github.com/search?q=%22require%28%27puppeteer%2Flib%2FPuppeteer%27%29%22&type=Code but they don't look like active codebases.

Plus the change only requires adding braces around the require. We can call that out in the release notes.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed we should be able to change this.

@jackfranklin jackfranklin force-pushed the migrate-src-puppeteer-typescript branch 2 times, most recently from cd2fdb9 to 2f11f66 Compare April 30, 2020 14:52
@jackfranklin jackfranklin force-pushed the migrate-src-puppeteer-typescript branch from 2f11f66 to cb2acab Compare April 30, 2020 15:20
@mathiasbynens mathiasbynens changed the title chore: migrate src/Puppeteer to TypeScript. chore: migrate src/Puppeteer to TypeScript May 4, 2020
@jackfranklin jackfranklin merged commit 890c215 into master May 5, 2020
@jackfranklin jackfranklin deleted the migrate-src-puppeteer-typescript branch May 5, 2020 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants