Skip to content

Commit 8232be3

Browse files
authored
[Docs] Updating repository preview info (#2890)
This pull request updates the "Quick Start Guide for Developers" documentation to improve clarity, add practical instructions, and expand coverage of previewing pull requests and branches in Playground. The most important changes are grouped below: **Previewing Pull Requests and Branches:** * Added detailed instructions for previewing repository code in Playground using either `git:directory` or direct `.zip` URLs, including a JSON Blueprint example and explanation of CI requirements. * Introduced a new section on previewing WordPress Core and Gutenberg branches or PRs using Query API parameters, with concrete URL examples for trunk and PR previews. **Content and Clarity Improvements:** * Updated the description metadata for the guide to reflect better coverage of embedding WordPress, installing plugins, previewing PRs, and using Playground APIs. * Reworded plugin and theme installation instructions for clarity and conciseness. * Revised compatibility testing environment instructions to emphasize configuring PHP and WordPress versions for plugin testing in Playground. **Blueprints API Update:** * Updated the Blueprints API example for importing WXR files to use the `file` property instead of `pluginData` for resource URLs.
1 parent 48e2fcf commit 8232be3

File tree

4 files changed

+849
-31
lines changed
  • packages/docs/site
    • docs/developers/03-build-an-app
    • i18n
      • es/docusaurus-plugin-content-docs/current/developers/03-build-an-app
      • fr/docusaurus-plugin-content-docs/current/developers/03-build-an-app
      • pt-BR/docusaurus-plugin-content-docs/current/developers/03-build-an-app

4 files changed

+849
-31
lines changed

packages/docs/site/docs/developers/03-build-an-app/01-index.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Quick Start Guide for Developers
33
slug: /developers/build-your-first-app
4+
description: Practical guide to embedding WordPress, installing plugins, previewing PRs, and building apps with Playground APIs.
45
---
56

67
# Quick Start Guide for Developers
@@ -39,8 +40,7 @@ Learn more about each of these APIs in the [APIs overview section](/developers/a
3940

4041
import ThisIsQueryApi from '@site/docs/\_fragments/\_this_is_query_api.md';
4142

42-
You can install plugins and themes from the WordPress directory with only URL parameters. For example this iframe would come with the `coblocks` and `friends` plugins preinstalled as well as the `pendant` theme.
43-
43+
You can install plugins and themes from the WordPress directory with only URL parameters. This iframe preinstalls the `coblocks` and `friends` plugins and the `pendant` theme.
4444
<ThisIsQueryApi />
4545

4646
```html
@@ -72,7 +72,7 @@ You can still showcase it on Playground by using [JSON Blueprints](/blueprints).
7272
},
7373
{
7474
"step": "importWxr",
75-
"pluginData": {
75+
"file": {
7676
"resource": "url",
7777
"url": "https://your-site.com/starter-content.wxr"
7878
}
@@ -85,15 +85,44 @@ See [getting started with Blueprints](/blueprints/getting-started) to learn more
8585

8686
## Preview pull requests from your repository
8787

88-
See the [live example of Gutenberg PR previewer](https://playground.wordpress.net/gutenberg.html).
88+
You can preview repository code two ways: directly with `git:directory`, or by pointing to a `.zip` from your CI pipeline. Here's the `git:directory` approach using [Blueprints](/blueprints):
8989

90-
You can use Playground as a Pull Request previewer if:
90+
```json
91+
{
92+
"steps": [
93+
{
94+
"step": "installPlugin",
95+
"pluginData": {
96+
"resource": "git:directory",
97+
"url": "https://github.com/my-user/my-repo",
98+
"ref": "refs/pull/1/head",
99+
"refType": "refname"
100+
},
101+
"options": {
102+
"activate": true
103+
},
104+
"progress": {
105+
"caption": "Installing plugin from my-user/my-repo PR #1"
106+
}
107+
}
108+
]
109+
}
110+
```
111+
112+
In the code above, it will install a plugin from a repository located at the `url`, and the reference to find the branch is `refType`; in this case, it will use `refname`, but it can also use `branch`, `tag`, and `commit`.
113+
114+
:::tip
115+
You can automate this process using the [GitHub Action to generate preview links](/guides/github-action-pr-preview), which will help streamline the process.
116+
:::
91117

92-
- Your WordPress plugin or theme uses a CI pipeline
93-
- Your CI pipeline bundles your plugin or theme
94-
- You can expose the zip file generated by your CI pipeline publicly
118+
Loading a `.zip` file is another alternative for previewing your project. See the [live example of Gutenberg PR previewer](https://playground.wordpress.net/gutenberg.html).
95119

96-
Those zip bundles aren't any different from regular WordPress Plugins, which means you can install them in Playground using the [JSON Blueprints](/blueprints) API. Once you exposed an endpoint like https://your-site.com/pull-request-1234.zip, the following Blueprint will do the rest:
120+
To use Playground as a PR previewer, you need:
121+
122+
- A CI pipeline that bundles your plugin or theme
123+
- Public access to the generated `.zip` file
124+
125+
Those zip bundles aren't any different from regular WordPress Plugins, which means you can install them in Playground using the [JSON Blueprints](/blueprints) API. Once you expose an endpoint like https://your-site.com/pull-request-1234.zip, the following Blueprint will do the rest:
97126

98127
```json
99128
{
@@ -154,9 +183,17 @@ blueprint={{
154183
]
155184
}} />
156185

186+
### Preview WordPress Core and Gutenberg Branches or PRs
187+
188+
You can preview specific pull requests from WordPress Core and Gutenberg repositories using Query API parameters. Gutenberg branches also have an alternative to preview them with the parameter `gutenberg-branch`. This is useful for testing the latest trunk changes or specific feature branches without creating a PR.
189+
190+
- Preview a specific WordPress Core PR: `https://playground.wordpress.net/?core-pr=9500`
191+
- Preview a specific Gutenberg PR: `https://playground.wordpress.net/?gutenberg-pr=73010`
192+
- Preview the Gutenberg trunk branch: `https://playground.wordpress.net/?gutenberg-branch=trunk`
193+
157194
## Build a compatibility testing environment
158195

159-
A live plugin demo with a configurable PHP and WordPress makes an excellent compatibility testing environment.
196+
Test your plugin across PHP and WordPress versions by configuring them in Playground. This helps you verify compatibility before release.
160197

161198
With the Query API, you'd simply add the `php` and `wp` query parameters to the URL:
162199

0 commit comments

Comments
 (0)