You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The async url resolvers are current server actions.
This is because the link node type ReactNode resolver relies on these functions for internal links.
The resolvers are server side because they need to fetch a doc to populate doc relationships that might not be there (due to Payload using depth 0 by default).
Finally, CommentSection, a client side component uses serializeLexical which is fully client side except for the link node which is the only async server side resolver.
Some solution ideas:
Payload: If Payload allowed us to populate the url field for internal links at edit time. This way the JSON section for links would be properly self-contained (as is the case for external links). This would allow us to keep link node fully client side solving the problem. However, one issue with this approach is the persisted url would need to be invalidated / updated if the url setter function logic changes.
Avoid calling serializeLexical in client-side components (currently only CommentSection), make the resolution happen at a higher level and pass it down to client side components. Basically, treat serializeLexical as fully server-side only.
The text was updated successfully, but these errors were encountered:
The async
url
resolvers are current server actions.This is because the
link
node type ReactNode resolver relies on these functions for internal links.The resolvers are server side because they need to fetch a doc to populate doc relationships that might not be there (due to Payload using depth 0 by default).
Finally,
CommentSection
, a client side component usesserializeLexical
which is fully client side except for thelink
node which is the only async server side resolver.Some solution ideas:
url
field for internal links at edit time. This way the JSON section for links would be properly self-contained (as is the case for external links). This would allow us to keeplink
node fully client side solving the problem. However, one issue with this approach is the persistedurl
would need to be invalidated / updated if the url setter function logic changes.serializeLexical
in client-side components (currently onlyCommentSection
), make the resolution happen at a higher level and pass it down to client side components. Basically, treatserializeLexical
as fully server-side only.The text was updated successfully, but these errors were encountered: