-
-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
✅ Deploy Preview for shikiji ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
- Coverage 96.92% 96.92% -0.01%
==========================================
Files 49 49
Lines 4196 4193 -3
Branches 521 522 +1
==========================================
- Hits 4067 4064 -3
Misses 127 127
Partials 2 2 ☔ View full report in Codecov by Sentry. |
auto.wasm
entryunwasm
entry in exports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for quickly collabrating on this! Will try to push import maps ASAP to align with shikiji changes (i guess PR title could be unwasm condition
no?)
@@ -43,7 +43,7 @@ const highlighter = await getHighlighterCore({ | |||
langs: [ | |||
import('shikiji/langs/javascript.mjs'), | |||
], | |||
loadWasm: getWasmInlined | |||
loadWasm: getWasm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally up to you, but wouldn't using loadWasm
as import name allow loadWasm
shorthand syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we have a different name here is that loadWasm
is an exported function, and we could have usage like:
import { loadWasm } from 'shikiji/core'
import getWasm from 'shikiji/wasm'
await loadWasm(getWasm)
const getWasm: WebAssemblyInstantiator = async (info) => { | ||
// @ts-expect-error this will be compiled to ArrayBuffer | ||
const binray: ArrayBuffer = await import('vscode-oniguruma/release/onig.wasm').then(m => m.default) | ||
return WebAssembly.instantiate(binray, info).then(wasm => wasm.instance.exports) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ❤️
unwasm
entry in exportsunwasm
condition in exports
resolve #71, awaits unjs/unwasm#10
Breaking Changes
shikiji/wasm
andshikiji-core/wasm
now only have default exports, name exportgetWasmInlined
is removedshikiji-core/wasm
renamed toshikiji-core/wasm-inlined