- Issue created by @effulgentsia
- Status changed to Closed: works as designed
9 months ago 6:00pm 30 November 2023 - πΊπΈUnited States effulgentsia
After opening this issue I learned about https://www.npmjs.com/package/prop-types, which is a better fit than TypeScript for this use case. This is now demonstrated in https://github.com/drupal-jsx/starter-react/blob/main/src/components/Dru....
- Status changed to Active
5 months ago 5:55pm 2 April 2024 - πΊπΈUnited States effulgentsia
Upon further reflection, I think we should switch from prop-types to TypeScript. One reason is that TypeScript has become so widely adopted in the JS ecosystem. Another reason is I think it'll be easier to have a single set of TypeScript definitions that can then work for React, Vue, or other frameworks.
When I first opened this issue, I didn't know how we could generate .template-info.json files from TypeScript definitions. Since then I learned about https://github.com/vega/ts-json-schema-generator, which generates JSON schema from TypeScript. Which makes me realize we should change JSX theme engine to read JSON schema (which is a standard) instead of .template-info.json (which is just something I made up because for some reason JSON schema didn't occur to me at the time).
I'll add some more detailed comments here later about how to go about implementing the above.
- First commit to issue fork.
- Merge request !32Draft: Resolve #3396747 "Add typescript declarations" β (Open) created by hooroomoo