Support single element or top level arrays
- Lingua principale
- JavaScript
- Stelle
- 221
- Fork
- 8
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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",
},
],
}
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start with the proposal referenced in issue #3, then trace how the JSX examples are currently converted into JSON. Verify the two stated cases: a component returning multiple top-level elements becomes an array, while a single element nested in a parent becomes a one-item array. The issue notes that fragment syntax is a separate concern.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100