Skip to content

Git Page History Integration produced large bundle size #480

@SaltyAom

Description

@SaltyAom

Hi, I'm using Git-based Page History Integration on ElysiaJS documentation and it's awesome, we love it.

Unfortunately, we found that this specific integration has increased client-side JavaScript by a lot (900KB+) so I did some digging, and here's what I found.

  1. All of the commit history seems to added to theme.[hash].js instead of splitting to each pages.

In any page I load (including index page) it would load all of the commits immediately (since it's in the theme.js) instead of loading commits for each pages.

In our cases, we have around ~1,000 commits (rendered around ~500 commits) and the bundle size is increased drastically on any page load, the object array of the commit alone weight around ~200KB

Here's an attached image of nolebase website load on index page, notice that it load all of the commit immediately instead of splitting into each respective pages.

Image
  1. For some reason, all of the locales is loaded instead of a default one?

Here's an image attached image of Nolebase website loading what seems to be a locale for other languages not defined in a default locale. Moreover, it seems to load all of the languages instead which added a lot of bundle size to the page.
Image

These loaded locale stuff which are not used are roughly around ~600KB of JavaScript unused and doesn't seems intent to be so.


I'm not sure if there are any guide to at least split these into an respective pages for each commit and locale, or are there any guide we can take a look at that might help with this?

I would love to help but I'm not familiar with Vue nor knowing how to create Vitepress plugin but if there's anything I can help, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededpkg/git-changelogRelated to @nolebase/vitepress-plugin-git-changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions