-
Notifications
You must be signed in to change notification settings - Fork 9
feat(legacy-html): don't minify assets, add assets to c8 exclude #323
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
Conversation
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.
Pull Request Overview
This PR refactors the legacy HTML generator to improve performance by moving inline CSS/JS into external files and by simplifying the HTML minification process.
- Removed inline dark-mode CSS from the HTML template and moved it to an external stylesheet.
- Removed JS/CSS minification options in favor of simpler HTML minification in both legacy-html generators.
- Refactored assets/api.js to modernize functions with arrow syntax and improve event handling, and updated ESLint config for newer ECMAScript features.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/generators/legacy-html/template.html | Removed inline style block for dark mode styling |
src/generators/legacy-html/index.mjs | Removed JS/CSS minification options to speed up HTML generation |
src/generators/legacy-html/assets/style.css | Added dark-mode CSS styling rules to external stylesheet |
src/generators/legacy-html/assets/api.js | Refactored functions with modern syntax and improved event handling |
src/generators/legacy-html-all/index.mjs | Removed JS/CSS minification options for the combined legacy HTML generation |
eslint.config.mjs | Updated ESLint configuration to use the latest ECMAScript version |
Comments suppressed due to low confidence (1)
eslint.config.mjs:79
- [nitpick] Consider adding a note in the project documentation about the required ECMAScript/Node version to support 'latest' language features configured here.
languageOptions: { globals: { ...globals.browser }, ecmaVersion: 'latest' },
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
==========================================
+ Coverage 66.57% 71.25% +4.67%
==========================================
Files 81 117 +36
Lines 6956 9650 +2694
Branches 339 585 +246
==========================================
+ Hits 4631 6876 +2245
- Misses 2322 2771 +449
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
What if we use esbuild to minify ?
I don't think ESBuild minifies HtML |
Hum sad 😔 |
9886eef
to
78214e3
Compare
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.
Sugar
By not having terser
minifyCSS
orminifyJS
, we save ~7 seconds on generation. See also #320. After this, Shiki is the hottest code path, followed byparseApiDoc
.Also, while I'm changing the assets, I've added them to the coverage exclude, since we aren't planning to test them, they are browser-based. This PR crosses the coverage threshold of 70%, so that was also changed.