Closed smikitky closed 11 months ago
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
MDN のリンク先が英語版になっている問題を JavaScript のソースコードベースで解消します。
Link
関数は MDX の[]()
構文の実装を置き換えるためのコンポーネントです。その部分に以下のようなコードを追加します。MDN の URL から
en-US
を取り除くことで、基本言語が日本語になっているブラウザからのアクセス、かつ日本語記事が既に存在する場合、自動的にそちらにリダイレクトされるようになります。問題点は 2 個あります。
また MDN の方は我々がやっているような見出し ID の固定をやっていないため、ページ言語が変わることで見出し ID も変わってしまいます。ただし記事内見出しへのリンクはそもそも数が少なく、かつ英語版の時点で既に大半が壊れているようなので、こちらの対処は行わないでいいかなと思います。
MDN 側でまだ和訳が記事の場合、自動的に英語版にフォールバックしてくれることが多いようなのですが、一部、以下のようなエラーページが表示されることもあります。条件は不明です。
ただしこのパターンになる数は非常に少ないようですし、英語記事へのリンクも表示されはしますし、将来は MDN 側で直してくれるかもしれませんので、とりあえずこのままで良いかなと思います。