Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Force complete reload for stylesheets and images

Đang mở
#124 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, python
Lĩnh vực
devtools, web-dev

Hướng nghiên cứu

Start in the mentioned livereload.js code and trace how static stylesheet and image changes are handled, including the liveCSS and liveImg values in WebSocket messages. Check how the Python side creates those messages only as needed. Done means the behavior can be configured so templates without link or style elements receive a complete reload for the affected assets.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

type: feature

I'm using livereload to preview email templates for a project I'm working on. The templates are rendered using Jinja, images are inlined with cid: references (or data: URIs in the case of previewing) and the whole thing is then run through premailer in order to inline all the css onto the elements.

This all works great, I get an instant reload whenever I edit my templates or the json payload going into Jinja. I seem to be having a small issue when it comes to CSS files though, as livereload intelligently identifies them as static assets which can simply be reloaded without refreshing the entire page. In my case this presents a problem though, as there are no link (or even style) element to reload and therefore nothing happens.

I've been looking through the source and was thinking I could change the behaviour by sending liveCSS: False and liveImg: False, but it appears this is not the issue as they're both always true in the WebSocket frames received in the browser. This leads me to believe that the actual logic for how to reload static assets is computed in the livereload.js javascript rather than in python code creating the message after each file modification event.

Could anyone point me in the right direction regarding this matter? I'll be happy to supply a PR adding support for this as configurable option in case I'm able to come up with a satisfactory solution (and given such an option is within the project's scope of course).

Ngôn ngữ chính
Python
Star
1.1k
Fork
148
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lepture/python-livereload

Tất cả issue của lepture/python-livereload

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.