Metadata not generated correctly for Typescript components

Aperta
#3,017 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
documentation

Direzione di ricerca

Inizia tracciando come viene generato metadata.json per le props dei componenti TypeScript, usando l'esempio persistence?: boolean | string | number per riprodurre il problema. Il lavoro è completato quando l'unione generata conserva boolean, le docstring del componente lo riflettono e impostare persistence=True non produce più l'avviso segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug P2

With TypeScript components, the metadata.json file is not generated correctly in cases where there is a union with a boolean.

For example,

persistence?: boolean | string | number;

The metadata.json file only includes the string and number but not the boolean.

 "persistence": {
        "description": "Used to allow user interactions in this component to be persisted when\nthe component - or the page - is refreshed. If `persisted` is truthy and\nhasn't changed from its previous value, a `value` that the user has\nchanged while using the app will keep that change, as long as\nthe new `value` also matches what was given originally.\nUsed in conjunction with `persistence_type`.",
        "required": false,
        "type": {
          "name": "union",
          "value": [
            {
              "name": "string",
              "raw": "string"
            },
            {
              "name": "number",
              "raw": "number"
            }
          ],
          "raw": "string | number | boolean"
        }
      },


The docstrings are not generated correctly:

image

Also, setting the persistence=True on the component generates this warning in the console:

image

Lingua principale
Python
Stelle
24.4k
Fork
2.3k
Merge medio
2g 7h
PR unite (30g)
13

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di plotly/dash

Tutte le issue di plotly/dash

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.