Make WordPress Core


Ignore:
Timestamp:
09/21/2022 01:55:25 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Editor: Improve block loading PHP performance.

This commit improves PHP performance for core blocks by reading a single PHP file with block metadata, instead of reading a JSON file per-block and then decoding from JSON to PHP.

Includes:

  • Adding a new Grunt task to convert block.json files to block-json.php.
  • Using the new block-json.php file in the register_block_type_from_metadata() function.

Follow-up to [48141].

Props aristath, gziolo, johnbillion, presstoke, mukesh27, hellofromTonya, petitphp, adamsilverstein, costdev, desrosj, SergeyBiryukov.
Fixes #55005.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package-lock.json

    r54261 r54276  
    43274327                "json2php": "^0.0.4",
    43284328                "webpack-sources": "^3.2.2"
     4329            },
     4330            "dependencies": {
     4331                "json2php": {
     4332                    "version": "0.0.4",
     4333                    "resolved": "https://registry.npmjs.org/json2php/-/json2php-0.0.4.tgz",
     4334                    "integrity": "sha512-hFzejhs28f70sGnutcsRS459MnAsjRVI85RgPAL1KQIZEpjiDitc27CZv4IgOtaR86vrqOVlu9vJNew2XyTH4g==",
     4335                    "dev": true
     4336                }
    43294337            }
    43304338        },
     
    1776417772        },
    1776517773        "json2php": {
    17766             "version": "0.0.4",
    17767             "resolved": "https://registry.npmjs.org/json2php/-/json2php-0.0.4.tgz",
    17768             "integrity": "sha512-hFzejhs28f70sGnutcsRS459MnAsjRVI85RgPAL1KQIZEpjiDitc27CZv4IgOtaR86vrqOVlu9vJNew2XyTH4g==",
    17769             "dev": true
     17774            "version": "0.0.5",
     17775            "resolved": "https://registry.npmjs.org/json2php/-/json2php-0.0.5.tgz",
     17776            "integrity": "sha512-jWpsGAYlQDKOjJcyq3rYaxcZ+5YMhZIKHKTjdIKJPI9zLSX+yRWHSSwtV8hvIg7YMhbKkgPO669Ve2ZgFK5C7w=="
    1777017777        },
    1777117778        "json5": {
Note: See TracChangeset for help on using the changeset viewer.