Skip to content

perf: drop duplicate entities and date-fns from the client bundle - #2613

Merged
atinux merged 1 commit into
mainfrom
perf/bundle-duplicates
Nov 6, 2026
Merged

atinux merged 1 commit into
mainfrom
perf/bundle-duplicates

Conversation

@atinux

@atinux atinux commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Written by an AI agent on behalf of @atinux.

Waiting for comarkdown/comark#564 to land before updating and merging this PR.

bundle.nuxt.dev flags four duplicate packages in the client bundle. Two of them cost bytes:

  • entities, 14.8 kB in the extra copy: comark uses v8 and markdown-exit@1.3.0 uses v7.
  • date-fns, 6.31 kB in the extra copy: the app uses v4, and little-date pulls in v2.

What changed

  • comark is updated to 0.9.0 (@comark/nuxt and the comark override). 0.9.0 includes perf(core): update markdown-exit to 2.1 and keep one entity table in bundles comarkdown/comark#549, which moves comark to markdown-exit@2.1 and drops entities. The comark: 0.9.0 override stays because comark-content and @diglot/comark still require ^0.8.1.
  • little-date is removed. FeedbackDatePicker now formats the range with Intl.DateTimeFormat#formatRange, and it still omits the year when both dates fall in the current year.

Evidence

Built with the same command as bundle-size-history.yml (nuxt analyze --extends=./scripts/bundle-size/nuxt-layer --no-serve). Duplicate issues in the client report (client.json):

main (bundle.nuxt.dev, cd0d100) this branch
entities 2 copies, 14.8 kB extra not in the client bundle
date-fns 2 copies, 6.31 kB extra 1 copy (4.4.0)
cookie-es 2 copies, only one has code unchanged
hookable 2 copies, only one has code unchanged

The bundle-size report shows client JS down 23.2 KiB Brotli (-1.3%), to 1.69 MiB. Initial load is down about 22–23 KiB (around -4%) on /, docs, modules and blog pages, and about 0.8 KiB on /updates and /templates.

The date label, from the old and new code run side by side in Node (today is Nov 5, 2026):

Range little-date Intl
Oct 6 – Nov 5, 2026 Oct 6 - Nov 5 Oct 6 – Nov 5
Nov 1 – 5, 2026 Nov 1 - 5 Nov 1 – 5
Mar 2 – 9, 2025 Mar 2 - 9, 2025 Mar 2 – 9, 2025
Nov 5, 2025 – Nov 5, 2026 Nov 5 '25 - Nov 5 '26 Nov 5, 2025 – Nov 5, 2026
Nov 5 – Nov 5, 2026 Thu, Nov 5 Nov 5

vue-tsc -b --noEmit and eslint pass. I didn't render the feedback page, because it sits behind admin sign-in.

Details

  • No entities override was added. Once comark no longer depends on entities, no copy is left in the client bundle, so an override would change nothing.
  • comark 0.9.0 includes a breaking change from perf(core): update markdown-exit to 2.1 and keep one entity table in bundles comarkdown/comark#549: linkify no longer turns bare www.example.com or example.com into links. Only full URLs and emails are linked now. No Markdown in content/ uses bare www. links. Docs pulled from other repositories weren't checked.
  • The 12 circular imports on the issues page are all inside dependencies (nuxt, reka-ui, zod, d3-interpolate, @internationalized/date, comark, @tanstack/charts), so nothing can be done about them here.

ELI5

Two libraries were each shipped to the browser twice in slightly different versions. Updating comark and using the browser's built-in date formatter removes the second copies, so visitors download about 23 KiB less (Brotli) on most pages.

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nuxt Ready Ready Preview Nov 6, 2026 3:00pm UTC

Request Review

@nuxt-com-bundle-report

nuxt-com-bundle-report Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Production bundle

Explore the comparison online →

Client JS 1.69 MiB $\color{green}\textsf{(-27.7 KiB, -1.6}\%\textsf{)}$ · CSS 33.6 KiB (no change) · Brotli

Initial page load PR JS Δ JS Δ CSS Δ files
/ 536.0 KiB -22.2 KiB (-4.0%) — —
/docs/4.x/getting-started/introduction 595.4 KiB -22.2 KiB (-3.6%) — —
/modules/ui 526.5 KiB -22.2 KiB (-4.0%) — —
/updates 453.5 KiB -125 B (-0.0%) — —
/blog/v4-6 554.8 KiB -22.2 KiB (-3.9%) — —
/templates 452.3 KiB -112 B (-0.0%) — —
All client assets
Metric Base (Brotli) PR (Brotli) Δ Brotli Δ gzip
Client JavaScript 1.72 MiB 1.69 MiB -27.7 KiB (-1.6%) -29.8 KiB (-1.4%)
Client CSS 33.6 KiB 33.6 KiB — —
Other client assets 827.5 KiB 827.5 KiB +8 B (+0.0%) -3 B (-0.0%)
Total client assets 2.56 MiB 2.53 MiB -27.7 KiB (-1.1%) -29.8 KiB (-1.0%)
Largest module increases
Module Base (Brotli) PR (Brotli) Δ Brotli
node_modules/markdown-exit/dist/index.core-Ccg4mWUA.js 0 B 17.7 KiB +17.7 KiB
node_modules/character-entities/index.js 0 B 9.6 KiB +9.6 KiB
node_modules/comark/dist/auto-close.js 0 B 6.7 KiB +6.7 KiB
node_modules/linkify-it/build/index.mjs 0 B 3.6 KiB +3.6 KiB
node_modules/uc.micro/build/index.mjs 0 B 1.7 KiB +1.7 KiB
node_modules/comark/dist/core.js 0 B 1.2 KiB +1.2 KiB
node_modules/comark/dist/internal/entities.js 0 B 829 B +829 B
node_modules/comark/dist/index.js 0 B 664 B +664 B
node_modules/comark/dist/internal/stringify/html-attributes.js 0 B 547 B +547 B
node_modules/comark/dist/internal/stringify/transform-node.js 0 B 495 B +495 B

Initial page load counts the entry script, modulepreload chunks and stylesheets referenced by the prerendered HTML. Module values are attribution estimates from Nuxt’s analyzer. This workflow is report-only. 9b22a27b → 6226b58c

Update comark to 0.9.0, which moves to markdown-exit 2 and no longer
bundles a second entity table (comarkdown/comark#549), and replace
little-date with Intl.DateTimeFormat#formatRange so date-fns 2 leaves
the bundle.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ac53-1b1f-740b-b70b-d6b6d099ac22
@atinux
atinux force-pushed the perf/bundle-duplicates branch from f15efd0 to 6226b58 Compare November 6, 2026 14:57
@atinux
atinux marked this pull request as ready for review November 6, 2026 14:57
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b3a562ab-fcf1-4bd7-9d24-fd436765f63e
Commits

Reviewing files that changed from the base of the PR and between 9b22a27 and 6226b58.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 3

  • app/components/feedback/FeedbackDatePicker.vue
  • package.json
  • pnpm-workspace.yaml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@atinux
atinux merged commit d406697 into main Nov 6, 2026
17 checks passed
@atinux
atinux deleted the perf/bundle-duplicates branch November 6, 2026 15:11

This branch was successfully deployed

1 active deployment
Preview — 6226b58c Deployed Nov 6, 2026 by vercel[bot]
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.

1 participant