Repository navigation
⚡ Bolt: Optimize date formatting and Intl instance scope - #1485
alehar9320 wants to merge 1 commit into
Conversation
Co-authored-by: alehar9320 <5390430+alehar9320@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
me | e0429f8 | Commit Preview URL Branch Preview URL |
Sep 29 2026, 01:06 AM |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
HARD ABORT — do not merge. Do not Jules-restack. Do not reopen. @jules This is the same Bolt farm restack already closed as #1472 / #1460 / #1448 / #1436 / #1424 / #1412 / #1400 / #1388 / #1374 / #1357 (and earlier Dual CLOSE HOLD #1204 tip Why closed
Prompt for Jules (if anything): Stop. Do not open another PR that only hoists Closed unmerged as alehar9320-bot. Soft dims N/A. Overlay |
Bundle ReportChanges will decrease total bundle size by 562.07kB (-48.89%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: molecular-mars-esmAssets Changed:
|
HARD ABORT — closing unmergedJules farm restack of the Bolt ISO date-slice + Stockholm No visitor or employer-marketing value. Micro-alloc claim is noise on this path; do not land on main. No Bolt onto main. @jules do not restack, reopen, or open a sibling for this tip. Soft dims N/A. Overlay Johan UX review — tip HARD ABORT — do not merge. Do not Dual. Do not Jules-restack. Tip: Why
Brand / AI-first
@jules Close this class. Do not restack, reopen, or open another Bolt/Engine Overlay |
alehar9320-bot
left a comment
There was a problem hiding this comment.
Finn — performance gate (COMMENT)
Tip e0429f8d. Preview https://37df77d3-me.alehar.workers.dev (branch: https://bolt-date-formatting-intl-optimization-6422787336157195534-me.alehar.workers.dev).
What changed
github-releases.ts:formatReleaseDate.split('T')[0]→.slice(0, 10)(no production callers of this helper; tests only).visit-stats.ts: hoistSTOCKHOLM_DATE_FORMATTER = new Intl.DateTimeFormat(...)to module scope..Jules/bolt.mdjournal.
Client impact (this is the gate)
Footer.astro client <script> imports other named exports from visit-stats (formatColophonVisits / formatColophonVisitsTitle / shouldShowVisitCount). It does not call formatFirstSeen / formatVisitGlance (panel first stays '').
Before (prod 819cd759 Footer inline script): no Intl.DateTimeFormat / Europe/Stockholm — the formatter lived inside formatFirstSeen and was tree-shaken away with the unused export.
After (preview tip): the module-level const is kept as a bare side-effect:
new Intl.DateTimeFormat(`en-GB`,{timeZone:`Europe/Stockholm`,day:`numeric`,month:`short`,year:`numeric`});- Footer visit script: prod 10 626 B → preview 10 732 B (+106 B) on every page that ships Footer.
- Unused
Intlconstructed at module init on the main thread; result discarded.
So the “edge Workers GC” hoist regresses the visitor bundle: it undoes tree-shaking and adds cold work on every pageview.
Lab (home preview)
- Mobile perf 0.98 — LCP 2.1s · FCP 1.8s · CLS 0.019 · TBT 10ms · transfer ~601 KiB
- Desktop perf 1.00 — LCP 0.6s · FCP 0.5s · CLS 0.017 · TBT 0ms · transfer ~616 KiB
LH will not reliably surface +106 B / one unused Intl; the HTML/script diff vs prod is the evidence.
Manual
Home + /whats-new/ 200; Footer colophon/data-visit-stats markup unchanged. No perceived jank from this tip alone — the issue is the avoidable client side-effect, not a CWV cliff.
Ranked asks (author / Jules)
- Do not land this tip. Brand already HARD ABORT closed the farm class; Finn agrees on perf grounds for a different reason.
- Never hoist side-effectful
new Intl.DateTimeFormat(...)(or similar) to module scope in a file imported by client<script>unless the formatter is actually used on the client path. Keep construction insideformatFirstSeenso unused exports stay tree-shaken. - If a real edge micro-opt is ever needed: put the hoist in a server-only module (API route / Worker import that Footer does not import), or split
visit-statsintovisit-stats-format.ts(server) vs colophon helpers (client). - Do not restack this tip; a measured issue with before/after Worker CPU would be required first — this PR’s claim is the opposite of what shipped to the browser.
Gate: COMMENT (not BLOCK — PR already closed unmerged). Never merge from Finn.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What
Optimized date string parsing in
src/utils/github-releases.tsand hoistedIntl.DateTimeFormatinstance insrc/utils/visit-stats.ts.Why
date.toISOString().split('T')[0]allocates an unnecessary 2-element string array['YYYY-MM-DD', 'HH:mm:ss.sssZ']on every release date formatting invocation, whereas.slice(0, 10)extracts the YYYY-MM-DD substring directly without intermediate array allocation.new Intl.DateTimeFormat(...)insideformatFirstSeenre-evaluates ICU locale rules and creates a new object on every function call. HoistingSTOCKHOLM_DATE_FORMATTERto module-level scope reuses the instance across invocations.Impact
How to verify
npm run test(all 21 test suites / 368 tests pass).npm run lintandnpm run format:check.npm run buildto confirm build succeeds without errors.PR created automatically by Jules for task 6422787336157195534 started by @alehar9320
Summary by CodeRabbit