Skip to content
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

Merged
merged 6 commits into from
Apr 7, 2022
Merged

Conversation

Josh-Cena
Copy link
Collaborator

Breaking change

Tags-related theme components have their props changed. Most notably, name has been renamed as label 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

@Josh-Cena Josh-Cena added the pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. label Apr 6, 2022
@Josh-Cena Josh-Cena requested review from slorber and lex111 as code owners April 6, 2022 05:47
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 6, 2022
@netlify
Copy link

netlify bot commented Apr 6, 2022

[V2]

Name Link
🔨 Latest commit 5d09121
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/624d36bcd68fef00092023d0
😎 Deploy Preview https://deploy-preview-7117--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 60
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

Lighthouse ran on https://deploy-preview-7117--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

Size Change: -127 B (0%)

Total Size: 804 kB

Filename Size Change
website/build/assets/js/main.********.js 610 kB -127 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 49.9 kB
website/build/assets/css/styles.********.css 105 kB
website/build/index.html 38.5 kB

compressed-size-action

@Josh-Cena Josh-Cena added the status: awaiting review This PR is ready for review, will be merged after maintainers' approval label Apr 6, 2022
Copy link
Collaborator

@slorber slorber left a 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'>[];
Copy link
Collaborator

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

Copy link
Collaborator Author

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

Copy link
Collaborator

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

@slorber slorber merged commit 1156be3 into main Apr 7, 2022
@slorber slorber deleted the jc/unify-tags branch April 7, 2022 13:58
@Josh-Cena Josh-Cena removed the status: awaiting review This PR is ready for review, will be merged after maintainers' approval label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: breaking change Existing sites may not build successfully in the new version. Description contains more details.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants