diff --git a/CHANGELOG.md b/CHANGELOG.md index 009edd7..e7e9e57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### Changed + +- Core Framework 2.x now requires WordPress 6.6 or newer. + +### Fixed + +- Fixed the Gutenberg editor failing with an undefined `ReactJSXRuntime` by loading the generated script dependency manifest, including the `react-jsx-runtime` dependency introduced in WordPress 6.6. + ## [2.0.2] - 2026-08-28 ### Fixed diff --git a/README.md b/README.md index 099879c..ec5fb37 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ Then publish `packages/www/dist` at the matching path, such as `https://example. ## WordPress development -Requirements: WordPress 6.0 or newer, PHP 8.0 or newer, Composer, Bun 1.3.x, and a local HTTPS certificate. +Requirements: WordPress 6.6 or newer, PHP 8.0 or newer, Composer, Bun 1.3.x, and a local HTTPS certificate. 1. Link the plugin package into your WordPress installation: diff --git a/packages/wp/core-framework.php b/packages/wp/core-framework.php index 63dc78e..d92fda7 100644 --- a/packages/wp/core-framework.php +++ b/packages/wp/core-framework.php @@ -18,7 +18,7 @@ * License: MIT * License URI: https://opensource.org/license/mit * Requires PHP: 8.0 - * Requires at least: 6.0 + * Requires at least: 6.6 * Namespace: CoreFramework */ diff --git a/packages/wp/readme.txt b/packages/wp/readme.txt index 659204c..0c4def3 100644 --- a/packages/wp/readme.txt +++ b/packages/wp/readme.txt @@ -1,7 +1,7 @@ === Core Framework === Contributors: coreframework Tags: css, framework, stylesheet, bricks, oxygen -Requires at least: 6.0 +Requires at least: 6.6 Requires PHP: 8.0 Tested up to: 7.0 Stable tag: 2.0.2 diff --git a/packages/wp/wp/App/Gutenberg/Functions.php b/packages/wp/wp/App/Gutenberg/Functions.php index 4e48a5a..ce9e2e7 100644 --- a/packages/wp/wp/App/Gutenberg/Functions.php +++ b/packages/wp/wp/App/Gutenberg/Functions.php @@ -262,17 +262,33 @@ public function add_colors( $theme_json ) { public function enqueue_scripts() { CoreFramework()->enqueue_core_framework_connector(); - $version = $this->plugin->version(); + $script_path = plugin_dir_path( CORE_FRAMEWORK_ABSOLUTE ) . 'gutenberg/index.js'; + $script_asset_path = plugin_dir_path( CORE_FRAMEWORK_ABSOLUTE ) . 'gutenberg/index.asset.php'; + $script_asset = array( + 'dependencies' => array( + 'react', + 'react-jsx-runtime', + 'wp-block-editor', + 'wp-components', + 'wp-compose', + 'wp-data', + 'wp-element', + 'wp-plugins', + ), + 'version' => \file_exists( $script_path ) + ? \filemtime( $script_path ) + : $this->plugin->version(), + ); - if ( \file_exists( plugin_dir_path( CORE_FRAMEWORK_ABSOLUTE ) . 'gutenberg/index.js' ) ) { - $version = \filemtime( plugin_dir_path( CORE_FRAMEWORK_ABSOLUTE ) . 'gutenberg/index.js' ); + if ( \file_exists( $script_asset_path ) ) { + $script_asset = require $script_asset_path; } wp_enqueue_script( 'core-framework-gutenberg-plugin', plugins_url( 'gutenberg/index.js', CORE_FRAMEWORK_ABSOLUTE ), - array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), - $version, + $script_asset['dependencies'], + $script_asset['version'], true ); }