Skip to content

refactor!: mv data processing to vite side#269

Merged
nekomeowww merged 9 commits into
nolebase:mainfrom
northword:dev/git-changelog-refactor-data
Jul 21, 2024
Merged

refactor!: mv data processing to vite side#269
nekomeowww merged 9 commits into
nolebase:mainfrom
northword:dev/git-changelog-refactor-data

Conversation

@northword
Copy link
Copy Markdown
Member

@northword northword commented Jul 20, 2024

closes: #45
closes: #223
closes: #232

Working in progress

This PR modifies the structure of the data generated on the Vite side to avoid useless data entering the build results.

In addition, moving some of the data processing from the client side to the vite side (mainly the mapAuthors part) should make the logic clearer after the modification:

  • The vite side handles data-related content: what files are included, how the data structure and content is
  • The client side only deals with the form of the display: sorting, whether to display, hash word count, etc.

By the way, since the data processing is all done on the Vite side, it may be more friendly to some advanced users who need to use custom Vue components(?).

Using the build results from this repository as a benchmark, comparing the size of theme.hash.js (since all Git Logs currently go into theme.hash.js): before the PR, the file is 1.41M, after the PR it's 0.99M.

  • Reduce redundant data
  • Move data processing to the vite side instead of the client side where possible for better performance in the browser environment.
  • Exclude bot users
  • Remove ora because of duplicate logs and that the console is, in fact, already fully satisfied
  • Complete the test cases
  • improve documentation

BREAKING CHANGEs:

  • mapAuthors is now configured in the vite plugin instead of the Vue plugin.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 20, 2024

✅ Successfully deployed to Netlify

Platform Status URL
Ubuntu Success https://669c85f6e2b4390daa07823d--nolebase-integrations.netlify.app
Windows Success https://669c86009171a60c6237a866--nolebase-integrations.netlify.app

@nekomeowww
Copy link
Copy Markdown
Member

Possibly related #45

@nekomeowww nekomeowww added enhancement New feature or request pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog difficulty/hard Hard to deal with / implement against labels Jul 20, 2024
@northword northword marked this pull request as ready for review July 21, 2024 03:38
@northword northword requested a review from nekomeowww July 21, 2024 03:38
Copy link
Copy Markdown
Member

@nekomeowww nekomeowww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nekomeowww nekomeowww merged commit 59543b2 into nolebase:main Jul 21, 2024
@northword northword deleted the dev/git-changelog-refactor-data branch July 21, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty/hard Hard to deal with / implement against enhancement New feature or request pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog

Projects

None yet

2 participants