Improve default template download speed #12154
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 frommain
, the same waylatest
is synced frommain
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
toexamples/*
branch syncing behaviour, I've tested this in my action at:I also created manual
examples/basics
andexamples/ssr
branches here to test out, vianode create-astro.mjs
andnode 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