Skip to content

Conversation

brophdawg11
Copy link
Collaborator

Mostly copied stuff straight over - just had to move the filtering to a clientLoader

Comment on lines +10 to +14
let resources = await getAllResources({ octokit });
return {
resources,
featuredResource: null,
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This used to have all the selectedCategory/selectedTags stuff - moved to a clientLoader because SSG won't have query params

Copy link
Contributor

Choose a reason for hiding this comment

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

Haha yeah, going back to the server for this doesn't even super make sense, since we have to send down all the data anyway and it's not changing in between deploys

Cool that await serverLoader(); just grabs whatever the prerender phase created. Never really thought about it but makes total sense

return { ...resource, siteUrl };
};

export async function clientLoader({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pretty much everything in here is just copied from what we used to do on the server

<main>
{show ? (
<div className="container flex flex-1 flex-col items-center md:mt-8">
<p>Loading resources....</p>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Flash in a loading message if they stare at a blank screen for >2 seconds which should really never happen

Comment on lines +16 to +21
// Force this layout HydrateFallback to render on initial load so we can
// eliminate the footer and avoid needing to fill height with a skeleton
export function clientLoader() {
return null;
}
clientLoader.hydrate = true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This might be a bug or a gap in RR - I thought we bubbled to the nearest HydrateFallback but it looks like it's 1:1 so just having the clientLoader.hydrate on the child route is not enough to get this route HydrateFallback to show. I wanted to do it at this level so we didn't have the footer collapse up on us when there was no content and cause a flicker. By doing it here I can just hide the footer until the content is ready.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm yeah, feels like it should work the way you expected. Either way, this approach makes sense

@@ -0,0 +1,2 @@
# A token to increase the rate limiting from 60/hr to 1000/hr
GITHUB_TOKEN=""
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I missing something? I added this to my .env file but build fails

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

huh - yeah I must have exported it locally in the shell during my testing - added dotenv 👍

Copy link
Contributor

@brookslybrand brookslybrand left a comment

Choose a reason for hiding this comment

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

It all works well for me!

Thanks for helping preserve my first (or second?) contribution on this team

I think the only things that need to be fixed are

  • loading in the GITHUB_GITHUB_TOKEN to process.env on build
  • adding that token on to GitHub for deployment

@brookslybrand
Copy link
Contributor

Went ahead and fixed some type errors btw @brophdawg11

@brophdawg11 brophdawg11 force-pushed the brophdawg11/resources branch from 2757dea to 3fcccbe Compare August 25, 2025 15:01
@brookslybrand
Copy link
Contributor

@brophdawg11 thanks for fixing that up and adding the nav. I'm good to merge this whenever you are! Also happy to cleanup the remix-website side if you need to shift back focus to some other things

@brophdawg11 brophdawg11 merged commit c371b4c into main Aug 25, 2025
2 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/resources branch August 25, 2025 17:11
@brophdawg11
Copy link
Collaborator Author

I'll take a stab at it - it's a nice easy/defined piece of work I can do before vacation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants