Skip to content

Commit

Permalink
fix: update shiki and relax version range (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu authored Jun 21, 2024
1 parent 937b91b commit 0070585
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/applet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@vue/devtools-ui": "workspace:^",
"lodash-es": "^4.17.21",
"perfect-debounce": "^1.0.0",
"shiki": "1.7.0",
"shiki": "^1.9.0",
"splitpanes": "^3.1.5",
"vue-virtual-scroller": "2.0.0-beta.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/applet/src/composables/shiki.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BuiltinLanguage, HighlighterCore } from 'shiki'
import { getHighlighterCore } from 'shiki/core'
import { createHighlighterCore } from 'shiki/core'
import getWasm from 'shiki/wasm'
import { shallowRef } from 'vue'

Expand All @@ -10,7 +10,7 @@ let promise: Promise<any> | null = null
export function renderCodeHighlight(code: string, lang: BuiltinLanguage | 'text' = 'text') {
if (!promise && !shiki.value) {
// Only loading when needed
promise = getHighlighterCore({
promise = createHighlighterCore({
themes: [
import('shiki/themes/vitesse-dark.mjs'),
import('shiki/themes/vitesse-light.mjs'),
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"colord": "^2.9.3",
"fuse.js": "^7.0.0",
"minimatch": "^9.0.4",
"shiki": "1.7.0",
"shiki": "^1.9.0",
"splitpanes": "^3.1.5",
"vis-network": "^9.1.9",
"vite-hot-client": "^0.2.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/composables/shiki.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BuiltinLanguage, HighlighterCore } from 'shiki'
import { getHighlighterCore } from 'shiki/core'
import { createHighlighterCore } from 'shiki/core'
import getWasm from 'shiki/wasm'

export const shiki = shallowRef<HighlighterCore>()
Expand All @@ -9,7 +9,7 @@ let promise: Promise<any> | null = null
export function renderCodeHighlight(code: string, lang: BuiltinLanguage | 'text' = 'text') {
if (!promise && !shiki.value) {
// Only loading when needed
promise = getHighlighterCore({
promise = createHighlighterCore({
themes: [
import('shiki/themes/vitesse-dark.mjs'),
import('shiki/themes/vitesse-light.mjs'),
Expand Down
31 changes: 12 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0070585

Please sign in to comment.