-
-
Notifications
You must be signed in to change notification settings - Fork 521
feat: Preload & deprioritize some fetches #1326
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,13 +14,21 @@ function checkStatus(r) { | |
| const baseUrl = '/.netlify/functions/'; | ||
|
|
||
| export const fetchOrganizationRepos = org => | ||
| fetch(`${baseUrl}repos?org=${org}`, { credentials: 'omit' }) | ||
| fetch(`${baseUrl}repos?org=${org}`, { | ||
| credentials: 'include', | ||
| mode: 'no-cors', | ||
| priority: 'low' | ||
| }) | ||
| .then(checkStatus) | ||
| .then(r => r.json()) | ||
| .catch(() => getFallbackData().preactOrgRepos); | ||
|
|
||
| export const fetchRelease = repo => | ||
| fetch(`${baseUrl}release?repo=${repo}`, { credentials: 'omit' }) | ||
| fetch(`${baseUrl}release?repo=${repo}`, { | ||
| credentials: 'include', | ||
|
Comment on lines
-23
to
+28
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm lacking the context for why |
||
| mode: 'no-cors', | ||
| priority: 'low' | ||
| }) | ||
| .then(checkStatus) | ||
| .then(r => r.json()) | ||
| .catch(() => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's essential that these are set to these specific values for Safari support.
Not entirely sure why this is, as it deviates from Chrome & FF, but it's been the case for going on 5 years now so I don't think the Safari team particularly cares about aligning. Here's an StackOverflow post about it.