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

Deprecate CrowdinContributors, GitHubContributors #12969

Merged
merged 4 commits into from
May 27, 2024

Conversation

wackerow
Copy link
Member

Sub-branch PR: get-static-contributors <- get-static-contributors-consolidation

Description

  • Deprecates CrowdinContributors and GitHubContributors components in lieu of just using the FileContributors component
  • Builds on server-side logic from Get GitHub file contributors during getStaticProps, cache to avoid rate limit #12942 to compile a single list of contributors that will be passed to the layout and components from [...slug].tsx.
  • For non-English pages, this will be a list of Crowdin contributors; else it will be GitHub contributors
  • Extracts logic into contributors.ts util file

deprecate redundant CrowdinContributors and GitHubContributors components; consolidate logic to gather file contributors list into `utils/contributors.ts` and use to fetch/organize all data in getStaticProps before passing to layout/components.
@github-actions github-actions bot added content 🖋️ This involves copy additions or edits needs review 👀 tooling 🔧 Changes related to tooling of the project labels May 15, 2024
Base automatically changed from get-static-contributors to dev May 22, 2024 09:25
Copy link

netlify bot commented May 22, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 453578b
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/664dbb56e49cbb0008656768
😎 Deploy Preview https://deploy-preview-12969--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 47 (🔴 down 9 from production)
Accessibility: 92 (no change from production)
Best Practices: 89 (🔴 down 9 from production)
SEO: 93 (🔴 down 2 from production)
PWA: -
View the detailed breakdown and full score reports

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

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @wackerow! a very useful refactor.

Left a few minor comments related to the getFileContributorInfo function but nothing blocking.

Comment on lines +19 to +20
locale: string,
fileLang: string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a scenario where these two are different?

Comment on lines +16 to +18
mdDir: string,
mdPath: string,
slug: string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: I see too many args for this function. For example, mdDir and mdPath are derived from slug. Perhaps we could abstract that logic (how to calc mdDir and mdPath) somewhere in the utils and reduce the noise form this function.

IMO, ideally, this function should only require 2 args: slug and locale (the cache is arguable but ok).

slug: string,
locale: string,
fileLang: string,
layout: Layout,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we use this arg to determine whether or not we want to fetch the crowdin contributors. Couldn't we deduce this from the slug? slug.includes("/developers/")

@corwintines corwintines merged commit 6dd2d15 into dev May 27, 2024
10 checks passed
@corwintines corwintines deleted the get-static-contributors-consolidation branch May 27, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants