Ts-migrate: tool to automatically migrate JavaScript projects to TS
11–20 of 28 posts
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#12I've wondered if you could run JS code, keep track of runtime types, and generate interfaces off of that. Of course the program wouldn't know what to name the interface, but it's still better than nothing.
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#13I've wondered if you could run JS code, keep track of runtime types, and generate interfaces off of that. Of course the program wouldn't know what to name the interface, but it's still better than nothing.
There's a similar project I'm aware of that uses runtime behavior to help create type annotations but for python: https://github.com/instagram/MonkeyType
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#14I thought the tool to automatically migrate JS to TS was tsc --init and then set the flag to include js files.
That’s just running js files within ts files. Nothing to really do with migrating, unless you’re writing everything by hand and want everything to work while you’re at it.
You can leave parts in JS while you upgrade/add new features in TS
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#15It would be nice if we somehow had one to convert typescript back into _idiomatic_ JavaScript.
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#16If I understand correctly, they convert the js file to .ts file, ask tsc for error diagnostics and automatically apply transformations to resolve those errors when they can. Yep that’s how I’d do it too. I wrote a simpler version when doing a tsc upgrade to resolve a whole bunch of errors. It parses the tsc errors and does simple string replaces. Has anyone played with the tool to report how good it is? I remember v8…
I hadn't heard of that, but there is the typewiz project - https://github.com/urish/typewiz
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#17Clearly this tool is undeniable proof that static typing exists merely to satisfy human ego and neuroticism and has nothing to do with logical integrity... Since this tool itself supposedly proves that this integrity can be derived automatically from dynamically typed code. This tool is a paradox, a blatant logical contradiction.
If this tool does work as advertised, then it proves the uselessness of static typing and thus, by extension, this tools proves its own uselessness.
EDIT I removed a potentially offensive remark from my comment. This makes zero sense to me is my point.
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#18To save any fellow non-webdevs ten seconds, TS == TypeScript
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#19This tool is ridiculous and less than useless. Can't anyone else see how ridiculous of an idea it is to add types automatically? Isn't the whole point of static typing to allow the human developer to specify what the types should be? If a machine could resolve the type integrity issue automatically from dynamically typed code (which is what this tool claims to do), why do we need this tool to physically insert type a…
Re: Ts-migrate: tool to automatically migrate JavaScript projects to TS
#20This tool is ridiculous and less than useless. Can't anyone else see how ridiculous of an idea it is to add types automatically? Isn't the whole point of static typing to allow the human developer to specify what the types should be? If a machine could resolve the type integrity issue automatically from dynamically typed code (which is what this tool claims to do), why do we need this tool to physically insert type a…
This project is meant to make developers more efficient and support them in migrating projects to TypeScript. The entire point of TypeScript is to make developers more efficient, too, through clear structuring, types and assistance through its toolchain.
Static typing does not protect you from integrity issues. However, it allows you to extend existing code with confidence.
I'm not sure if you work in a team, but your general attitude isn't exactly conducive to a constructive, open and efficient working environment.