@@ -21,13 +21,20 @@ const ReleaseCodeBox: FC = () => {
2121 const t = useTranslations ( ) ;
2222
2323 useEffect ( ( ) => {
24- const updatedCode = getNodeDownloadSnippet ( release , os , t ) [ platform ] ;
25- // Docker and NVM support downloading tags/versions by their full release number
26- // but usually we should recommend users to download "major" versions
27- // since our Download Buttons get the latest minor of a major, it does make sense
28- // to request installation of a major via a package manager
29- memoizedShiki . then ( shiki => shiki ( updatedCode , 'bash' ) ) . then ( setCode ) ;
30- // Only react when the specific release number changed
24+ async function getSnippet ( ) {
25+ const [ shiki , { [ platform ] : updatedCode } ] = await Promise . all ( [
26+ memoizedShiki ,
27+ getNodeDownloadSnippet ( release , os , t ) ,
28+ ] ) ;
29+
30+ // Docker and nvm support downloading tags/versions by their full release number
31+ // but usually we should recommend users to download "major" versions since
32+ // our Download Buttons get the latest minor of a major, it does make sense
33+ // to request installation of a major via a package manager
34+ setCode ( await shiki ( updatedCode , 'bash' ) ) ;
35+ // Only react when the specific release number changed
36+ }
37+ getSnippet ( ) ;
3138 // eslint-disable-next-line react-hooks/exhaustive-deps
3239 } , [ release . versionWithPrefix , os , platform ] ) ;
3340
0 commit comments