Skip to content

Do PropTypes go when a panel gets typed props? #230

Closed

Description

@jtklein-agents

Question

When a panel becomes .tsx with a props type, is its PropTypes block deleted in the same leaf, kept, or removed in a later sweep with the prop-types dependency? Deleting it removes a runtime check, which the map's types-only rule may forbid.

Activity

  1. added
    wayfinder:grilling
    on Nov 16, 2026
  2. jtklein-agents commented on Nov 16, 2026

    @jtklein-agents
    OwnerAuthor

    Resolution

    PropTypes go, in the same leaf that gives the panel typed props.

    The question's premise was wrong. Deleting a propTypes block removes no runtime check. The installed React is 19.3.1 and its development builds contain no reference to propTypes; React 19 ignores them. The blocks' only remaining effect is that tsc reads them to infer props while the file is JavaScript, which stops at the rename. So deleting one is dead-code removal and sits inside the map's types-only rule.

    Decisions

    • Same leaf. When a panel becomes .tsx, its propTypes block and its prop-types import are deleted in that leaf.
    • Store-object props (run, alignment, tree, citation, store) are typed by a small module-local interface holding only what that panel reads. No import type of the store class. This is the rule from the Option prototype, and what src/app/components/OptionSelect.tsx already does with OptionSelectOptionLike.
    • Required and optional carry over exactly. isRequired becomes a required member; every other prop gets ?. A leaf neither loosens nor tightens a panel's contract.
    • The direct dependency. The prop-types line leaves package.json in whichever leaf deletes the last import. The yarn.lock stanza stays: MUI and react-transition-group still depend on it.
    • Naming follows the existing .tsx components: export interface <Name>Props.

    Extent: 15 propTypes blocks in 12 files, all under src/app: Console, AstralTreeCard, TreeCard, AlignmentCard (3), Raxml, CitationModal, Output, PartitionFileCard, PartitionEditor (2), Model, Input, components/ErrorDialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

wayfinder:grilling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions