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

refactor: parallelize version fetching in javadocs page #117

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/pages/javadocs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ const Javadocs: NextPage<JavadocProps> = ({
export default Javadocs;

export const getStaticProps: GetStaticProps<JavadocProps> = async () => {
const { version_groups: paper_groups } = await getProject("paper");
const { version_groups: folia_groups } = await getProject("folia");
const { version_groups: velocity_groups } = await getProject("velocity");
const { version_groups: waterfall_groups } = await getProject("waterfall");
const [paper_groups, folia_groups, velocity_groups, waterfall_groups] =
await Promise.all([
getProject("paper").then(({ version_groups }) => version_groups),
getProject("folia").then(({ version_groups }) => version_groups),
getProject("velocity").then(({ version_groups }) => version_groups),
getProject("waterfall").then(({ version_groups }) => version_groups),
]);

return {
props: {
paperVersion: paper_groups[paper_groups.length - 1],
Expand Down