Skip to content

Commit ff8a748

Browse files
committed
prevent multiple shiki instances
1 parent 1039903 commit ff8a748

File tree

4 files changed

+30
-23
lines changed

4 files changed

+30
-23
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@astrojs/sitemap": "^3.3.1",
3838
"@astrojs/tailwind": "^5.1.5",
3939
"@fontsource-variable/inter": "^5.2.5",
40-
"astro": "^5.7.10",
40+
"astro": "^5.7.11",
4141
"astro-embed": "^0.9.0",
4242
"astro-expressive-code": "^0.41.2",
4343
"astro-icon": "^1.1.5",
@@ -47,7 +47,7 @@
4747
"clsx": "^2.1.1",
4848
"date-fns": "^4.1.0",
4949
"dotenv": "^16.5.0",
50-
"feed": "^4.2.2",
50+
"feed": "^5.0.0",
5151
"giscus": "^1.6.0",
5252
"github-slugger": "^2.0.0",
5353
"lodash.debounce": "^4.0.8",
@@ -80,7 +80,7 @@
8080
"@typescript-eslint/eslint-plugin": "^8.32.0",
8181
"@typescript-eslint/parser": "^8.32.0",
8282
"eslint": "8.57.0",
83-
"eslint-config-prettier": "^10.1.2",
83+
"eslint-config-prettier": "^10.1.3",
8484
"eslint-mdx": "^3.4.1",
8585
"eslint-plugin-astro": "^1.3.1",
8686
"eslint-plugin-mdx": "^3.4.1",

src/components/Footer.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const firstName = AUTHOR_NAME.split(' ')[0];
8888
<li>
8989
<Link
9090
href={ROUTES.API.FEED_RSS}
91+
target="_blank"
9192
title={`RSS feed for ${domain}`}
9293
class="flex items-center gap-2 text-base xs:text-lg"
9394
variant="nav"

src/libs/integrations/expressive-code.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ import expressiveCode from 'astro-expressive-code';
22

33
import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections';
44

5-
export const expressiveCodeIntegration = () =>
6-
expressiveCode({
5+
// prevent multiple shiki instances in dev mode
6+
let cachedIntegration: ReturnType<typeof expressiveCode> | undefined;
7+
8+
export const expressiveCodeIntegration = () => {
9+
if (cachedIntegration) return cachedIntegration;
10+
11+
return (cachedIntegration = expressiveCode({
712
themes: ['light-plus', 'dark-plus'],
813
useDarkModeMediaQuery: true,
914
themeCssRoot: ':root',
@@ -35,4 +40,5 @@ export const expressiveCodeIntegration = () =>
3540
},
3641
},
3742
plugins: [pluginCollapsibleSections()],
38-
});
43+
}));
44+
};

yarn.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,10 +1877,10 @@ astro-social-share@^2.0.3:
18771877
resolved "https://registry.yarnpkg.com/astro-social-share/-/astro-social-share-2.2.0.tgz#4e7609e251cd614a414d884cefc07888ff73d4f4"
18781878
integrity sha512-Z5ebhO6Yw4GLggw7wsTahdpS0f4pf/XuVjQlBpWZ0zyt0cKaVrlG/+u6RzrzN9B2t27wxp90XiosZNwvBZqA+Q==
18791879

1880-
astro@^5.7.10:
1881-
version "5.7.10"
1882-
resolved "https://registry.yarnpkg.com/astro/-/astro-5.7.10.tgz#c144d3401dc1377272a5b98832e8ea5a63c6e906"
1883-
integrity sha512-9TQcFZqP2w6//JXXUHfw8/5PX7KUx9EkG5O3m+hISuyeUztvjY1q5+p7+C5HiXyg24Zs3KkpieoL5BGRXGCAGA==
1880+
astro@^5.7.11:
1881+
version "5.7.11"
1882+
resolved "https://registry.yarnpkg.com/astro/-/astro-5.7.11.tgz#50c6ede88de76f8dfce63dd0c8fca6bf5dff9ff2"
1883+
integrity sha512-9qRVwp8pue3isddLBnTexJsmKFpmms9Fo7Ss+3yrC0aINvbHKpD7q6qf52BtfQEk2xJgyx3SQy3dUsuD90sEqQ==
18841884
dependencies:
18851885
"@astrojs/compiler" "^2.11.0"
18861886
"@astrojs/internal-helpers" "0.6.1"
@@ -1929,7 +1929,7 @@ astro@^5.7.10:
19291929
tinyglobby "^0.2.12"
19301930
tsconfck "^3.1.5"
19311931
ultrahtml "^1.6.0"
1932-
unifont "~0.4.1"
1932+
unifont "~0.5.0"
19331933
unist-util-visit "^5.0.0"
19341934
unstorage "^1.15.0"
19351935
vfile "^6.0.3"
@@ -2898,10 +2898,10 @@ eslint-compat-utils@^0.6.0:
28982898
dependencies:
28992899
semver "^7.5.4"
29002900

