Make WordPress Core


Ignore:
Timestamp:
09/24/2024 07:33:55 AM (14 months ago)
Author:
gziolo
Message:

Build: Prepare for more Script Modules

This is a companion to https://github.com/WordPress/gutenberg/pull/65460 that requires syncing in WordPress Core. Namely, the block-library changes require registration with their updated script module IDs so that the blocks continue to work correctly.

They key improvement is script modules registration is handled in one central place, and a combined asset file is used to improve the performance by avoiding multiple disk operations for every individual file.

Props jonsurrell, gziolo, wildworks, noisysocks.
See #60647, #59462.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php

    r58825 r59083  
    213213
    214214    /**
     215     * Test that the deprecated register_script_modules method is deprecated but does not throw.
     216     *
     217     * @ticket 60647
     218     *
     219     * @expectedDeprecated WP_Interactivity_API::register_script_modules
     220     */
     221    public function test_register_script_modules_deprecated() {
     222        $this->interactivity->register_script_modules();
     223    }
     224
     225    /**
    215226     * Sets up an activity, runs an optional callback, and returns a MockAction for inspection.
    216227     *
     
    222233    private function get_script_data_filter_result( ?Closure $callback = null ): MockAction {
    223234        $this->interactivity->add_hooks();
    224         $this->interactivity->register_script_modules();
    225235        wp_enqueue_script_module( '@wordpress/interactivity' );
    226236        $filter = new MockAction();
Note: See TracChangeset for help on using the changeset viewer.