Support Recursive References in Blocks #13780
lohmander
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It appears this is a topic that has come up several times, e.g., #8741, #3345, #3132. As far as I can tell the typical response has been to use a workaround where you essentially create duplicates of the same block and include it in its child blocks. However when you have multiple mutually referencing blocks—e.g., for a layout builder, you get an exponential increase in blocks which bogs down Payload.
It would appear to me that a cleaner solution—since block references are already supported—would be to simply support self-references. The crux is that currently the blocks are traversed recursively without any recursion stopping criterion, leading to infinite recursion.
What would it take to get around this?
For the type gen, recursive types should work? E.g.,
I'd be willing to take a stab at this, but when naively experimenting I ran into issues with the admin rendering and fetching the row form fields (I believe). Any pointers as to what would need to happen in order for this to work?
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions