Skip to content

TypeScript app shell #252

Closed
Closed

Description

@jtklein-agents

Parent

Part of #236.

PR base

Open the pull request against spec/236-page-typescript (cut from master), not master. When that branch is missing, create it from origin/master and push it first.

What to build

The app shell of the Page is TypeScript: the error dialog, the app and the page entry. This is the last conversion leaf; when it lands, no production file of the Page is JavaScript and the typecheck baseline is empty.

Acceptance criteria

  • The error dialog, the app and the page entry are TypeScript (.tsx where they hold JSX)
  • Each panel exports a <Name>Props interface; its propTypes block and prop-types import are deleted
  • A prop that was isRequired is a required member and every other prop is optional: no contract loosens or tightens
  • Store-object props (run, alignment, tree, citation, store) are typed by a small module-local interface holding only what the panel reads; no type import of a store class
  • The two error-dialog call sites that omit optional props are cleared by the error dialog's typed props alone, with no call-site change
  • The clear-console icon keeps its title prop (Clear console icon passes title, which the MUI icon does not accept #234) behind a @ts-expect-error with a one-line reason; the pull request links Clear console icon passes title, which the MUI icon does not accept #234
  • The app's three baseline lines are deleted and the typecheck baseline file is empty
  • The direct prop-types dependency line leaves the manifest, since nothing imports it any more; its lock stanza stays because other packages depend on it
  • The page-Node-imports test, which reads the page entry by fixed path, reads the renamed file; the build config's page entry and the page render test still resolve
  • Each file is whole-file renamed to .ts (.tsx when it holds JSX), keeps its shape and gains explicit types: no behaviour change, no refactor, no file split, MobX annotation maps untouched
  • These files have zero diagnostics under plain tsc and under --noImplicitAny, and hold no written any
  • yarn typecheck:baseline passes; every baseline line this leaf clears is deleted, and a still-JavaScript caller line whose fingerprint this leaf changes is rewritten in the same change
  • Every test, script and config entry that opens a renamed file by fixed path uses the new extension; import specifiers stay extensionless
  • A Renderer bridge call in these files reads window.rendererBridge with no cast, still inside each method (not once at module load), and the RendererBridge members these files call are tightened; a crossing payload type lives in main and is imported type-only
  • A bug typing exposes (a diagnostic that cannot clear without a runtime change) keeps its behaviour, gets the narrowest accommodation (a widened type, else a @ts-expect-error with a one-line reason), is filed as its own issue outside Spec: page TypeScript #236 and is linked from the pull request
  • yarn lint and yarn react-test pass, the tests changing only where a fixed path moved; yarn build still emits the main, preload and page output
  • tsconfig.json is unchanged: strict and noImplicitAny stay off, allowJs stays on

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions