-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Prefetch CSS only once #4557
Prefetch CSS only once #4557
Conversation
🦋 Changeset detectedLatest commit: c52979f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This seems like a totally reasonable change! I'll ping @tony-sull to take a look at this as well. Any idea why tests are failing? |
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.
lgtm
Sorry, I am not able to run the tests on my local machine.
It's hard to write proper tests when you can only run them in Github Actions |
.filter((el) => !loadedStyles.has(el.href)) | ||
.map((el) => { | ||
loadedStyles.add(el.href); | ||
return fetch(el.href); |
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.
This promise needed to be returned, which might fix the tests! Watching CI to see.
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.
@Jelenkee can you try this?
Closing because the tests are failing. @Jelenkee If you get time, the above suggestion might fix the tests, in which case you can resubmit a new PR. |
Changes
When multiple links where prefetched the same CSS files where fetched multiple times as well.
This PR changes the behaviour so that a CSS file is not fetched more than once.
Testing
Docs