-
Notifications
You must be signed in to change notification settings - Fork 219
Interactivity API: implement the new store()
API
#11065
Comments
We need to think about this one. As of now, my only idea is to make the usage import { options } from "deepsignal";
options.computedGetters = false; It's kind of a shame because when the value doesn't depend on the scope (context, element state, element ref), the |
As we're going to be proxying state anyway, maybe we could detect getters on our side and if they are run inside of a scope, move them to a map and wrap them with computeds ourselves. I'll try that in the next days 🙂 |
It worked fine. I commented on the PR: |
Now that this is completed, we've added a list of tasks for the next steps to the Gutenberg's Tracking Issue: We can keep using this Tracking Issue to keep track of the individual tasks that we need to accomplish in Woo, like the migration of the different blocks. Our next step is to open a PR with the new |
Okay, now that that is completed, the next task is to migrate all the existing blocks:
@DAreRodz and I will take care of the Product Button and Products Collection blocks, and we'll help the Woo team with the rest of the blocks. Once we've merged the
@sunyatasattva could you please take a look and update the list of blocks if necessary? |
All the migration work is done (only awaiting approval in #11071 and e2e tests to be fixed). As a wrap-up, I'll summarize the tasks for subsequent PRs and all the notes left in the comments―all related to the Interactivity API runtime. Tasks
Notes
cc: @luisherranz |
This tracking issue lists all the requirements to implement the new
store()
API, which is the Interactivity API's state manager.The whole API proposal is extensively detailed in WordPress/gutenberg#53586, and the idea is to first develop
store()
here in WooCommerce Blocks and, once most of the API is tested and functioning, move all the code to Gutenberg and add proper, automated testing, documentation, etc.This feature is being implemented in the following PR:
store()
API #11071You can check an example of the Product Button using it in the following branch:
interactivity-api-refactor-product-button-with-new-store-api
Tasks
data-wp-interactive
store()
are typedcontext
orref
should be accessed inside the functionsstate
oractions
)getElement()
) New Interactivity `store()` API proposal WordPress/gutenberg#53586 (reply in thread)Migration
store()
API #11558The text was updated successfully, but these errors were encountered: