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

[Request] Build minimal target (i.e. no languages) on CDNs too #3034

Closed
somebody1234 opened this issue Mar 3, 2021 · 3 comments
Closed

[Request] Build minimal target (i.e. no languages) on CDNs too #3034

somebody1234 opened this issue Mar 3, 2021 · 3 comments
Labels
enhancement An enhancement or new feature

Comments

@somebody1234
Copy link

Is your request related to a specific problem you're having?
I'd like a minimal distribution. So what I want is to have language detection via hljs on the server, but a full build is 1MB which I'd imagine would be terrible for clientside load times, so my plan is to send just a minimal distribution and the one language that's needed for the specific page being requested.

The solution you'd prefer / feature you'd like to see added...
A target with no languages.

Any alternative solutions you considered...
None; I've already built the minimal target myself. Note that going to the website and deselecting appears to not work with the current (?) API since it lacks highlightAll among possibly other differences (It's also 15k instead of the current 20k).

Additional context...
None needed, I believe

@somebody1234 somebody1234 added the enhancement An enhancement or new feature label Mar 3, 2021
@joshgoebel
Copy link
Member

joshgoebel commented Mar 3, 2021

appears to not work with the current (?) API since it lacks highlightAll

The website only has 10.5... not sure why 10.6 didn't get published. Tracking that down now. Thanks for bringing that to our attention. Once the latest version is on there then highlightAll will be there, etc.

I'm going to close this as a duplicate of #2846. The lack of discussion there shows me this is not a critical issue to most people.


I think the current feeling is that our default common build (41kb gzipped) is "small enough" for most common uses (and getting smaller with version 11) and that it's easy enough to build a more minimal target for truly specialized cases than need something smaller. IE, our current build already qualifies as a "minimal distribution", just not the MOST minimal.

That said, we may end up here eventually anyways thanks to #2600 - so keep an eye on that and v11. Although I suppose that might only apply to people using the npm modules in the browser via modules - I'm not sure we'll add another file to our CDN build.

@joshgoebel
Copy link
Member

joshgoebel commented Mar 3, 2021

It's also (currently) easy to just use any old text editor to "trim the fat" from our default distribution as well... it's just a concatenation of core + common grammars.

@joshgoebel
Copy link
Member

Pushed 10.6 to the website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature
Projects
None yet
Development

No branches or pull requests

2 participants