Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2 Blockstudio 5.2
Blockstudio 5.2 Published: 2023-08-31

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.

settings
Settings in the admin area

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.

blockstudio.json

            {
      "$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.

functions.php

            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/libraryblockstudio/settings/library
  • blockstudio/assetsblockstudio/settings/assets/enqueue
  • blockstudio/editor/assetsblockstudio/settings/editor/assets
  • blockstudio/editor/markupblockstudio/settings/editor/markup
  • blockstudio/editor/usersblockstudio/settings/users/ids
  • blockstudio/editor/users/rolesblockstudio/settings/users/roles

The old filters will continue to work for now, but will be removed in a future release.

Check documentation

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.

package information on hover

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.