-
Notifications
You must be signed in to change notification settings - Fork 220
Make Mini-Cart block work well with caching plugins #9493
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
assets/js/blocks/mini-cart/utils/test/data.ts
|
Size Change: +1.65 kB (0%) Total Size: 1.09 MB
ℹ️ View Unchanged
|
adf7954
to
4a1da27
Compare
a42a1ee
to
d12e2b7
Compare
d12e2b7
to
2aa687d
Compare
act( () => { | ||
userEvent.click( removeRating4Button ); | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why these tests suddenly stopped passing, so I needed to add atc()
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads-up that I didn't change anything in the code of this file, I just moved it over from assets/js/blocks/mini-cart/frontend.ts
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments! LGTM!
Fixes #9353.
Accessibility
prefers-reduced-motion
Testing
Automated Tests
User Facing Testing
With your admin user:
In a private/incognito window without being logged in:
3. In the frontend visit any page. This will cache the page without products in the cart.
With your admin user:
4. Add some products to your cart.
5. Visit the same page from step 3.
6. Notice the Mini Cart totals do include the products you added in step 4, even though it's serving the cached version of step 3.
WooCommerce Visibility
Performance Impact
This PR adds an extra request to all page views were the Mini-Cart block is present. It also increases a the weight of Mini-Cart block scripts on page load. However, I think the benefits of this outweight the performance impact.
Changelog