From 531f8841024d68e272b9e4a05bae3cf3805565ac Mon Sep 17 00:00:00 2001 From: Pablo Pettinari Date: Thu, 21 May 2026 14:58:10 +0200 Subject: [PATCH] refactor(IssuesList): self-fetch GFIs, remove MDX scope plumbing IssuesList now fetches getGFIs() internally as an async Server Component, replacing the gfissues MDX scope variable that the slug route previously injected at compile time. Also swaps the direct react-emoji-render import for the canonical @/components/Emoji wrapper used by every other consumer. Drops the now-unused scope parameter from getPageData and compile, along with the gfissues fetch + try/catch from the slug route. Find/replaces -> across the English source and 24 translated copies of contributing/index.md. Preliminary to the Velite MDX precompile migration, where MDX scope variables don't fit the precompiled model. --- app/[locale]/[...slug]/page.tsx | 13 +------------ public/content/contributing/index.md | 2 +- .../translations/ar/contributing/index.md | 2 +- .../translations/bn/contributing/index.md | 2 +- .../translations/cs/contributing/index.md | 2 +- .../translations/de/contributing/index.md | 2 +- .../translations/es/contributing/index.md | 2 +- .../translations/fr/contributing/index.md | 2 +- .../translations/hi/contributing/index.md | 2 +- .../translations/id/contributing/index.md | 2 +- .../translations/it/contributing/index.md | 2 +- .../translations/ja/contributing/index.md | 2 +- .../translations/ko/contributing/index.md | 2 +- .../translations/mr/contributing/index.md | 2 +- .../translations/pl/contributing/index.md | 2 +- .../translations/pt-br/contributing/index.md | 2 +- .../translations/ru/contributing/index.md | 2 +- .../translations/sw/contributing/index.md | 2 +- .../translations/ta/contributing/index.md | 2 +- .../translations/te/contributing/index.md | 2 +- .../translations/tr/contributing/index.md | 2 +- .../translations/uk/contributing/index.md | 2 +- .../translations/ur/contributing/index.md | 2 +- .../translations/vi/contributing/index.md | 2 +- .../translations/zh-tw/contributing/index.md | 2 +- .../translations/zh/contributing/index.md | 2 +- src/components/IssuesList/index.tsx | 16 ++++++++++++---- src/lib/md/compile.ts | 3 --- src/lib/md/data.ts | 3 --- 29 files changed, 38 insertions(+), 47 deletions(-) diff --git a/app/[locale]/[...slug]/page.tsx b/app/[locale]/[...slug]/page.tsx index d540d1e0b94..a6cc2d63d40 100644 --- a/app/[locale]/[...slug]/page.tsx +++ b/app/[locale]/[...slug]/page.tsx @@ -6,7 +6,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { GHIssue, SlugPageParams } from "@/lib/types" +import type { SlugPageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" import mdComponents from "@/components/MdComponents" @@ -19,7 +19,6 @@ import { checkPathValidity, getPostSlugs } from "@/lib/utils/md" import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import { topics } from "@/data/topics" -import { getGFIs } from "@/data-layer" import SlugJsonLD from "./page-jsonld" @@ -40,13 +39,6 @@ export default async function Page(props: { params: Promise }) { // Enable static rendering setRequestLocale(locale) - let gfissues: GHIssue[] = [] - try { - gfissues = (await getGFIs()) ?? [] - } catch (error) { - console.warn("Failed to fetch GFIs for slug page:", error) - } - const slug = slugArray.join("/") const { @@ -62,9 +54,6 @@ export default async function Page(props: { params: Promise }) { slug, baseComponents: { ...mdComponents, VideoWatch }, componentsMapping, - scope: { - gfissues, - }, }) // Determine the actual layout after we have the frontmatter diff --git a/public/content/contributing/index.md b/public/content/contributing/index.md index bb32def3127..eade8f74143 100644 --- a/public/content/contributing/index.md +++ b/public/content/contributing/index.md @@ -47,7 +47,7 @@ Any questions? 🤔 Join our [Discord server](https://discord.gg/ethereum-org) These are few current tasks that you could help us solve and take responsibility for. For most you will need GitHub account as most changes to the website are made through GitHub. - + See all tasks diff --git a/public/content/translations/ar/contributing/index.md b/public/content/translations/ar/contributing/index.md index af938ea3ce3..13c083601f0 100644 --- a/public/content/translations/ar/contributing/index.md +++ b/public/content/translations/ar/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org هو مشروع مفتوح المصدر يضم **أكثر من 12,0 هذه بعض المهام الحالية التي يمكنك مساعدتنا في حلها وتحمل المسؤولية عنها. بالنسبة لأغلب المستخدمين، ستحتاج إلى حساب غيت هاب، حيث يتم إجراء معظم التغييرات على موقع الويب من خلال غيت هاب. - + عرض كل المهام diff --git a/public/content/translations/bn/contributing/index.md b/public/content/translations/bn/contributing/index.md index 118d77c1aa8..79bde5b3a98 100644 --- a/public/content/translations/bn/contributing/index.md +++ b/public/content/translations/bn/contributing/index.md @@ -46,7 +46,7 @@ Ethereum.org হলো একটি ওপেন-সোর্স পরিচা এগুলো হলো বর্তমানের কিছু কাজ যা সমাধানে আপনি আমাদের সাহায্য করতে পারেন এবং দায়িত্ব নিতে পারেন। এগুলোর বেশিরভাগের জন্যই আপনার একটি GitHub একাউন্ট প্রয়োজন হবে, কারণ ওয়েবসাইটের বেশিরভাগ পরিবর্তন GitHub-এর মাধ্যমে করা হয়। - + সব কাজ দেখুন diff --git a/public/content/translations/cs/contributing/index.md b/public/content/translations/cs/contributing/index.md index 8a8ab3de386..587e5005d9c 100644 --- a/public/content/translations/cs/contributing/index.md +++ b/public/content/translations/cs/contributing/index.md @@ -51,7 +51,7 @@ Nějaké dotazy? 🤔 Připojte se na náš [server na Discordu](https://discord Toto je několik aktuálních úkolů, které byste nám mohli pomoci vyřešit a převzít za ně odpovědnost. Pro většinu z nich budete potřebovat GitHub účet, protože většina změn na webu se provádí prostřednictvím GitHubu. - + Zobrazit všechny úkoly diff --git a/public/content/translations/de/contributing/index.md b/public/content/translations/de/contributing/index.md index 8d6897a6c1c..2fa2ef610a4 100644 --- a/public/content/translations/de/contributing/index.md +++ b/public/content/translations/de/contributing/index.md @@ -46,7 +46,7 @@ Haben Sie Fragen? 🤔 Treten Sie unserem [Discord-Server](https://discord.gg/et Dies sind einige aktuelle Aufgaben, bei deren Lösung Sie uns helfen und für die Sie Verantwortung übernehmen können. Für die meisten benötigen Sie ein GitHub-Konto, da die meisten Änderungen an der Website über GitHub vorgenommen werden. - + Alle Aufgaben ansehen diff --git a/public/content/translations/es/contributing/index.md b/public/content/translations/es/contributing/index.md index 5530aefd55f..4cb53f761b2 100644 --- a/public/content/translations/es/contributing/index.md +++ b/public/content/translations/es/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org es un proyecto de código abierto gestionado por más de **12 000** Estas son algunas tareas actuales de las que podría encargarse y ayudarnos a resolver. Para la mayoría necesitará una cuenta de GitHub, ya que muchos de los cambios al sitio se hacen a través de GitHub. - + Ver todas las tareas diff --git a/public/content/translations/fr/contributing/index.md b/public/content/translations/fr/contributing/index.md index 5c92858687c..90b5d8b3e45 100644 --- a/public/content/translations/fr/contributing/index.md +++ b/public/content/translations/fr/contributing/index.md @@ -45,7 +45,7 @@ Vous avez des questions ? 🤔 Rejoignez notre [serveur Discord](https://discord Il s'agit de quelques tâches actuelles que vous pourriez nous aider à résoudre et dont vous pourriez prendre la responsabilité. Pour la plupart, vous aurez besoin d'un compte GitHub, car la plupart des modifications du site web sont effectuées via GitHub. - + Voir toutes les tâches diff --git a/public/content/translations/hi/contributing/index.md b/public/content/translations/hi/contributing/index.md index d5b0ea54d2e..bb8b83cd5a7 100644 --- a/public/content/translations/hi/contributing/index.md +++ b/public/content/translations/hi/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org एक ओपन-सोर्स प्रोजेक्ट है ये कुछ मौजूदा कार्य हैं जिन्हें हल करने और जिनकी जिम्मेदारी लेने में आप हमारी मदद कर सकते हैं। अधिकांश के लिए आपको गिटहब खाते की आवश्यकता होगी क्योंकि वेबसाइट में अधिकांश परिवर्तन गिटहब के माध्यम से किए जाते हैं। - + सभी कार्य देखें diff --git a/public/content/translations/id/contributing/index.md b/public/content/translations/id/contributing/index.md index 570366ead30..203aa58ad6d 100644 --- a/public/content/translations/id/contributing/index.md +++ b/public/content/translations/id/contributing/index.md @@ -46,7 +46,7 @@ Ada pertanyaan? 🤔 Bergabunglah dengan [server Discord](https://discord.gg/eth Berikut adalah beberapa tugas saat ini yang dapat Anda bantu selesaikan dan ambil tanggung jawabnya. Untuk sebagian besar tugas, Anda akan memerlukan akun GitHub karena sebagian besar perubahan pada situs web dilakukan melalui GitHub. - + Lihat semua tugas diff --git a/public/content/translations/it/contributing/index.md b/public/content/translations/it/contributing/index.md index 734b0201c1d..c6fb2f2ed9f 100644 --- a/public/content/translations/it/contributing/index.md +++ b/public/content/translations/it/contributing/index.md @@ -46,7 +46,7 @@ Hai domande? 🤔 Unisciti al nostro [server Discord](https://discord.gg/ethereu Questi sono alcuni compiti attuali che potresti aiutarci a risolvere e di cui potresti assumerti la responsabilità. Per la maggior parte avrai bisogno di un account GitHub, poiché la maggior parte delle modifiche al sito web viene effettuata tramite GitHub. - + Vedi tutti i compiti diff --git a/public/content/translations/ja/contributing/index.md b/public/content/translations/ja/contributing/index.md index 8ddc83dd97a..23d2ef01080 100644 --- a/public/content/translations/ja/contributing/index.md +++ b/public/content/translations/ja/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.orgはオープンソースで運営されているプロジェクト 現在、解決を手伝っていただきたいタスクがいくつかあります。 変更のほとんどは、GitHubを通じて行われるため、GitHubアカウントが必要になります。 - + すべてのタスクを見る diff --git a/public/content/translations/ko/contributing/index.md b/public/content/translations/ko/contributing/index.md index 1d24dbd6656..6536361234f 100644 --- a/public/content/translations/ko/contributing/index.md +++ b/public/content/translations/ko/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org는 웹사이트의 번역, 집필, 디자인 및 유지 관리를 다음은 여러분이 해결을 돕고 담당할 수 있는 몇 가지 현재 작업입니다. 웹사이트에 대한 대부분의 변경 사항은 GitHub를 통해 이루어지므로 대부분의 경우 GitHub 계정이 필요합니다. - + 모든 작업 보기 diff --git a/public/content/translations/mr/contributing/index.md b/public/content/translations/mr/contributing/index.md index 5c60d520c2c..a1bab2a4a37 100644 --- a/public/content/translations/mr/contributing/index.md +++ b/public/content/translations/mr/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org हा एक ओपन-सोर्स चालवला जा ही काही सध्याची कामे आहेत जी तुम्ही आम्हाला सोडविण्यात मदत करू शकता आणि त्यांची जबाबदारी घेऊ शकता. बहुतेक कामांसाठी तुम्हाला GitHub खात्याची आवश्यकता असेल कारण वेबसाइटमधील बहुतेक बदल GitHub द्वारे केले जातात. - + सर्व कामे पहा diff --git a/public/content/translations/pl/contributing/index.md b/public/content/translations/pl/contributing/index.md index 1802812b6a8..a11524123f5 100644 --- a/public/content/translations/pl/contributing/index.md +++ b/public/content/translations/pl/contributing/index.md @@ -51,7 +51,7 @@ Jakieś pytania? 🤔 Dołącz do naszego [serwera Discord](https://discord.gg/e Oto parę aktualnych zadań, które możesz pomóc nam rozwiązać i wziąć za nie odpowiedzialność. Najprawdopodobniej będzie Ci potrzebne konto na GitHubie, ponieważ większość zmian na stronie jest robionych właśnie przez GitHuba. - + Zobacz wszystkie zadania diff --git a/public/content/translations/pt-br/contributing/index.md b/public/content/translations/pt-br/contributing/index.md index 3cba1975d88..987de6ddf62 100644 --- a/public/content/translations/pt-br/contributing/index.md +++ b/public/content/translations/pt-br/contributing/index.md @@ -51,7 +51,7 @@ Alguma dúvida? 🤔 Junte-se ao nosso [servidor do Discord](https://discord.gg/ Estas são algumas tarefas atuais das que você poderia se encarregar e nos ajudar a resolver. Para a maioria delas, você precisará de uma conta no GitHub porque a maior parte das mudanças no site são feitas através do GitHub. - + Ver todas as tarefas diff --git a/public/content/translations/ru/contributing/index.md b/public/content/translations/ru/contributing/index.md index 655a8b8b847..7d19c3974d9 100644 --- a/public/content/translations/ru/contributing/index.md +++ b/public/content/translations/ru/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org — это проект с открытым исходным код Вот несколько текущих задач, в решении которых вы могли бы нам помочь и взять на себя ответственность. Для большинства из них вам понадобится аккаунт на GitHub, так как большинство изменений на сайте вносятся через GitHub. - + Посмотреть все задачи diff --git a/public/content/translations/sw/contributing/index.md b/public/content/translations/sw/contributing/index.md index faf6332c8ad..e3f1b79b5b3 100644 --- a/public/content/translations/sw/contributing/index.md +++ b/public/content/translations/sw/contributing/index.md @@ -51,7 +51,7 @@ Maswali yoyote? 🤔 Jiunge na [seva yetu ya Discord](https://discord.gg/ethereu Hizi ni kazi chache za sasa ambazo unaweza kutusaidia kutatua na kuwajibika nazo. Kwa nyingi utahitaji akaunti ya GitHub kwani mabadiliko mengi kwenye tovuti hufanywa kupitia GitHub. - + Tazama kazi zote diff --git a/public/content/translations/ta/contributing/index.md b/public/content/translations/ta/contributing/index.md index bb56eb8e36f..b01ce7ec3c9 100644 --- a/public/content/translations/ta/contributing/index.md +++ b/public/content/translations/ta/contributing/index.md @@ -46,7 +46,7 @@ Ethereum.org என்பது **12 000+** பங்களிப்பாளர இவை நீங்கள் எங்களுக்குத் தீர்க்கவும் பொறுப்பேற்கவும் உதவக்கூடிய சில தற்போதைய பணிகளாகும். இணையதளத்தில் பெரும்பாலான மாற்றங்கள் GitHub மூலம் செய்யப்படுவதால், பெரும்பாலானவற்றிற்கு உங்களுக்கு GitHub கணக்கு தேவைப்படும். - + அனைத்துப் பணிகளையும் காண்க diff --git a/public/content/translations/te/contributing/index.md b/public/content/translations/te/contributing/index.md index dbd456d08bf..a325d0a8bb4 100644 --- a/public/content/translations/te/contributing/index.md +++ b/public/content/translations/te/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org ఒక ఓపెన్-సోర్స్ ప్రాజెక్ ఇవి పరిష్కరించడంలో మరియు బాధ్యత వహించడంలో మాకు సహాయపడే కొన్ని ప్రస్తుత పనులు. వెబ్‌సైట్‌లో చాలా మార్పులు GitHub ద్వారా చేయబడినందున చాలా మందికి మీకు GitHub ఖాతా అవసరం. - + అన్ని టాస్క్‌లను చూడండి diff --git a/public/content/translations/tr/contributing/index.md b/public/content/translations/tr/contributing/index.md index aaf25ed7088..18e66e0a964 100644 --- a/public/content/translations/tr/contributing/index.md +++ b/public/content/translations/tr/contributing/index.md @@ -51,7 +51,7 @@ Sorunuz mu var? 🤔 [Discord sunucumuza](https://discord.gg/ethereum-org) katı Bunlar, çözmemize yardımcı olabileceğiniz ve sorumluluğunu alabileceğiniz birkaç güncel görevdir. Çoğunuz için GitHub hesabına ihtiyacınız olacak çünkü web sitesi üzerindeki değişikliklerin çoğu GitHub üzerinden yapılıyor. - + Tüm görevleri gör diff --git a/public/content/translations/uk/contributing/index.md b/public/content/translations/uk/contributing/index.md index 329b5af7c6a..dae867c3b08 100644 --- a/public/content/translations/uk/contributing/index.md +++ b/public/content/translations/uk/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org — це проєкт із відкритим вихідним ко Ось кілька поточних завдань, у вирішенні яких ви могли б нам допомогти та взяти на себе відповідальність. Для більшості з них вам знадобиться обліковий запис GitHub, оскільки більшість змін на сайті вносяться через GitHub. - + Переглянути всі завдання diff --git a/public/content/translations/ur/contributing/index.md b/public/content/translations/ur/contributing/index.md index 7b8bc327532..bf1f803077e 100644 --- a/public/content/translations/ur/contributing/index.md +++ b/public/content/translations/ur/contributing/index.md @@ -46,7 +46,7 @@ Ethereum.org ایک اوپن سورس پروجیکٹ ہے جس میں **12,000+* یہ کچھ موجودہ ٹاسکس ہیں جنہیں حل کرنے اور ان کی ذمہ داری لینے میں آپ ہماری مدد کر سکتے ہیں۔ زیادہ تر کے لیے آپ کو GitHub اکاؤنٹ کی ضرورت ہوگی کیونکہ ویب سائٹ میں زیادہ تر تبدیلیاں GitHub کے ذریعے کی جاتی ہیں۔ - + تمام ٹاسکس دیکھیں diff --git a/public/content/translations/vi/contributing/index.md b/public/content/translations/vi/contributing/index.md index ce2557f58f4..6212282c0d4 100644 --- a/public/content/translations/vi/contributing/index.md +++ b/public/content/translations/vi/contributing/index.md @@ -51,7 +51,7 @@ Có thắc mắc? 🤔 Tham gia [máy chủ Discord](https://discord.gg/ethereum Dưới đây là một số nhiệm vụ có sẵn mà bạn có thể giúp chúng tôi làm và nhận việc. Phần lớn yêu cầu bạn có tài khoản GitHub vì hầu hết thay đổi trên trang web được thực hiện qua GitHub. - + Xem tất cả các nhiệm vụ diff --git a/public/content/translations/zh-tw/contributing/index.md b/public/content/translations/zh-tw/contributing/index.md index 84bcd9b502e..34cfa91f62b 100644 --- a/public/content/translations/zh-tw/contributing/index.md +++ b/public/content/translations/zh-tw/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org 是一個開源專案,擁有 **12,000+** 名貢獻者,他們協 目前這裡有些你可以助我們解決並負責的任務。 大致上說你將需要 GitHub 帳戶,因為幾乎所有網站變更都是透過 GitHub 進行的。 - + 查看所有任務 diff --git a/public/content/translations/zh/contributing/index.md b/public/content/translations/zh/contributing/index.md index bf8bb12bad0..2825d07b6ff 100644 --- a/public/content/translations/zh/contributing/index.md +++ b/public/content/translations/zh/contributing/index.md @@ -51,7 +51,7 @@ Ethereum.org 是一个开源项目,有 **12,000** 多名贡献者帮助翻译 这些是你目前可以帮助我们解决和承担的部分任务。 对于大多数用户,你需要 GitHub 帐户,因为对网站的大多数更改都是通过 GitHub 进行的。 - + 查看所有任务 diff --git a/src/components/IssuesList/index.tsx b/src/components/IssuesList/index.tsx index 968e6a81439..cee787051ba 100644 --- a/src/components/IssuesList/index.tsx +++ b/src/components/IssuesList/index.tsx @@ -1,20 +1,28 @@ -import Emoji from "react-emoji-render" - import type { GHIssue } from "@/lib/types" +import Emoji from "@/components/Emoji" + import { cn } from "@/lib/utils/cn" +import { getGFIs } from "@/data-layer" + import { Avatar } from "../ui/avatar" import { Flex, HStack, Stack } from "../ui/flex" import InlineLink from "../ui/Link" import { Tag } from "../ui/tag" type IssuesListProps = { - issues: GHIssue[] className?: string } -const IssuesList = ({ issues, className }: IssuesListProps) => { +const IssuesList = async ({ className }: IssuesListProps) => { + let issues: GHIssue[] = [] + try { + issues = (await getGFIs()) ?? [] + } catch (error) { + console.warn("Failed to fetch GFIs for IssuesList:", error) + } + return (
}) => { let tocNodeItems: TocNodeType[] = [] const tocCallback = (toc: TocNodeType): void => { @@ -57,7 +55,6 @@ export const compile = async ({ options: { parseFrontmatter: true, mdxOptions, - scope, }, }) diff --git a/src/lib/md/data.ts b/src/lib/md/data.ts index c058a798684..a16e05b5448 100644 --- a/src/lib/md/data.ts +++ b/src/lib/md/data.ts @@ -18,7 +18,6 @@ interface GetPageDataParams { baseComponents: MDXRemoteProps["components"] componentsMapping: Record layout?: Layout - scope?: Record } interface PageData { @@ -37,7 +36,6 @@ export async function getPageData({ baseComponents, componentsMapping, layout: layoutFromProps, - scope, }: GetPageDataParams): Promise { const slugArray = slug.split("/") @@ -59,7 +57,6 @@ export async function getPageData({ slugArray, locale, components, - scope, }) // Process TOC items