lang-core: member access on a component instance reads its internal fields instead of giving null
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- compilers
調査の方向性
まず spec/language.md のセクション3.1を読み、次に runtime/evaluator.ts で Member、Index、pluck がどのように評価されるかを確認してください。現在、要素ノードはそこで内部フィールドを公開しているため、これらのアクセスは null を返すべきです。再現コードの Col.data が [null, null, null, null, [null, null]] になれば完了です。これは library.json フィクスチャを使い、packages/lang-core/src/__tests__/conformance.test.ts で実行される evaluation/ の新しいケースで示します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
spec/language.md section 3.1 says: "In an expression, a component instance acts like an object: toNumber gives 0 and member access gives null."
The lang-core evaluator does give 0 for toNumber, but member access on a component instance reads the internal ElementNode fields instead of giving null. card.typeName is "Card", card.props is the props object, card.type is "element", and the same happens with card["props"] and with a pluck over a list of components (cards.typeName). Fields that are not on the node (card.title) do give null, so the result depends on the node's internal shape.
To Reproduce
With the conformance test library (spec/fixtures/1.0/library.json):
root = Stack([Table([c1])])
card = Card("x")
cards = [card, Card("y")]
c1 = Col("m", [card.title, card.typeName, card.props, card["props"], cards.typeName])
Run it through createParser and evaluateRoot (for example as an evaluation/ case under OPENUI_FIXTURES, using the runner in packages/lang-core/src/__tests__/conformance.test.ts).
Col.data is:
[null, "Card", {"title": "x"}, {"title": "x"}, ["Card", "Card"]]
Expected behavior
Per section 3.1, every entry is null:
[null, null, null, null, [null, null]]
A small fix in runtime/evaluator.ts (return null for Member and Index on an element node, and null for element nodes in a pluck) plus an evaluation/ conformance case would cover it. Happy to open a PR once the direction is confirmed.
Additional context
@openuidev/lang-core1.1.1,mainat054b6c4e9.- Node 26, no browser involved.
- 主要言語
- TypeScript
- スター
- 10k
- フォーク
- 698
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 123
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
thesysdev/openui のほかの issue
-
react-ui: OpenUI Lang ScatterChart ignores xLabel and yLabel対応中かも @udsy19 が 6 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
lang-core: prompt signatures list z.enum keys instead of values対応中かも @udsy19 が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
thesysdev/openui#1445 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
thesysdev/openui の issue をすべて見る
似ている issue
-
bug done
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
neavo/LinguaGacha#1124 ·
メンテナーはふだん 1 日以内に返信
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errors対応中かも @fullsend-ai-coder が今日担当しました。 オープンe2e-failure ready-to-code
難易度 2/5 1時間未満 初心者へのやさしさ 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
brylie/mission-island#225 ·
メンテナーはふだん 1 日以内に返信
-
status/need-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
google-gemini/gemini-cli#30412 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信