Skip to content

Commit

Permalink
Remove the gutenberg-pr Query API option (#713)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
adamziel authored Oct 19, 2023
1 parent 73b285f commit 9e30d52
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 42 deletions.
1 change: 0 additions & 1 deletion packages/docs/site/docs/08-query-api/01-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
38 changes: 0 additions & 38 deletions packages/playground/website/src/lib/make-blueprint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ interface MakeBlueprintOptions {
landingPage?: string;
theme?: string;
plugins?: string[];
gutenbergPR?: number;
}
export function makeBlueprint(options: MakeBlueprintOptions): Blueprint {
const plugins = options.plugins || [];
Expand Down Expand Up @@ -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',
},
},
];
}
3 changes: 0 additions & 3 deletions packages/playground/website/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand Down

0 comments on commit 9e30d52

Please sign in to comment.