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
In #728, Proxy/Proxy/* handler traps are nested under the Proxy() constructor entry in the JS reference sidebar. The implementation is Proxy-specific: a handler_methods field on JSRefItem, populated only when obj == "Proxy" by walking get_sub_pages for Proxy/Proxy.
Idea
Constructor / method / property pages can have their own sub-pages, and those should nest below the parent entry in the sidebar — regardless of which class they belong to. Today this matters for:
Intl/Segmenter/segment/Segments (and Segments/containing, Segments/[Symbol.iterator]) — a method whose return-type class is documented as a sub-page. Currently surfaced as a separate sidebar item via special cases in slug_to_object_name and GROUP_DATA in crates/rari-doc/src/sidebars/jsref.rs.
Possible approaches
Recurse get_sub_pages in JSRefItem::from_obj_str, attach sub-pages as MetaChildren::Children to each entry. Explicit, keeps the existing rendering path, more code.
Use MetaChildren::ListSubPages { nested: true, depth: None } on every entry. Minimal code (delegates fetching + rendering to the sidebar layer), but nested <details> rendering depends on fix(sidebar): render nested subpages as details #654.
Either approach should also retire the Intl/Segmenter/segment/Segments special case in slug_to_object_name and get_group.
Background
In #728,
Proxy/Proxy/*handler traps are nested under theProxy()constructor entry in the JS reference sidebar. The implementation is Proxy-specific: ahandler_methodsfield onJSRefItem, populated only whenobj == "Proxy"by walkingget_sub_pagesforProxy/Proxy.Idea
Constructor / method / property pages can have their own sub-pages, and those should nest below the parent entry in the sidebar — regardless of which class they belong to. Today this matters for:
Proxy/Proxy/*— handler traps as sub-pages of the constructor (handled in fix(jsref): nest member sub-pages in the JS reference sidebar #728 via a special case)Intl/Segmenter/segment/Segments(andSegments/containing,Segments/[Symbol.iterator]) — a method whose return-type class is documented as a sub-page. Currently surfaced as a separate sidebar item via special cases inslug_to_object_nameandGROUP_DATAincrates/rari-doc/src/sidebars/jsref.rs.Possible approaches
get_sub_pagesinJSRefItem::from_obj_str, attach sub-pages asMetaChildren::Childrento each entry. Explicit, keeps the existing rendering path, more code.MetaChildren::ListSubPages { nested: true, depth: None }on every entry. Minimal code (delegates fetching + rendering to the sidebar layer), but nested<details>rendering depends on fix(sidebar): render nested subpages as details #654.Either approach should also retire the
Intl/Segmenter/segment/Segmentsspecial case inslug_to_object_nameandget_group.Related
<details>rendering for nestedlistSubPages, prerequisite for approach (2)