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

feat: add devtools updates #673

Merged
merged 3 commits into from
Oct 28, 2024
Merged

feat: add devtools updates #673

merged 3 commits into from
Oct 28, 2024

Conversation

ignatiusmb
Copy link
Member

@dummdidumm
Copy link
Member

Can you add a comment to the code explaining why we need this?

Copy link

vercel bot commented Oct 28, 2024

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

Name Status Preview Comments Updated (UTC)
svelte-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 6:37pm

@ignatiusmb
Copy link
Member Author

Added a comment on top of the file. I haven't really thought of other plans for /devtools, but I'd guess we'd want to compartmentalize this into its own route, instead of https://svelte.dev/updates.json.

@Rich-Harris
Copy link
Member

What happens if we're rate-limited (or the request fails for some other reason) as we're trying to prerender?

Note also that this won't update when the tags update, only when the tags update and we've redeployed the site, which depending on what other activity is happening could be a long delay.

We could try making it an ISR route? Otherwise I think it has to live elsewhere

@ignatiusmb
Copy link
Member Author

The tags not updating until we redeploy the site is a concern indeed, I thought it'd be fine for users to wait but it could theoretically take days or weeks before the site is redeployed.

Making this an ISR route seems to be the sweet spot, rate limits shouldn't be a concern as GH allows 60 reqs/h — unless I'm mistaken about how ISR works and it only caches for each unique IP requests? Which.. I haven't thought about how to tackle in that case

This update manifest needs to be hosted under https and I initially thought about spinning up its own site under https://devtools.svelte.dev or something but it seems like too much just to host a single file. Do you have any ideas if this were to 'live elsewhere'? One other alternative I can think of would probably be GH pages

@Rich-Harris
Copy link
Member

Converted it to an ISR route, checked and it works perfectly! It will revalidate every 5 minutes, so we should stay comfortably under rate limits.

@Rich-Harris Rich-Harris merged commit 6298f93 into main Oct 28, 2024
5 checks passed
@Rich-Harris Rich-Harris deleted the devtools-updates branch October 28, 2024 18:44
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