-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
chore: refactor the generateBlogData
function
#7607
chore: refactor the generateBlogData
function
#7607
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the generateBlogData function to simplify the code and improve performance by leveraging Promise.all for parallel file processing.
- Apply Promise.all with a map over filenames to process file frontmatter concurrently.
- Simplify the accumulation of raw frontmatter and resolution logic for each file.
generateBlogData
functiongenerateBlogData
function
9c5c742
to
c497efa
Compare
c497efa
to
a0c01a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks
Lighthouse Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great first official contribution - thanks!
This reverts commit b7364b9.
Description
This PR is simply am refactoring the
generateBlogData
function, as I was working around the function I noticed that the code could be simplified andPromise.all
could be used to read the files frontmatter in parallel, hopefully this makes sense and I am not missing some nuances in the code 😅If the changes here are correct they should both simplify the code and make it faster 🙂
Validation
I simply run
npm run dev
to manually validate that this is working as intendedRelated Issues
Check List
npm run format
to ensure the code follows the style guide.npm run test
to check if all tests are passing.npx turbo build
to check if the website builds without errors.