#61512 closed enhancement (fixed)
Interactivity API: Use Script Module filter to pass data to the client
Reported by: | jonsurrell | Owned by: | jonsurrell |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 6.6 |
Component: | Interactivity API | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
Proposal: Server to client data sharing for Script Modules describes an API for passing data to Script Modules.
This API was introduced in [58579].
Interactivity API currently uses its own mechanism to do the same thing. Instead of its own implementation, it should use the new Core API.
Change History (6)
This ticket was mentioned in PR #6683 on WordPress/wordpress-develop by @jonsurrell.
6 months ago
#1
@jonsurrell commented on PR #6683:
6 months ago
#2
@luisherranz @cbravobernal @darerodz I'd love to get an Interactivity API review of this 🙏
@jonsurrell commented on PR #6683:
5 months ago
#3
Suggested commit message:
Interactivity API: Use Script Modules filter for store and config data A dedicated API exists for passing data to Script Modules implemented in changeset [58579]. Use this Core API instead of a custom implementation for Interactivity API to pass data to the client. Props jonsurrell, gziolo, luisherranz, cbravobernal. Fixes #61512.
@Bernhard Reiter commented on PR #6683:
5 months ago
#6
Committed to Core in https://core.trac.wordpress.org/changeset/58729.
Note: See
TracTickets for help on using
tickets.
## ⚠️ This is follow-up work to PR #6682.
Use the work in #6682 for Interactivity API script module data (passing store and config data to the client).
Depends on (includes) #6682.
Todo:
This will not work until client scripts are updated. The
@wordpress/interactivity
Script Module was updated in https://github.com/WordPress/gutenberg/pull/61658 to try to get client data from an updated element ID. This requires@wordpress/interactivity@>5.7.0
.Trac ticket: https://core.trac.wordpress.org/ticket/61512