-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(content-{blog,docs}): unify handling of tags #7117
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-7117--docusaurus-2.netlify.app/ |
Size Change: -127 B (0%) Total Size: 804 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -137,7 +137,7 @@ export function toTagDocListProp({ | |||
}: { | |||
allTagsPath: string; | |||
tag: VersionTag; | |||
docs: Pick<DocMetadata, 'id' | 'title' | 'description' | 'permalink'>[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I remember the goal here was to avoid adding all docs attributes to tag pages as only a few attributes are displayed there => reduce tag page load time
in practice it seems doc props were not filtered, so each tag list page receives much more data than it really needs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are always filtered? See the code below. It's just that the function's argument is actually the full doc metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah 🤪 misread the fn signature
Breaking change
Tags-related theme components have their props changed. Most notably,
name
has been renamed aslabel
to align with its server-side metadata.Motivation
We have a lot of duplicated types that only differ slightly. I take this chance to make the tags-related data structures more re-used and more unified between the blog and docs.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
All pages still behave as before