Generated channel client fails noUnusedLocals without hooks

Aperta
#112 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@mossygrave ci sta già lavorando.

Dal 10/11/2026.

  • #115 di @mossygrave — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
elixir, typescript

Direzione di ricerca

Start by locating the generator code that emits executeActionChannelPush and the Channel import; the issue does not name their files, so search the repository for those generated strings. Reproduce with the empty manifest and the exposed-action case, then type-check the generated files with noUnusedLocals: true. Done means both cases compile without TS6133 diagnostics and codegen --check still passes.

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

Descrizione

bug
Code of Conduct
  • I agree to follow this project's Code of Conduct
AI Policy
  • I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.
Versions

ash_typescript 0.19.3; TypeScript 7.0.2 and 6.0.3 (reproduced with both); Phoenix JS 1.8.16; @types/phoenix 1.6.8; Elixir 1.20.4; OTP 29.1.1

Operating system

Debian 12 (bookworm) x86_64

Current Behavior

Without channel hooks, generated executeActionChannelPush declares processedConfig but never uses it:

TS6133: 'processedConfig' is declared but its value is never read.

This occurs with an exposed action. An empty RPC manifest additionally produces an unused Channel import.

Reproduction

The smallest case uses an empty manifest:

defmodule MyApp.TypescriptManifest do
  use AshTypescript.Manifest, otp_app: :my_app, domains: []
end

Configure generation without before/after channel hooks:

config :ash_typescript,
  manifest: MyApp.TypescriptManifest,
  output_file: "../web/src/lib/generated/ash_rpc.ts",
  run_endpoint: "/rpc/run",
  validate_endpoint: "/rpc/validate",
  generate_phx_channel_rpc_actions: true,
  generate_validation_functions: false

Run mix ash_typescript.codegen, then type-check the generated files in a Phoenix TypeScript project with noUnusedLocals: true.

Both processedConfig and Channel produce TS6133 errors. A separate manifest exposing one action still produces the processedConfig error.

Both generated outputs pass codegen --check; that confirms generator provenance, not TypeScript compilation success. noUnusedParameters produces no additional diagnostics.

Expected Behavior

Omit unused declarations/imports so generated clients pass noUnusedLocals without manual edits or unnecessary hooks.

Lingua principale
Elixir
Stelle
103
Fork
36
Merge medio
1m
PR unite (30g)
1

Preparare l'ambiente

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 ash-project/ash_typescript

Tutte le issue di ash-project/ash_typescript

Issue simili

Altre issue su Elixir

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.