Open Mamaduka opened 3 months ago
useQuerySelect
never became a public API, right? Given that we only have internal usage, porting it will be relatively straightforward. With that in mind, the cost of removing it will be very little.
I actually find it better to use useSelect
and to transparently query only for the selector resolution state that we'll actually use rather than querying it regardless of whether we're going to use it.
Furthermore, I think removing it will allow us to remove the last usage of memize
and get rid of it as a dependency of the @wordpress/core-data
package.
The only downside is that it might make the underlying useResourcePermissions
and useEntityRecords
code more complex. But it also makes us think - do we really need to always provide the resolution data alongside the actual permission data? Maybe we do, but in many other cases, we don't, so it's a good time to double-check our assumptions there.
useQuerySelect never became a public API, right?
Yes, it's an internal/private API.
do we really need to always provide the resolution data alongside the actual permission data?
I can't think of any use case in the core when resolution status might be needed with permissions data. Usually, permissions return values act as resolutions. But we can't change that now since it's a public API.
This is a proposal to remove the
useQuerySelect
hook, which was proposed in #38134 and used internally by theuseEntityRecord(s)
anduseResourcePermissions
public APIs.The intention was to make it easier to query
core
data and its meta selectors. But it seems people (including me) are more comfortable working with plain olduseSelect
.Example: A second store subscription for the
useEntityRecord
and theuseEntityRecords
hooks.cc @adamziel, @gziolo, @jsnajdr, @tyxla, @youknowriad