Volt components do not support namespacing, causing conflicts across modules with same component names
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Issue mô tả Volt components và namespaced Livewire/Blade tags nhưng không nêu tên file hoặc test nào. Hãy bắt đầu bằng cách lần theo cách Volt đăng ký components và cách Livewire phân giải namespaced tags; hoàn tất khi hai components cùng tên có thể được tham chiếu độc lập mà một component không ghi đè component kia.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Volt Version
1.7
Laravel Version
12
PHP Version
8.4
Database Driver & Version
No response
Description
In my Laravel project, I follow a modular structure where each module can have its own set of Livewire components. It’s common for different modules to have components with the same name (e.g., Button), and Livewire allows for namespacing to prevent conflicts:
class Button extends Component
{
public function render()
{
return view('somemodule::livewire.button');
}
}
Then in the Blade view, I can use:
<livewire:somemodule::button />
This works perfectly and avoids naming collisions.
However, when using Volt components, the render() method is not defined, and as a result, I cannot specify a view path or namespace. Volt components are always referenced like:
<livewire:button />
If multiple Volt components with the same name exist across different modules, one of them overwrites the others. This makes it impossible to use the same component name in different modules when using Volt.
Steps To Reproduce
- Create a Laravel modular project structure.
- In ModuleA, create a Volt component named Button.
- In ModuleB, create another Volt component also named Button.
- Attempt to reference both components in a Blade file (components will not be found):
<livewire:module-a::button />
<livewire:module-b::button />
- Observe that only one of the components is registered and used, due to lack of namespacing in Volt.
<livewire:button />
- Ngôn ngữ chính
- PHP
- Star
- 423
- Fork
- 36
- 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
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 livewire/volt
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của livewire/volt
Issue tương tự
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug Feature: Kiosk
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Infrastructure: actions Module: zmscitizenapi Module: zmsentities php Type: Bug unit tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
it-at-m/eappointment#3480 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HttpClient
Độ 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 1 ngày
-
CI: composer install fails — league/flysystem 1.x blocked by security advisory GHSA-cxf4-7mrp-vvprĐang mởdevops type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày