From efcbc97c60e4cfd49a9ed25a900f6133d06b290b Mon Sep 17 00:00:00 2001 From: jrandolf <101637635+jrandolf@users.noreply.github.com> Date: Thu, 20 Oct 2022 13:25:24 +0200 Subject: [PATCH] fix: update `BrowserFetcher` deprecation message (#9141) --- docs/api/puppeteer.createbrowserfetcher.md | 4 ---- docs/api/puppeteer.puppeteernode.createbrowserfetcher.md | 2 +- packages/puppeteer-core/src/node/PuppeteerNode.ts | 4 +++- packages/puppeteer-core/src/puppeteer-core.ts | 4 +++- packages/puppeteer/src/puppeteer.ts | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/api/puppeteer.createbrowserfetcher.md b/docs/api/puppeteer.createbrowserfetcher.md index e9cd52da..1af8a3b1 100644 --- a/docs/api/puppeteer.createbrowserfetcher.md +++ b/docs/api/puppeteer.createbrowserfetcher.md @@ -4,10 +4,6 @@ sidebar_label: createBrowserFetcher # createBrowserFetcher variable -> Warning: This API is now obsolete. -> -> Import [BrowserFetcher](./puppeteer.browserfetcher.md) directly and use the constructor. - **Signature:** ```typescript diff --git a/docs/api/puppeteer.puppeteernode.createbrowserfetcher.md b/docs/api/puppeteer.puppeteernode.createbrowserfetcher.md index 26739dfb..5614f3df 100644 --- a/docs/api/puppeteer.puppeteernode.createbrowserfetcher.md +++ b/docs/api/puppeteer.puppeteernode.createbrowserfetcher.md @@ -6,7 +6,7 @@ sidebar_label: PuppeteerNode.createBrowserFetcher > Warning: This API is now obsolete. > -> Import [BrowserFetcher](./puppeteer.browserfetcher.md) directly and use the constructor. +> If you are using `puppeteer-core`, do not use this method. Just construct [BrowserFetcher](./puppeteer.browserfetcher.md) manually. **Signature:** diff --git a/packages/puppeteer-core/src/node/PuppeteerNode.ts b/packages/puppeteer-core/src/node/PuppeteerNode.ts index ce886c0d..f52ee071 100644 --- a/packages/puppeteer-core/src/node/PuppeteerNode.ts +++ b/packages/puppeteer-core/src/node/PuppeteerNode.ts @@ -229,10 +229,12 @@ export class PuppeteerNode extends Puppeteer { } /** - * @deprecated Import {@link BrowserFetcher} directly and use the constructor. + * @deprecated If you are using `puppeteer-core`, do not use this method. Just + * construct {@link BrowserFetcher} manually. * * @param options - Set of configurable options to specify the settings of the * BrowserFetcher. + * * @returns A new BrowserFetcher instance. */ createBrowserFetcher(options: BrowserFetcherOptions): BrowserFetcher { diff --git a/packages/puppeteer-core/src/puppeteer-core.ts b/packages/puppeteer-core/src/puppeteer-core.ts index d409a165..8f2a4c8e 100644 --- a/packages/puppeteer-core/src/puppeteer-core.ts +++ b/packages/puppeteer-core/src/puppeteer-core.ts @@ -36,7 +36,9 @@ const puppeteer = new PuppeteerNode({ export const { connect, - /** @deprecated Import {@link BrowserFetcher} directly and use the constructor. */ + /** + * @deprecated Construct {@link BrowserFetcher} manually. + */ createBrowserFetcher, defaultArgs, executablePath, diff --git a/packages/puppeteer/src/puppeteer.ts b/packages/puppeteer/src/puppeteer.ts index 9674424f..b31a54ec 100644 --- a/packages/puppeteer/src/puppeteer.ts +++ b/packages/puppeteer/src/puppeteer.ts @@ -54,7 +54,6 @@ const puppeteer = new PuppeteerNode({ export const { connect, - /** @deprecated Import {@link BrowserFetcher} directly and use the constructor. */ createBrowserFetcher, defaultArgs, executablePath,