Add TypeScript declarations to the JSX component props

Created on 25 October 2023, 11 months ago
Updated 23 April 2024, 5 months ago

Problem/Motivation

A lot of JS devs use and like TypeScript. It would be good for us to know if any problems surface if Umami JSX components declare the types of their props.

Additionally, once types are declared in the components, we could potentially use that info to automatically generate the *.template-info.json files, but I'll open a separate issue for that.

Steps to reproduce

Proposed resolution

  • Add TypeScript as a dev dependency.
  • Add type declarations for all of the JSX component props.
  • This will probably require that we rename the files from .jsx extension to .tsx.
  • For props that are objects, we'll need to figure out the most DX-friendly way to specify the types of that object's properties. I think TypeScript supports multiple ways for declaring this so we'll need to decide on which way we want to use.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Umami JSX Demonstration Theme

Created by

πŸ‡ΊπŸ‡ΈUnited States effulgentsia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024