Thanks for all this great feedback @jack! (Also, just now fully realizing that you have the @jack handle here which is very cool.
)
I think this is a good concern.
To give a little background: In general, I wasn't trying to invent anything really new here with the basic tree structure. It's an exact mirror of how the tree in the LMDB representation works. I think there's some clear benefit here to initially keeping them the same and then improving them both together in the future since I think long-term we want them to be interoperable.
So that being said, I'd be hesitant to using the general variant schema for the top-level item in the navigator index because I think that invites too much variation. We shouldn't be creating entirely different navigator tree structures for most variants, it's really just an unfortunate necessity of documenting different source languages where you can have entirely different AST for the different languages.
There are other conceivable cases where you would want entirely different tree structures (one based purely on symbol type/hierarchy and not on custom curation has been suggested on the forums a few times) but I don't think we should treat that as a RenderNodeVariant, it should be a different concept.
For example, in a future world where we support localization, I think we would want to introduce a variant schema to the RenderIndex, but it would apply to the existing base trees, not introduce entirely new trees.
Hm I agree it's not great. Any suggestions on alternatives?
Is this close to what you're suggesting?
{
"navigators" : [
{
"identifier": "swift",
"displayName": "Swift",
"nodes" : [
...
]
},
{
"identifier": "occ",
"displayName": "Objective-C",
"nodes" : [
...
]
}
]
}
I agree this is a more flexible and understandable schema. I think I would prefer to leave the overall structure as is though to keep it in sync with the LMDB structure and look to adopting this in a future version of the schema once we've achieved interoperability with the LMDB navigator.
The standard library is 147 KB gzipped and 2.1 MB raw.
@marcus_ortiz do you have any thoughts here?
The current implementation of the navigator in Swift-DocC-Render requires you to switch your current page to Objective-C to see the Objective-C navigator so I think your suggestion is applicable here.
However, because of the RenderNodeVariant schema, when the user switches to Objective-C, the site doesn't need to fetch any additional data to render the Objective-C content and the change is instant. So I think it might create a worse UX if you had to wait to download the Objective-C navigator before displaying it.
Definitely still worth considering moving forward but it seems like a break from the design decisions we arrived at for the RenderNode schema.