Conversation
<BlockErrorBoundary showErrorMessage={ false } key={ i }> | ||
{ fill } | ||
</BlockErrorBoundary> |
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.
The goal is that this would catch an error but disregard the message and simply not render it.
We can extend this to only show the error if the current user is an admin.
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.
This implementation looks correct but I wanted to ask if we need to be mindful of slot placement with regards to the slots name. i.e. this one is called OrderReview, but where around the order review is it? Before? After? Within?
Besides Mike's feedback (which I agree with) should we make this an Also, should we add tests for this? |
I'm having second thoughts about this and I'm not sure yet if we're going to use this or not for the sidebar. I have a lot of considerations for this approach, but the goal is to expose the least amount of implementation detail as possible while still giving the flexibility to reorder and insert new things. addFilter('woocommerce/blocks/sidebar', ( Sidebar ) => {
return (
<Sidebar>
<MyView />
<Sidebar.ShippingSummary />
<UseShippingForAll />
<Sidebar.ShippingSelector />
<Sidebar.Coupon />
<Sidebar.Taxes />
<SubscriptionRecurringTotals />
<Sidebar.Totals />
<Sidebar.Button />
</Sidebar>
);
}) However, I'm not sure how will this solution cascade to several plugins, each doing its own ordering that relies on the fact that something comes after If not this, we might need to expose This is just an exploration of the problem and I might post it in a P2 for more in-depth dusscestion. |
Sounds good, I moved back to the |
I'm revisiting this and addressing some feedback. |
669aaca
to
e907807
Compare
Updated this to be named |
e907807
to
0f4146a
Compare
1af5a09
to
29225d7
Compare
0f4146a
to
9c2010f
Compare
29225d7
to
2570cb0
Compare
9c2010f
to
03da827
Compare
/** | ||
* External dependencies | ||
*/ | ||
import { createSlotFill } from 'wordpress-components'; |
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.
Now that plugin area is merged, we can test this.
I suspect it won't work because of this custom wordpress-components
therefore we end up with a different context.
I will try to do some testing.
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.
So I tested this and I was right, it won't work unless we export SlotFillProvider
from our repo.
001e33e
to
48e51a7
Compare
Size Change: +2.46 kB (0%) Total Size: 1.18 MB
ℹ️ View Unchanged
|
ceacd97
to
30c0216
Compare
e1e6b53
to
1327136
Compare
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.
Tested using your instructions and all is well. I am approving this and the subscriptions PR 👍🏻
@@ -95,7 +95,7 @@ public static function register_assets() { | |||
} | |||
|
|||
if ( Package::feature()->is_feature_plugin_build() ) { | |||
$asset_api->register_script( 'wc-blocks-checkout', 'build/wc-blocks-checkout.js', [], false ); | |||
$asset_api->register_script( 'wc-blocks-checkout', 'build/blocks-checkout.js', [], false ); |
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.
wc-blocks-checkout/wc-checkout-block is going to be confusing. Can we be more specific in our naming here somehow?
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.
we discussed naming here, we're trying to avoid conflict with core checkout script and our block checkout, if you have any idea of a good name we can implement it anytime because we still didn't publish this.
This PR Implements a Slot that is rendered in both Cart and Checkout, just after
Totals
section.This slot wrap each fill in an error boundary, so that if a plugin code breaks, it would not affect the block or any other extension hooking into that slot.
Implmentation
Closes #3246
Testing instructions
This is my default export
assets/src/js/index.js
or anywhere in our plugin, add this code