Metadata not generated correctly for Typescript components

オープン
#3,017 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
documentation

調査の方向性

まず、TypeScript コンポーネントの props 用に metadata.json がどのように生成されるかを追跡し、persistence?: boolean | string | number の例を使って問題を再現します。生成された union に boolean が保持され、コンポーネントの docstring にそれが反映され、persistence=True を設定しても報告された警告が発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
24.4k
フォーク
2.3k
平均マージ
2日 7時間
マージ済み PR(30日)
13

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

plotly/dash のほかの issue

plotly/dash の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。