Skip to content

feat(perf): use @minify-html #331

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

Merged
merged 2 commits into from
Jun 30, 2025
Merged

feat(perf): use @minify-html #331

merged 2 commits into from
Jun 30, 2025

Conversation

avivkeller
Copy link
Member

Fixes #330

See #330 (comment) for the size difference, and see #330 (comment) for the rationale.

TL;DR This minifier is faster, and outputs smaller bundles

@avivkeller avivkeller requested a review from a team as a code owner June 29, 2025 18:26
Copy link

codecov bot commented Jun 29, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.52%. Comparing base (e1494c6) to head (e838130).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/legacy-html-all/index.mjs 50.00% 1 Missing ⚠️
src/generators/legacy-html/index.mjs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
+ Coverage   71.51%   71.52%   +0.01%     
==========================================
  Files         117      117              
  Lines        9721     9719       -2     
  Branches      590      590              
==========================================
  Hits         6952     6952              
+ Misses       2766     2764       -2     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller
Copy link
Member Author

Also, Shiki is defining a --shiki-dark CSS variable, which I don't think we use, is that disable-able?

@ovflowd
Copy link
Member

ovflowd commented Jun 29, 2025

Also, Shiki is defining a --shiki-dark CSS variable, which I don't think we use, is that disable-able?

Does it matter?

@avivkeller
Copy link
Member Author

Does it matter?

Yes, it'll drastically reduce our output size if it wasn't defined, since EACH code block contains a variable definition.

@ovflowd
Copy link
Member

ovflowd commented Jun 29, 2025

Does it matter?

Yes, it'll drastically reduce our output size if it wasn't defined, since EACH code block contains a variable definition.

Check Shiki docs, it might be doable.

@avivkeller
Copy link
Member Author

Ahhh nevermind we do use them in styles.css:

html.dark-mode .shiki,
html.dark-mode .shiki span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
  /* Optional, if you also want font styles */
  font-style: var(--shiki-dark-font-style) !important;
  font-weight: var(--shiki-dark-font-weight) !important;
  text-decoration: var(--shiki-dark-text-decoration) !important;
}

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

you was quicker thank me 😁

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGTM !

@ovflowd
Copy link
Member

ovflowd commented Jun 30, 2025

I'm fast-tracking this as this is pretty much just a dependency change and I doubt anyone will have anything against this. (And to unblock the web generator)

@ovflowd ovflowd merged commit 9e3ba2f into main Jun 30, 2025
9 checks passed
@ovflowd ovflowd deleted the feat/minify-html branch June 30, 2025 09:59
@ovflowd ovflowd added the fast track This PR can land before the typical review time, with a :+1: from collaborators label Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast track This PR can land before the typical review time, with a :+1: from collaborators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to faster HTML minifier
4 participants