Preview WP Core PRs with Playground

WordPress Core PR Previewer Now Live in Playground

Adam Zieliński, the creator of WordPress Playground, has announced that the WordPress Core PR previewer is now live. Playground is an experimental project that utilizes WebAssembly (WASM) to run WordPress in the browser. This allows users to create a WordPress instance with admin access without the need to install PHP, MySQL, or Apache, making it quick and easy to set up a test site.

Excitingly, one of the most significant use cases for the Playground project is testing pull requests. The newly launched WordPress Core PR previewer can be accessed at playground.wordpress.net/wordpress.html. Users have the option to enter the PR number or the URL to preview the pull request.

Customizing the Preview

The PR for previewing wordpress-develop repository pull requests adds support for several query parameters that developers can use to customize how the preview loads. These parameters include:

– ?pr=5481: This parameter allows users to preview a specific pull request.

– ?url=/wp-admin/post-new.php: Users can load a specific URL in WordPress using this parameter.

– ?mode=seamless: This parameter redirects users to a full-screen Playground without any browser chrome or extra UI elements.

Known Issues and Future Improvements

While this first implementation of the WordPress Core PR previewer is functional, there are a couple of known issues that developers should be aware of. Existing pull requests require a rebase to work correctly, but new pull requests function as expected. Additionally, downloading WordPress may take a long time as the bundle size is approximately 45MB. The contributors are actively working on optimizing this process to make it quicker and more efficient for previewing pull requests. Any problems or bugs encountered can be reported to the Playground repository’s issues page.

Playground Roadmap

As part of the Playground roadmap, Adam Zieliński is working on creating a pull request previewer for all WordPress projects, not just the core. This feature aims to address the challenges faced by WordPress developers who often rely on staging environments or local development setups for testing and reviewing pull requests. By providing an easy way to preview pull requests using Playground, the burden on developers will be alleviated, encouraging more reviews across the ecosystem and simplifying calls for testing.

Refining the Live Preview Experience

WordPress meta contributors recently implemented a “Live Preview” button for plugins in the official directory. However, due to inadequate support in the Playground environment, many plugins were broken, leading to the decision to revert this feature. Zieliński and contributors are currently refining the live preview experience for plugins hosted on WordPress.org. They are also working on creating a Blueprints API that will allow developers to customize their Playground instances easily.

Conclusion

The launch of the WordPress Core PR previewer in Playground is a significant development for WordPress developers. It provides a convenient and efficient way to test and review pull requests without the need for complex local development setups or staging environments. With ongoing improvements and refinements, Playground aims to enhance the overall development experience for WordPress projects, making it easier for developers to collaborate and contribute to the platform.

Stay in Touch

spot_img

Related Articles