-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Interactivity API: Turn named capturing groups back into numbered ones inside toVdom
#61728
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
I've added the cc: @sirreal |
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 didn't test, but the changes look good.
packages/interactivity/src/vdom.ts
Outdated
const namespaceAndPath = | ||
nsPathRegExp.exec( attributeValue ); |
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.
Nit: I don't love this name, maybe regexResult
?
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.
Done in 6456504.
We can leave it bug, I've also added a Gutenberg backport label because it would be nice to get this out in a patch version if there is one. |
…s inside `toVdom` (WordPress#61728) * Back to numbered capturing groups * Change attrValue to attributeValue * Move `attributeValue` initialization * Change `namespaceAndPath` to `regexResult` Co-authored-by: DAreRodz <darerodz@git.wordpress.org> Co-authored-by: sirreal <jonsurrell@git.wordpress.org>
What?
Reverts a recent change in dbf231a that introduced named capturing groups in the RegExp used to parse directive values.
gutenberg/packages/interactivity/src/vdom.ts
Lines 98 to 103 in dbf231a
Why?
According to caniuse.com, named capturing groups have global support of 95.62%. Although the value is quite high, there could be users for whom the Interactivity API does not work just by using this feature.
For instance, global support of Proxy objects is 97.28%.
How?
Using numbered capturing groups instead.