-
-
Notifications
You must be signed in to change notification settings - Fork 463
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: CodeBlock fixes (select menu, bundled languages, paste from VS Code) #1219
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@areknawo is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
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.
thank you for improving this!
# Conflicts: # package-lock.json
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.
sorry for the delay, we'll get this merged this week!
@areknawo I pushed some minor suggestions from @matthewlipski, and only have 1 question re. the correct bundle to import (web or default)
@@ -1,4 +1,4 @@ | |||
import { bundledLanguagesInfo } from "shiki/bundle/web"; | |||
import { bundledLanguagesInfo } from "shiki"; |
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.
@areknawo if we're selecting 1 bundle, doesn't it make more sense to only use "shiki/bundle/web";
to bring down size at least a little?
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.
@YousefED Not sure if it'd work. bundledLanguagesInfo
is used to verify if specific language ID can be loaded. If it was limited to languages from the web bundle, languages outside of it wouldn't work.
Apart from the check, it might also affect bundling. Importing the full package, all languages are included in the bundle and you can customize which one you choose to support (and externalize others from the bundle). If it was limited to the web bundle, I'm not sure if other language would work at all.
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.
If we're fine with only supporting languages from the web bundle we can limit to shiki/bundle/web
right? I think that's ok for now until we get requests for more esoteric languages.,
Also, I'm thinking we might want to shift to forcing users to pass in languages explicitly; while that would not disable syntax highlighting by default, I think it's also important to have a cleaner packaging / bundling experience
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.
In that case - yes. Worth noting though that the current defaults include a few languages outside the web bundle.
As for the latter - I agree that switching to explicit imports would make sense. The only drawback would be more difficult customization and a question of balance between built-in defaults and languages you have to import (in that case, maybe it makes sense to remove the defaults completely?)
Fixes CodeBlock issues:
typescriptreact
alias for TSX);Improves on the #1213, fixing duplicate languages in the bundle output (by importing from only a single Shiki bundle);