-
Notifications
You must be signed in to change notification settings - Fork 221
Experiment: Add a simple price filter block with directives #8221
Conversation
A plugin for optional chaining is required as the repo uses Webpack 4 for now.
Co-authored-by: Luis Herranz <[email protected]>
get this value from SSR.get this value from SSR.
woocommerce-blocks/assets/js/blocks/simple-price-filter/view.js Lines 36 to 47 in b9519c6
🚀 This comment was generated by the automations bot based on a
|
get this value from DB.get this value from DB.
woocommerce-blocks/src/BlockTypes/SimplePriceFilter.php Lines 25 to 36 in b9519c6
🚀 This comment was generated by the automations bot based on a
|
This reverts commit 7c6cbee.
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/simple-price-filter/index.js
assets/js/blocks/simple-price-filter/view.js |
Size Change: +3.22 kB (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
Move into `WP_HTML_Tag_Processor` (or `WP_HTML_Processor`).Move into `WP_HTML_Tag_Processor` (or `WP_HTML_Processor`). github.com/WordPress/gutenberg/pull/47573.
woocommerce-blocks/src/Interactivity/directives/woo-process-directives.php Lines 64 to 76 in 78b0882
🚀 This comment was generated by the automations bot based on a
|
Implement evaluation of complex logical expressions.Implement evaluation of complex logical expressions.
woocommerce-blocks/src/Interactivity/directives/utils.php Lines 9 to 20 in 78b0882
🚀 This comment was generated by the automations bot based on a
|
Add some directive/components registration mechanism.Add some directive/components registration mechanism.
woocommerce-blocks/src/Interactivity/woo-directives.php Lines 101 to 112 in 78b0882
🚀 This comment was generated by the automations bot based on a
|
Error handling.Error handling.
woocommerce-blocks/src/Interactivity/directives/tags/woo-context.php Lines 16 to 19 in 78b0882
🚀 This comment was generated by the automations bot based on a
|
Error handling.Error handling.
woocommerce-blocks/src/Interactivity/directives/attributes/woo-context.php Lines 16 to 19 in 78b0882
🚀 This comment was generated by the automations bot based on a
|
Do we want to unset styles if they're null? $tags->remove...Do we want to unset styles if they're null? $tags->remove_class( $style_name ); https://github.com/woocommerce/woocommerce-blocks/blob/78b08828b3e638ed0743d73932210770c84d218d/src/Interactivity/directives/attributes/woo-style.php#L25-L30🚀 This comment was generated by the automations bot based on a
|
Move into `WP_HTML_Tag_Processor` (or `WP_HTML_Processor`).Move into `WP_HTML_Tag_Processor` (or `WP_HTML_Processor`). github.com/WordPress/gutenberg/pull/47573.
woocommerce-blocks/src/Interactivity/directives/woo-process-directives.php Lines 64 to 76 in 81cf10e
🚀 This comment was generated by the automations bot based on a
|
Do we want to unset styles if they're null? $tags->remove...Do we want to unset styles if they're null? $tags->remove_class( $style_name ); https://github.com/woocommerce/woocommerce-blocks/blob/81cf10e8d21e1fa87820497ccf5a58a555f85ae6/src/Interactivity/directives/attributes/woo-style.php#L25-L30🚀 This comment was generated by the automations bot based on a
|
check if `wp_footer` is the most appropriate hook.check if `wp_footer` is the most appropriate hook.
woocommerce-blocks/src/Interactivity/woo-directives.php Lines 125 to 126 in 81cf10e
🚀 This comment was generated by the automations bot based on a
|
This bot is making a lot of noise about todo items 😅 |
…-price-filter-block
…-price-filter-block
I know 😓 I'll put extra care not to push TODO comments the next time. In the end, those messages only make sense in the original repository, so removing them here is no problem. |
This PR has been marked as If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label. |
Closing this PR as I created a new one for this demo: #9926 |
What?
This is a simple reimplementation of the Price Filter block using directives to filter a list of products by price.
Tracking issue: woocommerce/woocommerce#42486
Why?
The idea is to test and showcase how a block to filter a list of products would be implemented with directives. Also, to ease a future transition to this new API in case it finally becomes standard.
How?
This PR continues the work on #8026 and implements a new block called Simple Price Filter. The most interesting changes are in:
Video
This is a video recording that shows the block in action. You can see that functionality and appearance is slightly different than the original block, but I think is close enough for this demo.
The URL changes, and the Products list is refreshed, but the page is not reloaded.
Screen.Recording.2023-01-18.at.13.43.55.mov
Next steps