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

Core Data: Restore registerSyncConfigs #66594

Open
Mamaduka opened this issue Oct 30, 2024 · 7 comments
Open

Core Data: Restore registerSyncConfigs #66594

Mamaduka opened this issue Oct 30, 2024 · 7 comments
Assignees
Labels
[Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Package] Core data /packages/core-data [Type] Experimental Experimental feature or API.

Comments

@Mamaduka
Copy link
Member

This is a follow-up task for #65871 (comment).

@Mamaduka Mamaduka added [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Package] Core data /packages/core-data [Type] Experimental Experimental feature or API. labels Oct 30, 2024
@Mamaduka Mamaduka self-assigned this Oct 30, 2024
@youknowriad
Copy link
Contributor

Can you clarify the question here, I'm not sure I understand. registerSyncConfigs calls are calls that should be done when entities are registered basically. Every time a new entity config is added and this entity has a "syncConfig", we should call the register for this entity.

@Mamaduka
Copy link
Member Author

Mamaduka commented Nov 4, 2024

@youknowriad, just looking for the right place to restore it.

  • At a glance, the getEntitiesConfig resolver seems like the right place, but it only has access to dynamically loaded entities.
  • Next, the getEntitiesConfig selector could be used, but as @ellatrix pointed out, selectors are called excessively.

Every time a new entity config is added and this entity has a "syncConfig", we should call the register for this entity.

Based on this description, the addEntities action seems to be in the correct place. But that means we'll also have to run rootEntitiesConfig through it.

P.S. Hope my new ramble makes more sense 😅

@Mamaduka
Copy link
Member Author

Mamaduka commented Nov 26, 2024

@youknowriad, any suggestions here?

@youknowriad
Copy link
Contributor

Based on this description, the addEntities action seems to be in the correct place. But that means we'll also have to run rootEntitiesConfig through it.

This sounds like a good suggestion assuming we don't regress loading performance.

@Mamaduka
Copy link
Member Author

I was thinking more about this, and the getEntitiesConfig seems like a good place for Core entities.

Can you think of any downsides to calling select.getEntitiesConfig inside its resolver?

cc @jsnajdr, @tyxla

@youknowriad
Copy link
Contributor

Why do you think a selector/resolver is a good place to call an action to "register" something? It feels a bit weird no? Anyway, this is all experimental code that might change as well, so don't overthink it too much.

@Mamaduka
Copy link
Member Author

The addEntities would require changing the whole initialization logic for static entities, which I'm worried might affect performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Package] Core data /packages/core-data [Type] Experimental Experimental feature or API.
Projects
None yet
Development

No branches or pull requests

2 participants