Skip to content

Upgrade to Astro v5 and preact #1153

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lukewarlow
Copy link
Collaborator

This happens to improve the prefetch behaviour so that it only happens on link hover instead of on page load.

@@ -6,7 +6,8 @@ const CONTRIBUTORS = [];
const fetchContributors = async (page) => {
const response = await fetch(`${CONTRIBUTORS_URL}?page=${page}`);
const contributors = await response.json();
CONTRIBUTORS.push(...contributors);
if (Array.isArray(contributors))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The home page crashes locally pretty quickly without this check, as GitHub API has rate limits.

@lukewarlow
Copy link
Collaborator Author

I think this will need the netfliy nodejs version upgraded.

@lukewarlow lukewarlow changed the title Upgrade to Astro v5 Upgrade to Astro v5 and preact Feb 7, 2025
This happens to improve the prefetch behaviour so that it only happens on link hover instead of on page load.
This reduces the size of the JS bundles.
Copy link
Collaborator

@mfreed7 mfreed7 left a comment

Choose a reason for hiding this comment

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

I'm definitely not comfortable reviewing this one - anyone else that can review and is authoritative on Astro?

…vokers polyfill and reduce navigation-container complexity
Comment on lines 61 to 62
<NavigationContainer client:load>
<NavigationContainer client:only>
<CommunityLinks className="mobile" />

Choose a reason for hiding this comment

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

Does this mean the JS for CommunityLinks runs client-side too? It inlines a bunch of SVGs into JSX, definitely want to avoid having it in any client bundles.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point will need to double check that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So there's 4 inlined SVGs into the JSX but that's the case anyway. Seems fine?

Choose a reason for hiding this comment

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

Probably better off converting them into a sprite sheet & consuming with <use>.

Not that a few SVGs is the end of the world but that's objectively the most expensive way to use them & by a large margin too.

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.

3 participants