New Gutenberg Playground Offers a Standalone Version of the Editor for Testing Outside the WordPress Admin

The Gutenberg team merged a pull request three days ago that adds a local “playground” development environment for testing outside of the WordPress admin. Riad Benguella, the technical lead for Gutenberg phase 2, said that the playground could grow over time to contain “more than just a standalone version of the editor” and could become a way for developers to test out components in isolation. He shared a screenshot of the playground in action:

During Tuesday’s JavaScript chat meeting, Benguella elaborated on the playground’s intended use.

“Now that we’re expanding the usage of Gutenberg outside of the edit-post and also talking about cross-CMS usage and external usage (in the broad sense), we need a way to run the block editor in a context independent from the WordPress Admin. This means no WordPress admin styles, no API.”

Testing Gutenberg in the playground’s “no-context” mode allows developers to ensure their components don’t rely on WP-Admin styles to be present. Benguella said it demonstrates how core blocks can be used without requiring a post object, which will be useful for architecting the widgets screen.

“This playground could evolve to contain examples of our reusable components (think Storybook),” Benguella said. “It could also serve as a contributor tool. For example, we could include a way to search for selectors.”

The playground was just merged this week, so contributors are working on better documentation. In the meantime, check out the PR for more details on how to test it.