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

Fix SSG not generating the actual page content on initial load #1599

Merged
merged 4 commits into from
Aug 26, 2023

Conversation

abhijithmuthyala
Copy link
Contributor

@abhijithmuthyala abhijithmuthyala commented Aug 14, 2023

Fixes Issue

Closes #1477

Changes proposed

  • Generate the actual page content on initial load (/ and /[subcategory] routes), not just the Spinner />.
  • Fallback to 404 for the /[subcategoryThatsNotInTheDatabase] routes.

Screenshots

Before

empty-prerender.-.Made.with.Clipchamp.mp4

After

ssg.mp4

Note to reviewers

Currently, the route for a subcategory that isn't in the database (/cat for example) behaves almost as if a search query with that name is submitted (/search?query=cat), which certainly is a bug. In this PR I had to choose a fallback, and I went with a 404 page (fallback: false). If it's preferred to retain the current behaviour, fallback: 'blocking' can be temporarily used.

@vercel
Copy link

vercel bot commented Aug 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
linkshub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2023 4:30am

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you, abhijithmuthyala, for creating this pull request and contributing to LinksHub! 💗

The maintainers will review this Pull Request and provide feedback as soon as possible! 😇
We appreciate your patience and contribution, Keep up the great work! 😀

@abhijithmuthyala abhijithmuthyala changed the title Ssg Fix SSG not generating the actual page content on initial load Aug 14, 2023
@CBID2 CBID2 requested review from Anmol-Baranwal and removed request for ujjawaltyagii August 19, 2023 23:55
@CBID2 CBID2 added bug Something isn't working quick-fix Shouldn't take much time to finish level2 Modifying an existing feature labels Aug 19, 2023
@Anmol-Baranwal Anmol-Baranwal removed the level2 Modifying an existing feature label Aug 20, 2023
@Anmol-Baranwal
Copy link
Collaborator

@abhijithmuthyala
Post a video on what is changed. It will help us reviewing this quickly.

CBID2
CBID2 previously approved these changes Aug 20, 2023
Copy link
Collaborator

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

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

LGTM

@CBID2 CBID2 added the level3 Making completely new feature label Aug 20, 2023
@Anmol-Baranwal
Copy link
Collaborator

@CBID2
I don't think level is needed anymore, since it was specific for GSSoC'23. Feel free to add it, if you think otherwise.

@Anmol-Baranwal Anmol-Baranwal removed the level3 Making completely new feature label Aug 21, 2023
@CBID2
Copy link
Collaborator

CBID2 commented Aug 21, 2023

@CBID2

I don't think level is needed anymore, since it was specific for GSSoC'23. Feel free to add it, if you think otherwise.

Let's see what @rupali-codes thinks.

@rupali-codes
Copy link
Owner

@CBID2 I don't think level is needed anymore, since it was specific for GSSoC'23. Feel free to add it, if you think otherwise.
it would be better if we can rename the labels,

@CBID2
Copy link
Collaborator

CBID2 commented Aug 21, 2023

@CBID2 I don't think level is needed anymore, since it was specific for GSSoC'23. Feel free to add it, if you think otherwise.

it would be better if we can rename the labels,

So...do you agree or not @rupali-codes?

@rupali-codes
Copy link
Owner

@CBID2 I don't think level is needed anymore, since it was specific for GSSoC'23. Feel free to add it, if you think otherwise.

it would be better if we can rename the labels,

So...do you agree or not @rupali-codes?

i do..remove the labels for now

@abhijithmuthyala
Copy link
Contributor Author

@abhijithmuthyala Post a video on what is changed. It will help us reviewing this quickly.

Video posted in the linked issue is the bug and the one in this PR is the fix. I thought it would be unnecessary to duplicate the bug video both in the issue and in the PR. If it is preferred to have it in both the places, I'll keep that in mind for future contributions.

@Anmol-Baranwal
Copy link
Collaborator

@abhijithmuthyala Post a video on what is changed. It will help us reviewing this quickly.

Video posted in the linked issue is the bug and the one in this PR is the fix. I thought it would be unnecessary to duplicate the bug video both in the issue and in the PR. If it is preferred to have it in both the places, I'll keep that in mind for future contributions.

No, you shouldn't add a duplicate video. You can simply reference it.

I asked what the change was. It would be helpful to see it visually in the video.

@abhijithmuthyala
Copy link
Contributor Author

I asked what the change was. It would be helpful to see it visually in the video.

Hmm, I already posted the bug video in the issue and the fix video in the PR though? Anyways, if it is helpful to repeat the bug video here, sure. I updated the PR description, please check.

@Anmol-Baranwal
Copy link
Collaborator

I asked what the change was. It would be helpful to see it visually in the video.

Hmm, I already posted the bug video in the issue and the fix video in the PR though? Anyways, if it is helpful to repeat the bug video here, sure. I updated the PR description, please check.

I thought the PR one was the bug video. My bad😅 That's why I was suggesting that you post a video solution, but without repeating the bug video. No worries. I will check it out soon.

Copy link
Collaborator

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@Anmol-Baranwal Anmol-Baranwal left a comment

Choose a reason for hiding this comment

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

🚀 Looks good to me.

It will be better if you can also describe the approach of the code from next time. Because reviewing it without that would take a lot of time.

@rupali-codes
Please review this.

@CBID2 CBID2 merged commit 349e748 into rupali-codes:main Aug 26, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working quick-fix Shouldn't take much time to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Static generation only generates a Spinner, not the actual content
4 participants