Support single element or top level arrays
- 主要語言
- JavaScript
- 星號
- 221
- 分支
- 8
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Building on @theianjones's proposal in #3.
> 1 open question is how to represent an array with a single element. The only idea I had was fragments like `<>...`. But that would be a separate PR anyway.
Given a component-like function:
```jsx
const Aliases = () => (
<>
)
```
Expect ``:
```json5
[
{
// name: "alias",?
from: "react",
to: "preact-compat",
},
{
// name: "alias",?
from: "react-dom",
to: "preact-compat",
},
]
```
Given:
```jsx
const Resolve = () => (
<>
)
```
Expect ``:
```json5
{
name: "resolve",
alias: [
{
from: "react-dom",
to: "preact-compat",
},
],
}
```
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
從 issue #3 中引用的提案開始,然後追蹤 JSX 範例目前是如何轉換為 JSON 的。驗證所述的兩種情況:返回多個頂層元素的元件會變成陣列,而巢狀在 parent 中的單一元素會變成包含一個元素的陣列。Issue 指出,fragment 語法是另一個獨立問題。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100