Skip to content

Commit

Permalink
fix: cache markdown it instance and properly dispose shiki on config …
Browse files Browse the repository at this point in the history
…reload (#4321)

This results in over 5x speedup in build times of certain projects. But this comes at the cost of correctness. `createMarkdownRenderer` now ignores any arguments passed by user. But from our GitHub code search we didn't find any user passing options different than their siteConfig to this function. If you are doing that, please open an issue and we can discuss the best way forward.

---
Co-authored-by: Divyansh Singh <[email protected]>
  • Loading branch information
Barbapapazes authored Oct 29, 2024
1 parent 81fc148 commit 45968cd
Show file tree
Hide file tree
Showing 6 changed files with 469 additions and 423 deletions.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,20 @@
"dependencies": {
"@docsearch/css": "^3.6.2",
"@docsearch/js": "^3.6.2",
"@shikijs/core": "^1.22.0",
"@shikijs/transformers": "^1.22.0",
"@shikijs/types": "^1.22.0",
"@shikijs/core": "^1.22.2",
"@shikijs/transformers": "^1.22.2",
"@shikijs/types": "^1.22.2",
"@types/markdown-it": "^14.1.2",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/devtools-api": "^7.4.6",
"@vue/devtools-api": "^7.5.4",
"@vue/shared": "^3.5.12",
"@vueuse/core": "^11.1.0",
"@vueuse/integrations": "^11.1.0",
"focus-trap": "^7.6.0",
"mark.js": "8.11.1",
"minisearch": "^7.1.0",
"shiki": "^1.22.0",
"vite": "^5.4.8",
"shiki": "^1.22.2",
"vite": "^5.4.10",
"vue": "^3.5.12"
},
"devDependencies": {
Expand All @@ -127,7 +127,7 @@
"@mdit-vue/shared": "^2.1.3",
"@polka/compression": "^1.0.0-next.28",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-replace": "^6.0.1",
Expand All @@ -141,15 +141,15 @@
"@types/markdown-it-emoji": "^3.0.1",
"@types/micromatch": "^4.0.9",
"@types/minimist": "^1.2.5",
"@types/node": "^22.7.5",
"@types/node": "^22.8.2",
"@types/postcss-prefix-selector": "^1.16.3",
"@types/prompts": "^2.4.9",
"chokidar": "^3.6.0",
"conventional-changelog-cli": "^5.0.0",
"cross-spawn": "^7.0.3",
"debug": "^4.3.7",
"esbuild": "^0.24.0",
"execa": "^9.4.0",
"execa": "^9.5.1",
"fs-extra": "^11.2.0",
"get-port": "^7.1.0",
"gray-matter": "^4.0.3",
Expand All @@ -164,31 +164,31 @@
"markdown-it-mathjax3": "^4.3.2",
"micromatch": "^4.0.8",
"minimist": "^1.2.8",
"nanoid": "^5.0.7",
"nanoid": "^5.0.8",
"ora": "^8.1.0",
"p-map": "^7.0.2",
"path-to-regexp": "^6.3.0",
"picocolors": "^1.1.0",
"picocolors": "^1.1.1",
"pkg-dir": "^8.0.0",
"playwright-chromium": "^1.48.0",
"playwright-chromium": "^1.48.2",
"polka": "^1.0.0-next.28",
"postcss-prefix-selector": "^2.1.0",
"prettier": "^3.3.3",
"prompts": "^2.4.2",
"punycode": "^2.3.1",
"rimraf": "^6.0.1",
"rollup": "^4.24.0",
"rollup": "^4.24.2",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"semver": "^7.6.3",
"simple-git-hooks": "^2.11.1",
"sirv": "^3.0.0",
"sitemap": "^8.0.0",
"supports-color": "^9.4.0",
"tinyglobby": "^0.2.9",
"tinyglobby": "^0.2.10",
"typescript": "^5.6.3",
"vitest": "^2.1.2",
"vue-tsc": "^2.1.6",
"vitest": "^2.1.4",
"vue-tsc": "^2.1.8",
"wait-on": "^8.0.1"
},
"peerDependencies": {
Expand All @@ -203,7 +203,7 @@
"optional": true
}
},
"packageManager": "[email protected].1",
"packageManager": "[email protected].3",
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
Expand Down
Loading

0 comments on commit 45968cd

Please sign in to comment.