This must've been the fastest turnaround for another major release. 5.1 was only released 24 days ago! This update is all about making the editor more powerful and also includes a brand-new Settings API. Let's dive in!
Settings API
With Blockstudio becoming more and more powerful, it's time to introduce a proper way to configure it. The new Settings API does exactly that. It allows configuring Blockstudio via the admin panel and/or a JSON file inside your theme.
When a blockstudio.json
file is present, the settings panel will update the
contents of the file instead of writing the options to the database.
{ "$schema": "https://app.blockstudio.dev/schema/blockstudio", "users": { "ids": [], "roles": [] }, "assets": { "enqueue": true, "minify": { "css": false, "js": false }, "process": { "scss": false } }, "editor": { "formatOnSave": false, "assets": [], "markup": false }, "library": false }
Copy
Alternatively you can use the blockstudio/settings/${setting}
filter to set
options via PHP for more flexibility.
add_filter('blockstudio/settings/assets/enqueue', '__return_false'); add_filter('blockstudio/settings/editor/formatOnSave', '__return_true'); add_filter('blockstudio/settings/library', '__return_true');
Copy
Following filters have been deprecated in favor of the new Settings API:
blockstudio/library
→blockstudio/settings/library
blockstudio/assets
→blockstudio/settings/assets/enqueue
blockstudio/editor/assets
→blockstudio/settings/editor/assets
blockstudio/editor/markup
→blockstudio/settings/editor/markup
blockstudio/editor/users
→blockstudio/settings/users/ids
blockstudio/editor/users/roles
→blockstudio/settings/users/roles
The old filters will continue to work for now, but will be removed in a future release.
Server processing
Before 5.2, assets would be processed (processing SCSS, minifying JS, fetching ES modules etc.) on the client-side when using the editor. Now, all that work is done on the server. Blockstudio will automatically process new or updated files, no matter if they have been adjusted through the built-in editor, using your IDE or by simply editing the file via SFTP or SSH.
This also means that the esbuild dependency has been removed, which reduces the plugin size by 11MB.
NPM package information
When using the blockstudio/{package}@{version}
convention inside .js files,
Blockstudio will now show you the package information on hover inside the
editor.
Editing blocks from Gutenberg
This one is huge: you can now edit blocks directly from Gutenberg. By clicking the "Edit with Blockstudio" button in the sidebar, the editor will open in a separate window and allow you to make changes to the block itself or its assets and preview them inside Gutenberg.
Editing blocks using this method has one advantage over the built-in editor preview that Blockstudio provides: the same block inserted multiple times with different settings can be previewed at once.
And that's a wrap! Of course, there are many more changes and improvements in 5.2. You can find the full changelog here.