Skip to content

🏗️🔧:let the minified script say so in its name - #1868

Merged
openinf-commit-queue[bot] merged 1 commit into
livefrom
fix/min-js-name
Aug 26, 2026
Merged

🏗️🔧:let the minified script say so in its name#1868
openinf-commit-queue[bot] merged 1 commit into
livefrom
fix/min-js-name

Conversation

@DerekNonGeneric

@DerekNonGeneric DerekNonGeneric commented Aug 26, 2026

Copy link
Copy Markdown
Member

#1867 minified the script but left it under the name it arrived with,
which is the one thing the stylesheet is careful not to do:

Only the build that minifies claims .min, so the name never
overstates what is in the file; head.liquid picks the matching one by
env.

A count.js that is not the count.js upstream serves is exactly the
overstatement that comment is about.

production development
before count.js, 5,774 bytes count.js, 9,213
after count.min.js, 5,774 count.js, 9,213

The unminified copy does not go out beside it — the pass renames rather
than adding.

The tag names the file outright

The script tag already sits inside {% if env == 'production' %}, so a
second condition on the same thing could never be false. It asks for
count.min.js directly. The stylesheet keeps its condition because its
<link> is not inside such a block.

What was already right

Minifying was production-only from the start; this only fixes the name.
Checked both builds rather than assumed:

production:   assets/js/vendor/count.min.js   5774
development:  assets/js/vendor/count.js       9213

Verified

  • the page asks for /assets/js/vendor/count.min.js, that path answers
    200, and the old one answers 404
  • the script still runs: loads in WebKit, all five public functions,
    a beacon with s=390 p=/, no page errors
  • the ISC notice still ships at the top of the minified file
  • the vendored source is untouched and nps verify.vendored still says
    it matches upstream
  • a file that already says .min.js is left alone rather than becoming
    .min.min.js
  • vnu passes; nps test passes

Refs #1867

Summary by CodeRabbit

  • Performance
    • Production pages now load a minified analytics script for faster performance.
    • SVG and JavaScript assets are automatically optimized during production builds.
    • Existing minified assets are preserved without redundant processing.

The stylesheet is built on the rule that `.min` is a claim about what
is inside a file, so only the build that minifies makes one. The script
was minified under the name it arrived with, which says the opposite of
what had happened to it.

It is `count.min.js` now, and the unminified copy does not go out
beside it. The tag asking for it sits inside the block that only
renders for production, so it names the minified file outright rather
than deciding again in a condition that cannot be false.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
Refs: #1867
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for gh-pages-openinf ready!

Name Link
🔨 Latest commit d9b2703
🔍 Latest deploy log https://app.netlify.com/projects/gh-pages-openinf/deploys/6a8e6a398aaaf200089e0931
😎 Deploy Preview https://deploy-preview-1868--gh-pages-openinf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 41806074-d806-408b-a063-5c48b29db01a

📥 Commits

Reviewing files that changed from the base of the PR and between 3657aa3 and d9b2703.

📒 Files selected for processing (2)
  • _includes/head.liquid
  • eleventy.config.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Production asset processing now minifies JavaScript into .min.js files, removes the original files, skips existing minified files, and optimizes SVG files. The production analytics include now loads count.min.js.

Changes

Production asset processing

Layer / File(s) Summary
Asset processing pipeline
eleventy.config.mjs
SVG handlers now read, optimize, and rewrite files. JavaScript handlers now create .min.js files and delete the originals. Existing .min.js files are skipped.
Minified analytics reference
_includes/head.liquid
The production analytics script now loads count.min.js.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d9b27

This localized change makes the production script filename accurately reflect its minified contents while preserving the development asset and template behavior; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: naming the minified script with a minified-file suffix. It matches the update to serve count.min.js in production.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/min-js-name

Comment @coderabbitai help to get the list of available commands.

@OpenINFbot OpenINFbot added the 🚀 Status: Commit Queue Land this pull request when its checks pass label Aug 26, 2026
@openinf-commit-queue
openinf-commit-queue Bot merged commit 87a5e80 into live Aug 26, 2026
17 checks passed
@openinf-commit-queue openinf-commit-queue Bot removed the 🚀 Status: Commit Queue Land this pull request when its checks pass label Aug 26, 2026
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.

2 participants