Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fix: Ignore declarations used by code snippets that will never end up in the WGSL code

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

メンテナーはふだん 2 日以内に返信

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

評価

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

調査の方向性

The reproduction is a test that calls tgpu.resolve([fn]) and checks the output with toMatchInlineSnapshot; run it first and compare the generated WGSL against the snapshot. The issue is that helper is emitted even though its only use sits in a branch that never reaches the output. Find where the resolver collects dependent declarations and where it decides which ones to emit. Done means helper is omitted in that case and the snapshot is updated.

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

説明

[!NOTE]
This might not be worth the effort

This is not super urgent, it's mostly a cosmetic issue, but we might be able to (in rare cases) reduce the amount of code we generate.

test('...', ({ root }) => {
  const helper = () => {
    'use gpu';
    return 0;
  };
  const fn = () => {
    'use gpu';
    if (std.typeOf(helper()) === d.i32) {
      return 1;
    } else {
      return 0;
    }
  };

  expect(tgpu.resolve([fn])).toMatchInlineSnapshot(`
    "fn helper() -> i32 {
      return 0;
    }

    fn fn_1() -> i32 {
      return 1;
    }"
  `);
});
主要言語
TypeScript
スター
3.3k
フォーク
140
平均マージ
3日 21時間
マージ済み PR(30日)
68

環境構築

はじめの一歩

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

software-mansion/TypeGPU のほかの issue

software-mansion/TypeGPU の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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