🚨 Breaking Changes
- sidebar: Update template functions to use destructured parameters - by @enzonotario in #240 (7b96b)
This release introduces a breaking change to improve the developer experience and flexibility of sidebar template functions. We've refactored the function signatures from multiple positional parameters to a single object parameter with named properties.
What Changed
Before (v0.0.3-alpha.81):
sidebarItemTemplate: (method: string, path: string): string => `[${method}] ${path}`,
sidebarGroupTemplate: (path: string, depth: number): string => path,
After (v0.0.3-alpha.82):
sidebarItemTemplate: ({ method, path, title }): string => `[${method}] ${title || path}`,
sidebarGroupTemplate: ({ path, depth }): string => path,
Migration Guide
To update your existing code:
- For
sidebarItemTemplate
: Replace(method, path)
with({ method, path, title })
- For
sidebarGroupTemplate
: Replace(path, depth)
with({ path, depth })