2901-
eslint-config-prettier@^10.1.2:
2902-
version "10.1.2"
2903-
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.2.tgz#31a4b393c40c4180202c27e829af43323bf85276"
2904-
integrity sha512-Epgp/EofAUeEpIdZkW60MHKvPyru1ruQJxPL+WIycnaPApuseK0Zpkrh/FwL9oIpQvIhJwV7ptOy0DWUjTlCiA==
2901+
eslint-config-prettier@^10.1.3:
2902+
version "10.1.3"
2903+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.3.tgz#b53b626e5fae39aa2a442a929488c35acec53c96"
2904+
integrity sha512-vDo4d9yQE+cS2tdIT4J02H/16veRvkHgiLDRpej+WL67oCfbOb97itZXn8wMPJ/GsiEBVjrjs//AVNw2Cp1EcA==
29052905

29062906
eslint-mdx@^3.4.1:
29072907
version "3.4.1"
@@ -3239,10 +3239,10 @@ fdir@^6.4.4:
32393239
resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.4.tgz#1cfcf86f875a883e19a8fab53622cfe992e8d2f9"
32403240
integrity sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==
32413241

3242-
feed@^4.2.2:
3243-
version "4.2.2"
3244-
resolved "https://registry.yarnpkg.com/feed/-/feed-4.2.2.tgz#865783ef6ed12579e2c44bbef3c9113bc4956a7e"
3245-
integrity sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==
3242+
feed@^5.0.0:
3243+
version "5.0.0"
3244+
resolved "https://registry.yarnpkg.com/feed/-/feed-5.0.0.tgz#091d8ac104efbccbeab66955c68e9c744d0fdd9b"
3245+
integrity sha512-b+xl8kQ/bxInBKTe3GLCGDFU45kFiDSIEEdDUAUGGThN1Jqpx+7uFb95NEPjI1JAjXy2iEFPzxHsK2rIEyJibw==
32463246
dependencies:
32473247
xml-js "^1.6.11"
32483248

@@ -6731,10 +6731,10 @@ unified@^11.0.0, unified@^11.0.4, unified@^11.0.5:
67316731
trough "^2.0.0"
67326732
vfile "^6.0.0"
67336733

6734-
unifont@~0.4.1:
6735-
version "0.4.1"
6736-
resolved "https://registry.yarnpkg.com/unifont/-/unifont-0.4.1.tgz#b434984e11c8490929daa6a70c84c95d5459a004"
6737-
integrity sha512-zKSY9qO8svWYns+FGKjyVdLvpGPwqmsCjeJLN1xndMiqxHWBAhoWDMYMG960MxeV48clBmG+fDP59dHY1VoZvg==
6734+
unifont@~0.5.0:
6735+
version "0.5.0"
6736+
resolved "https://registry.yarnpkg.com/unifont/-/unifont-0.5.0.tgz#1c995b64cf6748468a5fa8431183f6bf10f23204"
6737+
integrity sha512-4DueXMP5Hy4n607sh+vJ+rajoLu778aU3GzqeTCqsD/EaUcvqZT9wPC8kgK6Vjh22ZskrxyRCR71FwNOaYn6jA==
67386738
dependencies:
67396739
css-tree "^3.0.0"
67406740
ohash "^2.0.0"

0 commit comments

Comments
 (0)