Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Release: 8.7.6 #7804

Merged
merged 48 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a4c78bc
Empty commit for release pull request
invalid-email-address Oct 13, 2022
5f2e0e0
Added readme.txt changelog entry
wavvves Oct 13, 2022
b2bb28d
Update HPOS compatibility snippet (#7395)
alexflorisca Oct 13, 2022
dac5819
8.7.2 Testing notes
wavvves Oct 13, 2022
4c25fbc
Update testing notes
wavvves Oct 13, 2022
85ead2e
Update testing notes
wavvves Oct 13, 2022
de5396a
Bumped version
wavvves Oct 13, 2022
4b242de
Refactor force billing: remove forcedBillingAddress from conditions f…
Oct 14, 2022
4627bb5
Updated testing instructions and changelog to include #7393
wavvves Oct 14, 2022
a022233
Updated testing zip
wavvves Oct 14, 2022
458b153
Bumping version strings to new version.
wavvves Oct 14, 2022
723c9f2
Empty commit for release pull request
invalid-email-address Oct 20, 2022
d880074
Merge branch 'release/8.7.0' into release/8.7.3
wavvves Oct 20, 2022
1a8838c
Fix wrong keys being sent in `canMakePayment` and customer data showi…
opr Oct 20, 2022
c6025fc
Updated readme.txt
wavvves Oct 20, 2022
8a0dcdb
Reverted stable tag change on readme.txt
wavvves Oct 20, 2022
31f94c6
Testing instructions
wavvves Oct 20, 2022
35db00b
Cleaned out testing instructions
wavvves Oct 20, 2022
f475a62
Bumping version strings to new version.
wavvves Oct 20, 2022
b6cd0bc
Empty commit for release pull request
invalid-email-address Oct 21, 2022
522f06c
Merge branch 'release/8.7.0' into release/8.7.4
wavvves Oct 21, 2022
5d68114
Testing instructions
wavvves Oct 21, 2022
9b807a4
package-lock.json version bump
wavvves Oct 21, 2022
115b9b0
Revert "Fix `useForcedLayout` to re-select inner blocks after we manu…
opr Oct 21, 2022
87bf5b8
Testing zip
wavvves Oct 21, 2022
b47cb6b
Bumping version strings to new version.
wavvves Oct 21, 2022
1ce4108
add testing instructions
gigitux Oct 31, 2022
c48d57f
Merge branch 'release/8.7.0' of https://github.com/woocommerce/woocom…
gigitux Oct 31, 2022
e5f3e3e
upload a new zip file
gigitux Oct 31, 2022
c423d9d
Update styles of the Filter by Attribute dropdown so it looks good in…
Aljullu Oct 27, 2022
c85fa5d
Use theme's body background color as the mini cart contents default b…
dinhtungdu Oct 28, 2022
5adb612
Price Slider: use `currentColor` for the slider (#7527)
gigitux Oct 28, 2022
dac30a1
Make price slider 'inactive' range half transparent so it looks bette…
Aljullu Oct 28, 2022
48716ca
Fix inconsistent button styling with TT3 (#7516)
gigitux Oct 28, 2022
c31eb1f
Fix Mini Cart Block global styles #7379 (#7515)
gigitux Oct 31, 2022
961c981
upload a new build
gigitux Oct 31, 2022
c3c31bd
Bumping version strings to new version.
gigitux Oct 31, 2022
c462730
update changelog
gigitux Dec 1, 2022
11e34e9
Empty commit for release pull request
invalid-email-address Dec 1, 2022
32fcb51
add testing instructions
gigitux Dec 1, 2022
3b4f61e
update zip file link
gigitux Dec 1, 2022
667a7b5
Merge branch 'release/8.7.6' of https://github.com/woocommerce/woocom…
gigitux Dec 1, 2022
63ba058
Prevent Mini Cart loading the same script twice (#7794)
Aljullu Dec 1, 2022
56340ba
Mini Cart: load wc-blocks-registry package at the load of the page in…
gigitux Dec 1, 2022
33035e1
Update changelog
gigitux Dec 1, 2022
69b5cc5
Update testing instructions
gigitux Dec 1, 2022
a32a802
Bumping version strings to new version.
gigitux Dec 1, 2022
993f82d
Merge branch 'release/8.7.0' of https://github.com/woocommerce/woocom…
gigitux Dec 1, 2022
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
19 changes: 15 additions & 4 deletions assets/js/base/utils/lazy-load-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,16 @@ interface AppendScriptAttributesParam {
* This function checks whether an element matching that selector exists.
* Useful to know if a script has already been appended to the page.
*/
const isScriptTagInDOM = ( scriptId: string ): boolean => {
const scriptElements = document.querySelectorAll( `script#${ scriptId }` );
const isScriptTagInDOM = ( scriptId: string, src = '' ): boolean => {
const srcParts = src.split( '?' );
if ( srcParts?.length > 1 ) {
src = srcParts[ 0 ];
}
const selector = src
? `script#${ scriptId }, script[src*="${ src }"]`
: `script#${ scriptId }`;
const scriptElements = document.querySelectorAll( selector );

return scriptElements.length > 0;
};

Expand All @@ -37,7 +45,10 @@ const isScriptTagInDOM = ( scriptId: string ): boolean => {
*/
const appendScript = ( attributes: AppendScriptAttributesParam ): void => {
// Abort if id is not valid or a script with the same id exists.
if ( ! isString( attributes.id ) || isScriptTagInDOM( attributes.id ) ) {
if (
! isString( attributes.id ) ||
isScriptTagInDOM( attributes.id, attributes?.src )
) {
return;
}
const scriptElement = document.createElement( 'script' );
Expand Down Expand Up @@ -92,7 +103,7 @@ const lazyLoadScript = ( {
translations,
}: LazyLoadScriptParams ): Promise< void > => {
return new Promise( ( resolve, reject ) => {
if ( isScriptTagInDOM( `${ handle }-js` ) ) {
if ( isScriptTagInDOM( `${ handle }-js`, src ) ) {
resolve();
}

Expand Down
9 changes: 6 additions & 3 deletions assets/js/base/utils/preload-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ const preloadScript = ( {
src,
version,
}: PreloadScriptParams ): void => {
const handleScriptElements = document.querySelectorAll(
`#${ handle }-js, #${ handle }-js-prefetch`
);
const srcParts = src.split( '?' );
if ( srcParts?.length > 1 ) {
src = srcParts[ 0 ];
}
const selector = `#${ handle }-js, #${ handle }-js-prefetch, script[src*="${ src }"]`;
const handleScriptElements = document.querySelectorAll( selector );

if ( handleScriptElements.length === 0 ) {
const prefetchLink = document.createElement( 'link' );
Expand Down
15 changes: 15 additions & 0 deletions docs/internal-developers/testing/releases/876.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Testing notes and ZIP for release 8.7.6

Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/10134947/woocommerce-gutenberg-products-block.zip)

## Feature plugin and package inclusion in WooCommerce

### Mini Cart block: fix compatibility with Page Optimize and Product Bundles plugins [#7794](https://github.com/woocommerce/woocommerce-blocks/pull/7794) [#7813](https://github.com/woocommerce/woocommerce-blocks/pull/7813)

1. Install [Page Optimize](https://wordpress.org/plugins/page-optimize/) and [Product Bundles](https://woocommerce.com/products/product-bundles/).
2. Enable a block theme.
3. Customize the block theme and add the Mini Cart block in the header via Site Editor.
4. Save the changes.
5. In the frontend, lick on the Mini Cart. The drawer should open and show the "empty cart" message.
6. Go to the shop page and add a product to your cart.
7. Click on the Mini Cart. The drawer should open and show the product you just added.
1 change: 1 addition & 0 deletions docs/internal-developers/testing/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Every release includes specific testing instructions for new features and bug fi
- [8.7.3](./873.md)
- [8.7.4](./874.md)
- [8.7.5](./875.md)
- [8.7.6](./876.md)

<!-- FEEDBACK -->

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "8.7.5",
"version": "8.7.6",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 6.0
Tested up to: 6.0
Requires PHP: 7.0
Stable tag: 8.7.5
Stable tag: 8.7.6
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -80,6 +80,13 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/

== Changelog ==

= 8.7.6 - 2022-12-01

#### Bug Fixes

- Mini Cart block: fix compatibility with Page Optimize and Product Bundles plugins [#7794](https://github.com/woocommerce/woocommerce-blocks/pull/7794)
- Mini Cart block: Load wc-blocks-registry package at the page's load instead of lazy load it [#7813](https://github.com/woocommerce/woocommerce-blocks/pull/7813)

= 8.7.5 - 2022-10-31 =

#### Enhancements
Expand Down
4 changes: 2 additions & 2 deletions src/BlockTypes/MiniCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function get_block_type_script( $key = null ) {
$script = [
'handle' => 'wc-' . $this->block_name . '-block-frontend',
'path' => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
'dependencies' => [],
'dependencies' => [ 'wc-blocks-registry' ],
];
return $key ? $script[ $key ] : $script;
}
Expand Down Expand Up @@ -273,7 +273,7 @@ protected function append_script_and_deps_src( $script ) {
}
}
}
if ( ! $script->src ) {
if ( ! $script->src || 'wc-blocks-registry' === $script->handle ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static function container( $reset = false ) {
NewPackage::class,
function ( $container ) {
// leave for automated version bumping.
$version = '8.7.5';
$version = '8.7.6';
return new NewPackage(
$version,
dirname( __DIR__ ),
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-gutenberg-products-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Blocks
* Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
* Description: WooCommerce blocks for the Gutenberg editor.
* Version: 8.7.5
* Version: 8.7.6
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block
Expand Down