Volt components do not support namespacing, causing conflicts across modules with same component names
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
調査の方向性
この issue では Volt components と namespaced Livewire/Blade tags について説明されていますが、ファイルやテストの名前は示されていません。まず、Volt がどのように components を登録し、Livewire がどのように namespaced tags を解決するかを追跡してください。2 つの同名の components を、一方が他方を上書きすることなく独立して参照できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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 />
- 主要言語
- PHP
- スター
- 423
- フォーク
- 36
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
livewire/volt のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rap2hpoutre/fast-excel#425 ·
-
bug Medium Priority
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
Перевод устарел
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100