From 9e30d52f5eeaec856751c5541d40b228551b4d28 Mon Sep 17 00:00:00 2001 From: Adam Zielinski Date: Thu, 19 Oct 2023 16:22:39 +0200 Subject: [PATCH] Remove the gutenberg-pr Query API option (#713) There is a separate Gutenberg PR previewer available at https://playground.wordpress.net/gutenebrg.html Let's lean on that and do not support an additional Query API option that just duplicates that functionallity --- .../docs/site/docs/08-query-api/01-index.md | 1 - .../website/src/lib/make-blueprint.tsx | 38 ------------------- packages/playground/website/src/main.tsx | 3 -- 3 files changed, 42 deletions(-) diff --git a/packages/docs/site/docs/08-query-api/01-index.md b/packages/docs/site/docs/08-query-api/01-index.md index 2fbc62481f..1464ac2ec0 100644 --- a/packages/docs/site/docs/08-query-api/01-index.md +++ b/packages/docs/site/docs/08-query-api/01-index.md @@ -31,7 +31,6 @@ You can go ahead and try it out. The Playground will automatically install the t | `mode` | `seamless` | Displays WordPress on a full-page or wraps it in a browser UI | | `lazy` | | Defer loading the Playground assets until someone clicks on the "Run" button | | `login` | `1` | Logs the user in as an admin | -| `gutenberg-pr` | | Loads the specified Gutenberg Pull Request | | `storage` | | Selects the storage for Playground: `none` gets erased on page refresh, `browser` is stored in the browser, and `device` is stored in the selected directory on a device. The last two protect the user from accidentally losing their work upon page refresh. | For example, the following code embeds a Playground with a preinstalled Gutenberg plugin, and opens the post editor: diff --git a/packages/playground/website/src/lib/make-blueprint.tsx b/packages/playground/website/src/lib/make-blueprint.tsx index fdafc08b36..6078c87ab7 100644 --- a/packages/playground/website/src/lib/make-blueprint.tsx +++ b/packages/playground/website/src/lib/make-blueprint.tsx @@ -7,7 +7,6 @@ interface MakeBlueprintOptions { landingPage?: string; theme?: string; plugins?: string[]; - gutenbergPR?: number; } export function makeBlueprint(options: MakeBlueprintOptions): Blueprint { const plugins = options.plugins || []; @@ -40,43 +39,6 @@ export function makeBlueprint(options: MakeBlueprintOptions): Blueprint { }, progress: { weight: 2 }, })), - ...(typeof options.gutenbergPR === 'number' - ? applyGutenbergPRSteps(options.gutenbergPR) - : []), ], }; } - -function applyGutenbergPRSteps(prNumber: number): StepDefinition[] { - return [ - { - step: 'mkdir', - path: '/wordpress/pr', - }, - { - step: 'writeFile', - path: '/wordpress/pr/pr.zip', - data: { - resource: 'url', - url: `/plugin-proxy?org=WordPress&repo=gutenberg&workflow=Build%20Gutenberg%20Plugin%20Zip&artifact=gutenberg-plugin&pr=${prNumber}`, - caption: `Downloading Gutenberg PR ${prNumber}`, - }, - progress: { - weight: 2, - caption: `Applying Gutenberg PR ${prNumber}`, - }, - }, - { - step: 'unzip', - zipPath: '/wordpress/pr/pr.zip', - extractToPath: '/wordpress/pr', - }, - { - step: 'installPlugin', - pluginZipFile: { - resource: 'vfs', - path: '/wordpress/pr/gutenberg.zip', - }, - }, - ]; -} diff --git a/packages/playground/website/src/main.tsx b/packages/playground/website/src/main.tsx index bd8f81deb6..0111d14b21 100644 --- a/packages/playground/website/src/main.tsx +++ b/packages/playground/website/src/main.tsx @@ -42,9 +42,6 @@ try { plugins: query.getAll('plugin'), landingPage: query.get('url') || undefined, phpExtensionBundles: query.getAll('php-extension-bundle') || [], - gutenbergPR: query.has('gutenberg-pr') - ? Number(query.get('gutenberg-pr')) - : undefined, }); }