Dora-SSR icon indicating copy to clipboard operation
Dora-SSR copied to clipboard

Tracking: support typescript as the scripting language

Open neverchanje opened this issue 1 year ago • 1 comments

The background shared by @pigpigyyy:

Teal was introduced a long while ago in this project when Typescript was not yet mature. However, when it comes to a statically typed scripting language, Typescript has grown to be the most popular option today. We can explore the possiblity of transpiling TS to Lua https://github.com/TypeScriptToLua/TypeScriptToLua and provide the type definitions for Dorothy like https://github.com/hazzard993/love-typescript-definitions

Eventually, we may also need to provide a template project for scaffolding. https://github.com/hazzard993/love-typescript-template

neverchanje avatar Dec 20 '23 04:12 neverchanje

Thank you for your suggestions. I've successfully integrated the TypeScriptToLua compiler with our Dora SSR project, and have added several tests to the repository to ensure its functionality. We now support TypeScript by allowing the Web IDE to compile TS and TSX code into Lua whenever the editor's save action is triggered. We plan to introduce support for npm-based toolchains in the future, which will allow developers to work with their preferred external IDEs rather than being confined to the Dora SSR Web IDE.

pigpigyyy avatar Apr 28 '24 07:04 pigpigyyy