register_block_type from a manifest, in one call

Eleven blocks, eleven register_block_type calls, eleven block.json files read from disk on every request.

add_action( 'init', function () {
    // 6.7+: reads a generated manifest instead of
    // stat-ing and parsing every block.json
    wp_register_block_metadata_collection(
        __DIR__ . '/build',
        __DIR__ . '/build/blocks-manifest.php'
    );

    foreach ( array_keys( require __DIR__ . '/build/blocks-manifest.php' ) as $block ) {
        register_block_type( __DIR__ . "/build/{$block}" );
    }
} );

Eleven file reads and eleven JSON parses on every request is not a lot and it is not nothing, and the manifest is generated by the build so it cannot drift. The measurable effect was about four milliseconds on a cold opcache and nothing afterwards, which is the honest scale — the reason to adopt it is that it is the direction core is going rather than the four milliseconds.