blocks/blocks

TypeScript Support?

Opened this issue · 1 comments

In the product vision, it says that Blocks is "a universally applicable library for visually editing JSX". For a library like this, we probably want to have some TypeScript support. That could be just publishing typings to DefinitelyTyped, including them in the library, or writing Blocks entirely in TypeScript.

A separate consideration from using Blocks from a TypeScript project is supporting the parsing and transformation of React written in TypeScript. Babel can parse TypeScript no problem so I don't think it should be an issue.

I know this is early, but just wondering if there are any plans for either of these?

johno commented

Thanks for opening up this issue, there are plans for both but they haven't been formalized. So, we can do so here!

In the near future we should add TypeScript support to the Blocks editor, I'd imagine it should be an option to pass to the editor which then adds TypeScript parsing and transformations to the Babel processing.

Regarding types, we should probably add types and publish them as part of the package (we should have first class TypeScript support as part of our roadmap).