Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#3,203 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

[!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;
    }"
  `);
});
Lenguaje dominante
TypeScript
Estrellas
3.3k
Forks
135
Merge medio
4 d 1 h
PR fusionados (30 d)
64

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de software-mansion/TypeGPU

Todos los issues de software-mansion/TypeGPU

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.