Skip to content
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

Make Navigation specific Core Data selectors Private #50372

Closed
getdave opened this issue May 5, 2023 · 0 comments · Fixed by #51413
Closed

Make Navigation specific Core Data selectors Private #50372

getdave opened this issue May 5, 2023 · 0 comments · Fixed by #51413
Assignees
Labels
[Block] Navigation Affects the Navigation Block [Type] Code Quality Issues or PRs that relate to code quality

Comments

@getdave
Copy link
Contributor

getdave commented May 5, 2023

As suggested in the discussion below, let's make the new Navigation-specific selectors added to Core Data private APIs.


I think the block should be able to tell core data "hey I got (somehow) this data which is the entity i want to work with" and core data will adopt that entity (which was not retrieved via a selector/resolver) and then handle edits, undo, updates

I don't think this is an Issue. What you describe is already working today. It's implemented in this PR and the spin off PoC I created. To be clear here is the code:

if ( record ) {
         // This is dispatched to Core Data
	dispatch.receiveEntityRecords(
		'postType',
		'wp_navigation',
		record
	);
}

The selector is block specific and the endpoint is also block specific today (nothing else uses that). It's an utility endpoint created for the navigation block to avoid doing all that on the client. I

This is the point of contention. I don't think it's a major problem to have this selector.

@draganescu In the interests of moving forward would you be open to making it a private selector and then make it public only if/when we confirm that other areas will also require it (for example the Navigation section in the Site View sidebar). We get many benefits by using Core Data here and there are also already many examples of the same pattern in use within Core Data.

Originally posted by @getdave in #50032 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants