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

Improve default template download speed #12154

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Improve default template download speed #12154

merged 3 commits into from
Oct 10, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 8, 2024

Changes

Improves default template download speed by downloading from a branch containing the template only. There will be new examples/* branches (mapped to each examples directory) that are synced from main, the same way latest is synced from main currently.

We have 31 examples, so I only do this for --ref latest, and not --ref alpha/beta/rc, otherwise we will have 93 more branches to sync. Perhaps we should revisit our examples again, I don't know if everyone uses all of them.

Also updated some templates to add a missing .gitignore file.

Testing

For the main to examples/* branch syncing behaviour, I've tested this in my action at:

I also created manual examples/basics and examples/ssr branches here to test out, via node create-astro.mjs and node create-astro.mjs --template ssr. Speed-wise I can definitely feel the templates are installed much quicker now.

The only thing I'm unsure of is whether GitHub will be happy of 31 consecutive force pushes. Based on https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-authenticated-users, we should have 5000 req/hour, so likely safe though.

Docs

n/a. internal change

Copy link

changeset-bot bot commented Oct 8, 2024

🦋 Changeset detected

Latest commit: 4c3e767

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 🚨 action Modifies GitHub Actions pkg: create-astro Related to the `create-astro` package (scope) labels Oct 8, 2024
@bluwy
Copy link
Member Author

bluwy commented Oct 10, 2024

Going to hold off merging this until the next release is out. The current sync script (that was merged in another PR) waits until there's no changesets before syncing, so it hasn't actually ran before. Want to make sure on the next release when it clears out the changesets it's working as expected first.

@bluwy
Copy link
Member Author

bluwy commented Oct 10, 2024

Looks like it works! Going to merge this in after CI finishes

@bluwy bluwy merged commit 9988dd6 into main Oct 10, 2024
13 of 14 checks passed
@bluwy bluwy deleted the examples-fast-download branch October 10, 2024 13:32
@astrobot-houston astrobot-houston mentioned this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 action Modifies GitHub Actions pkg: create-astro Related to the `create-astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants