Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): createdBundledHighlighter cause wasm engine to be loaded #819

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

fuma-nama
Copy link
Contributor

@fuma-nama fuma-nama commented Oct 27, 2024

Description

While playing with JavaScript Regex engine and getSingletonHighlighter, I noticed that the WASM engine was loaded regardless of my engine option, and it is indeed using the JavaScript engine.

After looking into the codebase, I found:

    const core = await createHighlighterCore({
      engine: engine(),

In the code of createdBundledHighlighter (highlighter factory), this causes engine to be called and hence the WASM engine is loaded with lazy import, even if it is unused.

Linked Issues

N/A

Additional context

Copy link

netlify bot commented Oct 27, 2024

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 8f4826a
🔍 Latest deploy log https://app.netlify.com/sites/shiki-next/deploys/671e09738380330008e18509
😎 Deploy Preview https://deploy-preview-819--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 27, 2024

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 8f4826a
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/671e0973d09a600008e3de9d
😎 Deploy Preview https://deploy-preview-819--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu merged commit e26920a into shikijs:main Oct 27, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants