You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If spear allow the top level sibling element, we doesn't add class attribute, because there are few sibling elements.
Proposal
Spear don't allow the sibling element on top level of component.
Vue / React / Astro doesn't allow this element as well.
Error component files:
<div>
<h1>Hello</h1>
</div>
<!-- Following elements are sibling of top div element -->
<ul>
<li> 你好</li>
<li>Bonghjornu</li>
<li>سلام</li>
<li>こんにちは</li>
</ul>
Concern
This feature might broke exist site which using top-level siblings.
We need the option which enabling this feature like:
The text was updated successfully, but these errors were encountered:
mantaroh
changed the title
[Proposal] Don't allow top level sibling elements.
[Proposal] Don't allow top level sibling elements in component. / 【提案】コンポーネント内のトップレベル兄弟要素を禁止する。
Aug 29, 2023
I'm along with this proposal overall but I am also concerned that the feature forces the user to make awkward HTML markup or requires extra effort in some cases.
If the user wants to share some part inside <head> tag like <meta> tags for OGP via spear component, what tag should be used to wrap up them?
In case the user wants to renew some site, some components from an old site should be made of sibling components. If top-level siblings are not allowed, they have to wrap them with an element not used in the old one. The styles of the new site could collapse in this situation.
Vue / React / Astro doesn't allow this element as well.
These libraries provide workarounds for such cases and it also should be promoted for this library.
What is this?
At the moment, Spear allow sibling elements on components like:
This rule might block some features:
Proposal
Spear don't allow the sibling element on top level of component.
Vue / React / Astro doesn't allow this element as well.
Error component files:
Concern
This feature might broke exist site which using top-level siblings.
We need the option which enabling this feature like:
これは何?
現在、Spear は次のような兄弟要素をコンポーネントで許可しています。
このルールは以下の追加しようとする機能で、不要なものになります
提案
Spear のコンポーネントでトップレベルの兄弟要素を許可しないようにする
Vue / React / Astro などでも同じように許可していません。
エラーとなるコンポーネント例:
懸念点
この機能はすでにトップレベルの兄弟要素を利用している既存のサイトを壊す可能性があります。
そのため、以下のような機能を有効にするオプションを用意する必要があります。:
The text was updated successfully, but these errors were encountered: