-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Refactor internal proxy and signals system #62734
Conversation
Size Change: +5.01 kB (+0.28%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
643b333
to
4b66d89
Compare
Flaky tests detected in ebbe873. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10146436572
|
2f0562a
to
46fa744
Compare
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 left a couple of comments on the technical side of things and pushed a minor commit too.
1997db5
to
2252f8b
Compare
@DAreRodz I have linked this issue to be closed when this pull request is merged with a test that makes sure that plain arrays cannot be used at the root of the context. |
848e40a
to
947b8d8
Compare
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. |
Co-authored-by: Luis Herranz <[email protected]>
3eea771
to
28d329b
Compare
Luis, I've addressed all the actionable feedback you shared. Feel free to take a look at the PR again. 🙂 |
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.
Let's merge this so it can be included in the next release.
I'll add more tests in a new PR to try to ensure we haven't missed anything.
Co-authored-by: luisherranz <[email protected]> Co-authored-by: SantosGuillamot <[email protected]>
What?
The main goal of this refactoring is to have more control when defining state/context properties. The idea is to keep a unique computed for each of these properties per scope, which tracks changes even when its value is replaced with a getter. This way, properties can contain an initial value and be replaced with a getter later on or vice-versa, ensuring that directives update accordingly in this case. This is especially relevant for stores that are loaded asynchronously, like the
core/router
store from the@wordpress/interactivity-router
module.Also, we can take this opportunity to remove an external dependency (deepsignal), keeping the code specific to the Interactivity API and making it more maintainable.
Tasks
peek()
Next
I think these tasks should be addressed in a subsequent PR:
Testing Instructions
No testing instructions yet.