iAPI: Enforce correct namespaces in all places (directives, functions…) that accept a namespace #63749
Open
2 tasks done
Labels
[Feature] Interactivity API
API to add frontend interactivity to blocks.
[Packages] Interactivity
/packages/interactivity
[Type] Bug
An existing feature does not function as intended
Description
Namespaces can only contain alphanumeric characters, hyphens, underscores, and forward slashes, but as of today, we're not ensuring that namespaces have the correct format in all places that accept a namespace (directives, functions…) which could result in some confusion/bugs.
We should review all the code and ensure that an error message is displayed whenever a namespace is not correctly formatted.
In the runtime, to avoid increasing the bundle size, we could perform this check only in development (when the constant
SCRIPT_DEBUG
is true).Reported by @gziolo in Slack.
Step-by-step reproduction instructions
store()
function in JavaScript orwp_interactivity_state()
in PHP.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: