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

Add shiki lang path compat #8996

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Add shiki lang path compat #8996

merged 1 commit into from
Nov 6, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Nov 3, 2023

Changes

fix #8970

Shiki supports languages with the path prop, which loads language JSON files, relative to the package root (in our case, the Astro package 😬). It's a bit of an ugly compat, but they should be removed in Astro 4.

Testing

added new test based on the issue repro.

Docs

n/a

Copy link

changeset-bot bot commented Nov 3, 2023

🦋 Changeset detected

Latest commit: 2d38d63

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review labels Nov 3, 2023
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. Is there any chance that we could add this feature to shikiji directly? Are the maintainers willing to accept such change?

@bluwy
Copy link
Member Author

bluwy commented Nov 6, 2023

I don't think Anthony (shikiji author) will be adding this. Its removal is actually the goal of shikiji to rely on ESM imports instead so the code is portable. The compat code we add here will bring the caveats of shiki before where it doesn't work too well in SSR.

Ideally they should move away from using path. I've commented some additional information at #8970 (comment)

@ematipico
Copy link
Member

That makes sense, thank you for clarifying!

@bluwy bluwy merged commit 3988bbc into main Nov 6, 2023
13 checks passed
@bluwy bluwy deleted the shiki-path-compat branch November 6, 2023 09:58
@astrobot-houston astrobot-houston mentioned this pull request Nov 6, 2023
natemoo-re pushed a commit that referenced this pull request Nov 22, 2023
@Omikorin Omikorin mentioned this pull request Dec 5, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shikiji breaks custom language syntax highlighting
3 participants