-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
[Feature] Interactivity APIAPI to add frontend interactivity to blocks.API to add frontend interactivity to blocks.[Packages] Interactivity/packages/interactivity/packages/interactivity[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
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).
Step-by-step reproduction instructions
- Try to pass a namespace that does not comply with the format to the
store()
function in JavaScript orwp_interactivity_state()
in PHP. - An error should be displayed.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Metadata
Metadata
Assignees
Labels
[Feature] Interactivity APIAPI to add frontend interactivity to blocks.API to add frontend interactivity to blocks.[Packages] Interactivity/packages/interactivity/packages/interactivity[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended