Skip to content

Conversation

areknawo
Copy link
Collaborator

@areknawo areknawo commented Nov 6, 2024

Fixes CodeBlock issues:

Improves on the #1213, fixing duplicate languages in the bundle output (by importing from only a single Shiki bundle);

Copy link

vercel bot commented Nov 6, 2024

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

Name Status Preview Updated (UTC)
blocknote 🛑 Canceled (Inspect) Nov 20, 2024 3:46pm
blocknote-website ✅ Ready (Inspect) Visit Preview Nov 20, 2024 3:46pm

Copy link

vercel bot commented Nov 6, 2024

@areknawo is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@sindras sindras left a comment

Choose a reason for hiding this comment

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

:shipit: thank you for improving this!

# Conflicts:
#	package-lock.json
@YousefED YousefED mentioned this pull request Nov 14, 2024
Copy link
Collaborator

@YousefED YousefED left a 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";
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

@YousefED YousefED Nov 18, 2024

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

Copy link
Collaborator Author

@areknawo areknawo Nov 18, 2024

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?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

decided on call: let's keep as is (full bundle), because otherwise we'll miss several languages. In a next iteration, we'll separate syntax highlighting to a separate package + make it configurable for consumers

@vercel vercel bot temporarily deployed to Preview – blocknote November 14, 2024 12:44 Inactive
@matthewlipski matthewlipski merged commit 6c89ca5 into TypeCellOS:main Nov 20, 2024
3 of 4 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.

4 participants