-
Notifications
You must be signed in to change notification settings - Fork 219
Update the Interactivity API files to include latest changes #9924
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/interactivity/directives.js
assets/js/interactivity/hooks.js assets/js/interactivity/router.js assets/js/interactivity/utils.js assets/js/interactivity/vdom.js |
Size Change: -221 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
I don't think the server-side rendering implementation is ready to be used in production. |
I removed all files related to directive processing during SSR-ing. The |
Thanks David! 🙂 |
I think this is ready for review again. 🙂 |
I almost forgot to replicate the changes @danielwrobert did to adjust JSON escaping for the Store script. 😄 Added in e0a3e8d. |
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.
LGTM! Thanks David 🎉
@gigitux could you please also take a look at it? |
Oh, @DAreRodz, would you mind doing that change in Gutenberg as well? Thanks!! 🙏 |
Luigi, feel free to ping someone else if you feel they need to review these changes. 😊 |
}, | ||
output: { | ||
filename: 'woo-directives-[name].js', |
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.
Is there a specific reason for this change?
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.
It's just that I changed the name to make it consistent with the format used in other WooCommerce scripts in the repository. Nothing important. 😄
Note that there's still a WooCommerce prefix in that file; the name of the output file has turned from woo-directives-runtime.js
to wc-interactivity.js
.
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 also removed the vendors
chunk, so I saw it unnecessary to differentiate between runtime
and vendors
.
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.
LGTM! I'm just curious about a change, but let's 🚢 it!
Thanks, folks, for the reviews. PR merged. 🚀 |
What?
Updates all files related to the Interactivity API.
Tracking issue: woocommerce/woocommerce#42486
Why?
To maintain it updated, and thus be able to start using it in blocks (e.g. the "Add to cart" block).
How?
The JS runtime code comes from WordPress/block-interactivity-experiments, but the PHP one comes from WordPress/gutenberg (more precisely, from the
interactivity
branch).All prefixes related to
wp
andgutenberg
were replaced withwc
andwoocommerce
ones.There is also some custom code to register the Interactivity API runtime script.
Testing instructions
You can check the Simple Price Filter block using the updated Interactivity API in the next PR: