Skip to content

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Sep 2, 2025

Currently Microbundle is generating types for us from the JSDoc types which, IMO, probably isn't ideal. Builds are slightly slower, they're a bit harder to read, and Microbundle keeps the original JSDoc type comments in the generated .d.ts which are entirely redundant and makes it quite hard for consumers to read if they ever need to.

Our types are so simple that a manual .d.ts I think is a pretty objective improvement.


Also adds a jsconfig.json -- I don't know about other folks but my editor won't type check without it or a tsconfig.json w/ allowJS and checkJS set. There's a few type errors that are mostly expected, but also caught one that could be easily addressed while writing this (_props was missing, but consumed, from PreactCustomElement)

@rschristian rschristian marked this pull request as draft September 2, 2025 23:48
@rschristian rschristian force-pushed the refactor/switch-to-d-ts branch from 023b787 to 1842fb5 Compare September 3, 2025 15:34
@rschristian rschristian marked this pull request as ready for review September 3, 2025 15:39
Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, going with jsconfig.json is the right approach 👍

@rschristian rschristian force-pushed the refactor/switch-to-d-ts branch from 1842fb5 to 365bfa1 Compare September 3, 2025 19:39
@rschristian rschristian force-pushed the refactor/switch-to-d-ts branch 2 times, most recently from ad2abe3 to 63cfbae Compare September 3, 2025 19:47
@rschristian rschristian merged commit 986f340 into master Sep 3, 2025
1 check passed
@rschristian rschristian deleted the refactor/switch-to-d-ts branch September 3, 2025 19:47
This was referenced Sep 4, 2025
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.

2 participants