-
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
Deprecate registry.use() and update internal implementations #11449
Comments
As discussed with @coderkevin in private chat I closed initial work in #12004. He is not going to work on it until we have a clear path how to proceed further. As soon as there is an agreement on the final shape of this proposal, he is happy to reopen the PR and help to land it. |
@youknowriad or @aduth - should we close this issue? |
I still think it should be done :) but we can discuss it. |
The introduction of "parent" registries (#14369) has an impact here as well, since it made for some challenges with pluggable behavior taking effect across stores (#14634). In the case of persistence, it may arguably be desirable for a behavior to only take effect on the top-level store. It could probably be implemented differently than the I'm coming around to the idea of deprecating |
I ended up in this issue after a long rabbit hole. Essentially, the newer registration methods ( Looping in @talldan, @jsnajdr, and @adamziel I brought this up a while ago in a separate conversation, so maybe we can continue thinking about it now! As far as I can tell, the persistence plugin overrides the gutenberg/packages/data/src/plugins/persistence/index.js Lines 175 to 223 in 4e343bd
This essentially means that the persistence plugin only supports the now deprecated registration method. Since it seems there was a lot of conversations about deprecating use completely, I'm curious what the path forward should be. I think enabling local storage persistence is worthwhile in wp data. Currently, there is not a documented, un-deprecated way to accomplish that. (The documented ways are all deprecated (but the docs haven't been updated), and while a persistence layer concept was introduced, it's only available in the preferences store.) Curious for thoughts on this :) |
I think there's a documented undeprecated way of persisting data. It's the preferences package. It might require some refactoring if you're coming from the old persistence plugin (as it's not automatic) but I think it's a better approach overall. |
Right, I did see that. I definitely see how it could replace persistence functionality, but it also doesn't seem like a replacement for full persistence of a redux store. But your thought would be to rewrite any data store using the persistence plugin to instead operate via global app preferences? |
yes, that's my thinking. The redux store has been initially designed to be an internal implementation detail but the "use" API kind of defeated that purpose. |
Another way how to make the persistence plugin compatible with the |
As per the discussion in PR #10289, a follow-up PR is needed to deprecate the
registry.use()
function in favor of usingregisterGenericStore
instead to implement the functionality needed for internal wp.data plugins.See the wp.data readme for more details on implementation.
The text was updated successfully, but these errors were encountered: