New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Add processing directives without namespace and with empty namespace #6262
Draft: Add processing directives without namespace and with empty namespace #6262
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
@@ -491,7 +491,7 @@ private function data_wp_interactive_processor( WP_Interactivity_API_Directives_ | |||
* independently of whether the previous `data-wp-interactive` definition | |||
* contained a valid namespace. | |||
*/ | |||
$new_namespace = null; | |||
$new_namespace = 'WP'; |
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.
Can you clarify how this change fixes the problem? Difficult to understand from looking at the surrounding code, and it seems such a simple change. To be fair, I'm not very familiar with the underlying code :)
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.
How does this change impact accessing the context on the client?
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 should change the impact, rather than anyone can access namespaces not defined with this default one.
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.
Can you clarify how this change fixes the problem? Difficult to understand from looking at the surrounding code, and it seems such a simple change. To be fair, I'm not very familiar with the underlying code :)
The directives were not being processed cause they expected non empty string as a namespace. While reading the data-wp-interactive
attribute, we are returning a boolean in case is not defined data-wp-interactive
or an empty string.
Adding a default one would fix it (my tests are running OK in local, not here 🤔 ), but it is not a good solution. That's why I wanted to check with @DAreRodz too 😅
Hey @c4rl0sbr4v0, thanks for catching this and working on a fix 🙂 This bug is definitely my fault, but I don't think using The server directive processing should work without a default namespace. If this is failing because the functions/helpers are not expecting |
Let's close this one and work on a proper solution. |
POC after this conversation:
#5795 (comment)
cc: @felixarntz
Trac ticket:
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.