Skip to content

chore(non-verbal): drop unused type guards from types.ts#73

Merged
ronaldtse merged 1 commit into
mainfrom
chore/slim-non-verbal-types
Jun 22, 2026
Merged

chore(non-verbal): drop unused type guards from types.ts#73
ronaldtse merged 1 commit into
mainfrom
chore/slim-non-verbal-types

Conversation

@ronaldtse

Copy link
Copy Markdown
Member

Closes TODO.figures/19 Step 7.

What

  • Deleted isFigure/isTable/isFormula from types.ts + barrel re-export.
    They were never consumed — components narrow via the discriminated kind tag directly.
  • Refreshed NonVerbRepV3 docstring: glossarist 0.4.2 still ships the stale pre-V3 .d.ts,
    so the local interface stays load-bearing. Drop condition updated accordingly.
  • Bumped to 0.7.49.

Why Option B (not Option A)

TODO 19 Step 7 offered two paths:

  • A: Bridges return glossarist-js class instances; components narrow with instanceof. ~10-file refactor.
  • B: Keep wire-shape interfaces; remove dead code only.

Option A's DRY gain is real but marginal — the consumer still needs JSON-LD bridges
until the V2 GCR-direct pipeline lands, so the bridges would just swap one literal
shape for a class constructor call. Picked B. The remaining interfaces (Figure,
Table, Formula, FigureImage, LocalizedString, etc.) are all in active use
as the wire contract between bridges and components.

Verification

  • npm test: 797/797 passing
  • vue-tsc --noEmit: clean
  • No behavioral change — pure type-only cleanup

isFigure/isTable/isFormula were only re-exported from the barrel,
never consumed — components narrow via the discriminated `kind` tag
directly. Also refresh the NonVerbRepV3 docstring: glossarist 0.4.2
still ships the stale pre-V3 .d.ts, so the local interface is still
load-bearing.

Closes TODO.figures/19 Step 7 (option B: wire-shape types stay,
dead code removed).
@ronaldtse ronaldtse merged commit 9232017 into main Jun 22, 2026
4 checks passed
@ronaldtse ronaldtse deleted the chore/slim-non-verbal-types branch June 22, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant