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

Tracking issue: Adding directives to WooCommerce blocks #42486

Open
6 tasks
DAreRodz opened this issue Jan 17, 2023 · 17 comments
Open
6 tasks

Tracking issue: Adding directives to WooCommerce blocks #42486

DAreRodz opened this issue Jan 17, 2023 · 17 comments
Labels
team: Kirigami & Origami WC Store Editing (FSE) type: enhancement The issue is a request for an enhancement.

Comments

@DAreRodz
Copy link
Contributor

DAreRodz commented Jan 17, 2023

This aims to be the tracking issue to follow the progress of including the Interactivity API in some WooCommerce blocks, especially the Product block. As WooCommerce blocks could potentially benefit from this new API, we want to understand what is needed in order to implement some of the blocks using it.

Note that the mentioned API will ideally be included in Gutenberg and WordPress core at some point. However, to start experimenting as soon as possible, we are moving the needed scripts into the repo so we can start testing the API now.

Experiments

Done

In progress

Next

  • Provide APIs to handle different loading states and error handling.
  • Define and add the opt-in mechanism for client-side navigation.
  • Polish and finish the needed directives.
  • Add test coverage.
  • Review the bundling process and ensure we are shipping the Interactivity API correctly.
@DAreRodz
Copy link
Contributor Author

DAreRodz commented Jan 17, 2023

@DAreRodz
Copy link
Contributor Author

I've made some progress with the experiment and recorded a video showing how the simple price filter block behaves now. You can see it in the PR description.

@luisherranz
Copy link
Contributor

Let's try using data-woo- to see how it feels like.

Ref: WordPress/block-interactivity-experiments#132

@luisherranz
Copy link
Contributor

Let's try using wooStore instead of woox as well.

Ref: WordPress/block-interactivity-experiments#136

@DAreRodz
Copy link
Contributor Author

@DAreRodz
Copy link
Contributor Author

DAreRodz commented Jan 26, 2023

I've added a link to an experiment that shows how to use the Interactivity API for filters with multiple product query blocks.

Remember that it's still WIP 🚧, as it depends on WordPress/block-interactivity-experiments#139 to be finished and merged.

I'll work on documenting everything as well once the code is ready.

@DAreRodz
Copy link
Contributor Author

I've started working on replacing all the wp- prefixes with woo ones. It's still a draft because it depends on WordPress/block-interactivity-experiments#142 to be approved and merged.

Also, I've updated both demos to use these changes, so now directives start with data-woo instead of wp.

@DAreRodz
Copy link
Contributor Author

BTW, I forgot to mention that the Stackblitz - Interactivity API demo: filters with multiple product queries demo is working now.

I still have to document it, but you can take a look at the code already if you want. 😄

@DAreRodz
Copy link
Contributor Author

DAreRodz commented Feb 3, 2023

Another update:

@DAreRodz
Copy link
Contributor Author

Quick update:

The changes for the directives prefix have been recently merged:

The PR that adds store serialization and hydration (among other things) is ready to review:

@DAreRodz
Copy link
Contributor Author

Forgot to mention that I also updated woocommerce/woocommerce-blocks#8221 (the Simple Price Filter demo) with the latest changes in woocommerce/woocommerce-blocks#8447. 🙂

@DAreRodz
Copy link
Contributor Author

Sorry for the long silence here. 😅

A while ago, I started working on woocommerce/woocommerce-blocks#8524 to make the Filter blocks start using the Interactivity API, which will close issue woocommerce/woocommerce-blocks#8456.

It got stale because it depended on WordPress/block-interactivity-experiments#163, which is already implemented and merged. I'll move those changes to woocommerce/woocommerce-blocks#8524 and continue working on the remaining tasks there. 🙂

@DAreRodz
Copy link
Contributor Author

DAreRodz commented Jun 20, 2023

I've finished updating the Interactivity API code inside WooCommerce blocks. This is the PR for these changes, ready for review.

I also created a new PR for the Simple Price Filter block, showcasing how to use the updated Interactivity API in blocks. The old one is closed.

@DAreRodz
Copy link
Contributor Author

I've opened a PR implementing server-side-rendered updates for interactive regions during client-side navigation.

I also updated the Tracking Issue description to reflect the current status.

@DAreRodz
Copy link
Contributor Author

DAreRodz commented Sep 5, 2023

The Woo team has started working on the Filter blocks and created their own Epic:

I decided to close the related issue and PR we created a while ago, as the work there was unfinished.

@DAreRodz
Copy link
Contributor Author

DAreRodz commented Oct 4, 2023

Heads up, we have started working on the new store() API, as proposed in WordPress/gutenberg#53586. The work is being tracked here:

@nerrad nerrad added the team: Kirigami & Origami WC Store Editing (FSE) label Nov 21, 2023
@DAreRodz
Copy link
Contributor Author

I forgot to announce that the new Interactivity store() API was finally implemented, and interactive blocks were migrated to the new API.

Now, the Frontend Filters improvements can benefit from these changes. 😊

@ObliviousHarmony ObliviousHarmony transferred this issue from woocommerce/woocommerce-blocks Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: Kirigami & Origami WC Store Editing (FSE) type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

3 participants