Skip to content

Conversation

AVGVSTVS96
Copy link
Owner

@AVGVSTVS96 AVGVSTVS96 commented May 12, 2025

experimenting with an API like this

<ShikiHighlighter
  language="typescript"
  theme={{
    light: 'github-light',
    dark: 'github-dark'
  }}
  fineGrainedBundle={{
    langs: ['typescript', 'javascript', 'jsx', 'tsx'],
    themes: ['github-light', 'github-dark'],
    engine: 'javascript-raw', // or 'oniguruma' or 'js'
    precompiled: true // for raw js engine, see https://shiki.style/guide/regex-engines#pre-compiled-languages
  }}
>
  {code}
</ShikiHighlighter>

Tasks:

Note

This PR provides a cleaner API for fine grained bundle support, only requiring users to import from react-shiki/core and define their required langs and themes with fineGrainedBundle option, instead of requiring users to create their own highlighter manually. react-shiki will handle setting up the bundled highlighter with proper dynamic imports and async chunks. (WIP)

Copy link

vercel bot commented May 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-shiki ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2025 8:08pm

Copy link

changeset-bot bot commented May 12, 2025

⚠️ No Changeset found

Latest commit: cdc579f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@AVGVSTVS96 AVGVSTVS96 force-pushed the feat/fine-grained-bundle branch from 325093d to cdc579f Compare May 29, 2025 20:08
@AVGVSTVS96 AVGVSTVS96 changed the title first draft for fine grained bundle support cleaner API for fine grained bundles May 30, 2025
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.

1 participant