-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
Add link=preload support #344
Conversation
jgillespie seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
@TheRoadyBuddha Thanks for PR,
i think we should do preload for async chunk always (without options), can you provide link on documentation Other solution use Also please accept CLA and add tests |
@evilebottnawi Documentation has been changed, CLA signed, and now preload is the default behavior for any browser that supports it. On the tests, all the existing tests pass (the failing CI test above has to do with an npm vulnerability not related to this PR). I'm struggling to find a test for this that doesn't replicate a test that is already in this test suite, since the behavior should mirror master today. Was there something specific you had in mind? |
You need add new test for new feature |
Also please read #344 (comment) |
@TheRoadyBuddha This would be such a great feature and you're almost there! Don't give up 🥇 |
Thanks working for me in my repo, and pass the lighthouse error :) it should to be merged i think ?no? for info i use gatsby i just changed the core of minicss-extract-plugin to match this patch. |
Thanks for your interest. I just need to add tests. My schedule has been a
little hectic. This has been used in a production environment for a while
so it is very stable. I hope to circle back and wrap this up within a week.
|
Any updates? |
+1 would really like to have this feature |
@evilebottnawi I've added the appropriate test updates. rel="preload" is the default behavior (it will still fall back to the original behavior in older browsers. I've also singed the CLA and all linting passes locally. Let me know if you have any questions. Better late than never on this one! |
Hi there, is there anything additional that needs to be done to get this merged? |
I've been quietly following this, is there anything needed to get this merged and released? |
* WIP - preload CSS Inspired by webpack-contrib/mini-css-extract-plugin#344 * feat: preload css * test(TestCases): re-enable logging
For those who are still waiting, there is workaround for mini-css-extract-plugin > 1.2.0 :
|
`execLinkTag.href = ${mainTemplate.requireFn}.p + ${linkHrefPath};`, | ||
'execLinkTag.rel = "stylesheet";', | ||
'execLinkTag.type = "text/css";', | ||
'document.body.appendChild(execLinkTag);', |
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.
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.
Also, we had a problem in out internal framework with this changes, because we append preload
and stylesheet
links directly in document.head, with some custom onload
logic, and after package updating, i see a broken integration test with new link tag inside body)
hello guys !! |
Fixed in master, release soon |
This PR contains a:
Motivation / Use-Case
This pull request adds
<link rel="preload">
support, per this issue: #142.This is to support recent changes in Chrome Lighthouse that strongly hurt performance scores due to not using rel="preload" with asynchronous chunks, as well as improve page load performance. (More details provided https://developers.google.com/web/tools/lighthouse/audits/preload).
Fallbacks are provided for all browsers that do not support rel="preload".
Breaking Changes
No breaking changes.
Additional Info