Typescript All The Things! - #261
Conversation
|
Hi there, thanks for this contribution. I would accept a patch with the files renamed first and some typings, but let's not change how we are using the theme and the plugin configurations.
Blocks are a react component and a configuration object (both exported in a block file). The config of the plugin will tell Dante how the plugin should behave and be rendered; there are some callbacks to tiptap functions/events. |
|
That makes sense. I was diving straight in to get my bearings. I'd be happy to break them up as you've suggested. I'll submit one for the theme system as well because I'm pretty sure the changes are minimal. |
|
Hi Daniel, yeah, let's atomize the PR, sounds great thank you very much |
|
Great job |
I'm working on moving the entirety of Dante 3 to typescript so that its types will play nice in a hobby project. The changes so far have been mostly trivial. The things I still need to wrap my head around are theming and blocks.
I think a lot of the theming could be redone to use useDanteTheme rather than using the ThemeProvider and all that. Typescript seems to like this better and it's an approach referenced in the Emotion docs.
Blocks, I haven't fully done the dive on. Any insight as to how those work would be helpful. Typescript seems to infer their types as a bunch of different things from TipTap, none of which have fully compatible types, but all of which have nearly compatible types. I may be able to look at this more later this weekend.