Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve(git-changelog): splitting Git data into page-level #279

Open
northword opened this issue Jul 27, 2024 · 3 comments
Open

improve(git-changelog): splitting Git data into page-level #279

northword opened this issue Jul 27, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog

Comments

@northword
Copy link
Member

northword commented Jul 27, 2024

Splitting the data in Virtual Module down to the page level so that when a user visits the site, they don't need to download a very large Gitlog file (usually theme.hash.js) first, and therefore have higher performance.

Ref: #223 , this was discussed in Discord and I am creating a ticket for this issue to track it, this is probably a long term plan and I don't have much ideas on how to implement it at the moment.

(may be?) In the short term, we could probably try to split the git data out of theme.hash.js so that only when the site content is updated (usually only the git data data is changed in theme.hash.js), the user doesn't have to pay for the unchanged parts of theme.hash.js. ref: rollup config: output.manualChunks.

@northword northword added enhancement New feature or request help wanted Extra attention is needed pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog labels Jul 27, 2024
@nekomeowww
Copy link
Member

I've been thinking way long and barely giving up.

I believe one possible and easy way to implement this is to generate separate git-changelog-commits.data.json into dist right under each pages' parent directories, then use client side fetch to dynamically fetch through GET for the actual commits logs since commit logs generally wont be needed for SEO and compatible with MPA.

@northword
Copy link
Member Author

For notes only:

ref:vuejs/vitepress#3001 (comment)

Not sure if attaching git logs to pages is possible with transformPageData:

  async transformPageData({ relativePath }) {
    return { contributors: await getContributorsAt(relativePath) }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog
Projects
None yet
Development

No branches or pull requests

2 participants