[Using a plugin] Scoped CSS changes require two page reloads.
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
Hướng nghiên cứu
Reproduce the delayed CSS update using the linked example and the demo at lib/pain_web/live/demo.ex. Start by inspecting config/dev.exs, the live_reload patterns, and the flow from assets/css/_components.css to assets/css/app.css. Done means scoped CSS changes are present after the first file save and page reload, including with the DaisyUI plugin.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The main reason I chose to use Surface is for the inline, scoped styling rules per-component. Amazing!
Sadly, there is a synchronization issue on the live page reloads;
compiling the CSS from assets/css/_components.css to assets/css/app.css
requires longer than the live page reload takes to complete.
(This could be because I am including a Tailwind plugin called DaisyUI, bulking up my CSS.)
Regardless, my in-component CSS changes only appear after a second file-save.
Both file saves reload the page. On the first pass, no changes have been applied to the CSS.
Some duration after the first reload, the _components.css is changed on disk,
so any additional file save reloads the page again and applies those changes.
How to reproduce it
This issue appears in my codebase for a client.
You could clone and run https://base.bingo/code/pain/src/branch/daisy -
a basic Phoenix LiveView app using Surface, and the daisyui NPM package as a Tailwind plugin.
I'm running these experiments in lib/pain_web/live/demo.ex, on address 0.0.0.0:4000/demo.
This is my initial experience using Surface, so there is a chance this is a common issue.
The behavior you expected
Synchronized scoped-CSS changes appearing on each reload.
Your Environment
Surface: v0.11.0
LiveView: v0.19.5
Elixir: v1.15.4
Additional Approaches
I had no luck adding _components.css to my config/dev.exs:
config :pain, PainWeb.Endpoint,
reloadable_compilers: [:gettext, :elixir, :app, :surface],
live_reload: [
patterns: [
~r"lib/pain_web/(controllers|live|components)/.*(ex|heex|sface|js)$",
~r"assets/css/_components.css",
~r"priv/catalogue/.*(ex)$",
~r"priv/gettext/.*(po)$",
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
]
]
- Ngôn ngữ chính
- Elixir
- Star
- 2.1k
- Fork
- 146
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của surface-ui/surface
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
surface-ui/surface#634 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#770 ·
-
Website is downĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#768 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#762 · 2 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#759 · 1 reaction ·
Tất cả issue của surface-ui/surface
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
ci-cd
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
carverauto/serviceradar#5648 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Elixir Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
getsentry/sentry-elixir#1242 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
open-telemetry/opentelemetry-erlang-contrib#846 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100