Since blocks shouldn’t be included in your WordPress theme, the following setup is based on being configured from a directory for a plugin. Radicle is also setup with all of this as well. For folks that sponsor us on GitHub, you can reference the Clover repo for a working plugin with an example block and editor plugin that is built with bud.js. If you aren’t already using bud.js in your project, you might want to integrate it as a build tool for your WordPress plugin that contains your block related assets. The bud.js repo contains a wordpress-editor example as a helpful reference for getting started. We owe a debt of gratitude to K Adam White for the initial work he did on this problem, which was instrumental to crafting our solution. The biggest improvement is out-of-the-box support for hot module reloading, which persists block state when editing source code. ![]() bud.js vs create-block packageīud does not currently support scaffolding new blocks like the official package (we will in the future!), but it does offer an easier to use API for working with webpack over the wp-scripts package as well as an improved developer experience. Moreover, the wordpress-hmr package can be used independently of bud.js or even webpack. ![]() While bud.js is included with our WordPress starter theme, it can be used independently of Sage, including on any sort of site or application that requires building front-end assets. Bud.js has extensions that help with developing for the WordPress block editor, and as of v6.11.0, the library is included in making it easy to register blocks and other editor specific code with hot reload (HMR) support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |