Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverting stablization block support #68196

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
63f81c1
Image size fix in lightbox
karthick-murugan Dec 3, 2024
0e19583
Revert "Image size fix in lightbox"
karthick-murugan Dec 3, 2024
f226ae0
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 4, 2024
d074ba9
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 5, 2024
4d847ca
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 5, 2024
c9115b2
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 5, 2024
b81e6ff
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 6, 2024
efe57e5
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 9, 2024
228e924
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 10, 2024
c448a21
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 11, 2024
05bb54c
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 12, 2024
619fed3
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 12, 2024
301d70f
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 18, 2024
c80640f
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 19, 2024
6ed9ff3
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 20, 2024
09b4cf2
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 20, 2024
27e4bbc
Merge branch 'WordPress:trunk' into trunk
karthick-murugan Dec 20, 2024
12131db
Reverting Stabilization block support
karthick-murugan Dec 20, 2024
1f2e0ba
Intendation updates
karthick-murugan Dec 20, 2024
b307245
Spacing issues
karthick-murugan Dec 20, 2024
9a6541f
Add to backport changelog
karthick-murugan Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backport-changelog/6.8/7069.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ https://github.com/WordPress/wordpress-develop/pull/7069
* https://github.com/WordPress/gutenberg/pull/63401
* https://github.com/WordPress/gutenberg/pull/66918
* https://github.com/WordPress/gutenberg/pull/67018
* https://github.com/WordPress/gutenberg/pull/67552
* https://github.com/WordPress/gutenberg/pull/68196
25 changes: 10 additions & 15 deletions lib/compat/wordpress-6.8/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ function gutenberg_stabilize_experimental_block_supports( $args ) {
}

$stabilize_config = function ( $unstable_config, $stable_support_key ) use ( $experimental_support_properties, $common_experimental_properties ) {
if ( ! is_array( $unstable_config ) ) {
return $unstable_config;
}

$stable_config = array();
foreach ( $unstable_config as $key => $value ) {
// Get stable key from support-specific map, common properties map, or keep original.
Expand Down Expand Up @@ -120,19 +116,18 @@ function gutenberg_stabilize_experimental_block_supports( $args ) {
( $key_positions[ $support ] ?? PHP_INT_MAX ) <
( $key_positions[ $stable_support_key ] ?? PHP_INT_MAX );

/*
* To merge the alternative support config effectively, it also needs to be
* stabilized before merging to keep stabilized and experimental flags in
* sync.
*/
$args['supports'][ $stable_support_key ] = $stabilize_config( $args['supports'][ $stable_support_key ], $stable_support_key );
// Prevents reprocessing this support as it was stabilized above.
$done[ $stable_support_key ] = true;

if ( is_array( $stable_config ) && is_array( $args['supports'][ $stable_support_key ] ) ) {
$stable_config = $experimental_first
if ( is_array( $args['supports'][ $stable_support_key ] ) ) {
/*
* To merge the alternative support config effectively, it also needs to be
* stabilized before merging to keep stabilized and experimental flags in
* sync.
*/
$args['supports'][ $stable_support_key ] = $stabilize_config( $args['supports'][ $stable_support_key ], $stable_support_key );
$stable_config = $experimental_first
? array_merge( $stable_config, $args['supports'][ $stable_support_key ] )
: array_merge( $args['supports'][ $stable_support_key ], $stable_config );
// Prevents reprocessing this support as it was merged above.
$done[ $stable_support_key ] = true;
} else {
$stable_config = $experimental_first
? $args['supports'][ $stable_support_key ]
Expand Down
100 changes: 0 additions & 100 deletions phpunit/block-supports/border-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,104 +730,4 @@ public function test_should_stabilize_border_supports_using_order_based_merge()
);
$this->assertSame( $expected, $actual, 'Merged stabilized border block support config does not match when stable keys are first.' );
}

/**
* Tests that boolean border support configurations are handled correctly.
*
* @dataProvider data_boolean_border_supports
*
* @param array $supports The supports configuration to test.
* @param boolean|array $expected_value The expected final border support value.
*/
public function test_should_handle_boolean_border_supports( $supports, $expected_value ) {
$args = array(
'supports' => $supports,
);

$actual = gutenberg_stabilize_experimental_block_supports( $args );

$this->assertSame( $expected_value, $actual['supports']['border'] );
}

/**
* Data provider for boolean border support tests.
*
* @return array Test parameters.
*/
public function data_boolean_border_supports() {
return array(
'experimental true only' => array(
array(
'__experimentalBorder' => true,
),
true,
),
'experimental false only' => array(
array(
'__experimentalBorder' => false,
),
false,
),
'experimental true before stable false' => array(
array(
'__experimentalBorder' => true,
'border' => false,
),
false,
),
'stable true before experimental false' => array(
array(
'border' => true,
'__experimentalBorder' => false,
),
false,
),
'experimental array before stable boolean' => array(
array(
'__experimentalBorder' => array(
'color' => true,
'width' => true,
),
'border' => false,
),
false,
),
'stable array before experimental boolean' => array(
array(
'border' => array(
'color' => true,
'width' => true,
),
'__experimentalBorder' => true,
),
true,
),
'experimental boolean before stable array' => array(
array(
'__experimentalBorder' => true,
'border' => array(
'color' => true,
'width' => true,
),
),
array(
'color' => true,
'width' => true,
),
),
'stable boolean before experimental array' => array(
array(
'border' => false,
'__experimentalBorder' => array(
'color' => true,
'width' => true,
),
),
array(
'color' => true,
'width' => true,
),
),
);
}
}
Loading