Repository navigation
perf: drop duplicate entities and date-fns from the client bundle - #2613
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Production bundleExplore the comparison online → Client JS 1.69 MiB
All client assets
Largest module increases
Initial page load counts the entry script, |
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
f15efd0 to
6226b58
Compare
|
Warning Review limit reachedYou'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. View limit details
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. |
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:comarkuses v8 andmarkdown-exit@1.3.0uses v7.date-fns, 6.31 kB in the extra copy: the app uses v4, andlittle-datepulls in v2.What changed
@comark/nuxtand thecomarkoverride). 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 tomarkdown-exit@2.1and dropsentities. Thecomark: 0.9.0override stays becausecomark-contentand@diglot/comarkstill require^0.8.1.FeedbackDatePickernow formats the range withIntl.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)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/updatesand/templates.The date label, from the old and new code run side by side in Node (today is Nov 5, 2026):
little-dateIntlOct 6 - Nov 5Oct 6 – Nov 5Nov 1 - 5Nov 1 – 5Mar 2 - 9, 2025Mar 2 – 9, 2025Nov 5 '25 - Nov 5 '26Nov 5, 2025 – Nov 5, 2026Thu, Nov 5Nov 5vue-tsc -b --noEmitand eslint pass. I didn't render the feedback page, because it sits behind admin sign-in.Details
entitiesoverride was added. Once comark no longer depends onentities, no copy is left in the client bundle, so an override would change nothing.www.example.comorexample.cominto links. Only full URLs and emails are linked now. No Markdown incontent/uses barewww.links. Docs pulled from other repositories weren't checked.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.