-
Notifications
You must be signed in to change notification settings - Fork 340
Adding skip_common_chunks
option to the get_files()
template tag
#386
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
Conversation
bump |
used_urls = getattr(request, '_webpack_loader_used_urls', None) | ||
if not used_urls: | ||
used_urls = request._webpack_loader_used_urls = set() | ||
return [x for x in result if x['url'] not in used_urls] |
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.
Since there's more code here, we need to test this. Can you add tests that covers all conditions here?
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.
Thanks for you contribution!
Overall looks good, but needs more tests to avoid a coverage decrease.
With all due respect, you are placing too much weight on the coverage. My code uses the same underlying functions that are already tested out. Feel free to add tests though, I just can't be bothered. |
Covering |
Thanks for adding the tests. Could you please do a quick release so I can start using it? |
3.0.1 published. |
Thanks. Can confirm it's working. |
Season's greetings. :)
I need
get_files()
to be able to useskip_common_chunks
just likerender_bundle()
does, so I took a couple hours and implemented it.The goal here is to be able to render
<link rel="prefetch">
(not preload) tags manually, skipping the ones from the chunk that are already downloaded viarender_bundle()
.Have this as my free contribution. :)