puppeteer/packages/puppeteer-core/third_party
Alex Rudenko 29a50764d4
chore: add BiDi integration for Chromium (#9410)
This PR adds experimental support for WebDriver BiDi by making use of
chromium-bidi to implement the BiDi protocol. The tests are disabled on
Windows due to flakiness (filed
https://github.com/GoogleChromeLabs/chromium-bidi/issues/361).
2022-12-20 14:37:31 +00:00
..
chromium-bidi chore: add BiDi integration for Chromium (#9410) 2022-12-20 14:37:31 +00:00
mitt feat: separate puppeteer and puppeteer-core (#9023) 2022-10-05 14:17:03 +02:00
README.md feat: separate puppeteer and puppeteer-core (#9023) 2022-10-05 14:17:03 +02:00
tsconfig.cjs.json feat: separate puppeteer and puppeteer-core (#9023) 2022-10-05 14:17:03 +02:00
tsconfig.json feat: separate puppeteer and puppeteer-core (#9023) 2022-10-05 14:17:03 +02:00

third_party

This folder contains code that interacts with third party node modules that will be vendored with puppeteer during publishing.

Why not node_modules?

Because we are working towards an agnostic Puppeteer that can run in any environment (see #6125) we cannot import common dependencies in a way that relies on Node's resolution to find them. For example, import mitt from 'mitt' works fine in Node, but in an ESM build running in an environment without module resolution such as the browser, 'mitt' would not make sense.

The process for installing/using a vendored dependency is a two-step process:

  1. Create a folder named after the package. See the node_modules folder for inspiration.
  2. Create an entrypoint that exports needed imports from the package. For example, index.ts may contain
export * from 'your-package';
export {default as default} from 'your-package';

Now if you need to import from the dependency, you need to import relative to this directory rather than the package name itself.