debugworkbench / hydragon

Extensible multi-platform debugger frontend
MIT License
1 stars 0 forks source link

Consider replacing DefinitelyTyped typings #5

Closed enlight closed 8 years ago

enlight commented 8 years ago

Seems like https://github.com/typings/typings claims to work with proper external module based typings instead of just ambient external module typings. I'm not entirely sure how it manages to work with TypeScript's node-like module resolution, but that should be easy enough to test with the typings at https://github.com/typings/typed-source-map

If it works as claimed it would be nice to convert the Electron typings over to the proper external module d.ts format.

enlight commented 8 years ago

Upon further investigation the way Typings works right now is that type definitions are authored as external modules, but when a user installs them via Typings they are converted to ambient modules and combined into a single d.ts. So, it doesn't actually let you use TypeScript's node-like module resolution right now, though according to the author this may change. I'm not sure there's a significant benefit right now in converting the existing typings from ambient modules to proper external modules.

However, what is promising about Typings is that some thought has been put into versioning, on that front at least Typings provides clear advantages (or will when/if typings authors migrate away from DefinitelyTyped).

I have some concerns about the hard-coded installation directory for typings installed via Typings, the justification for that is that the way typings are installed (as ambient modules) may change, and if they are installed as proper external modules then they would have to go inside the individual module directories in node_modules. I'm inclined to wait and see what the author settles on, though I might try converting the existing Electron typings to proper external module format and publishing them to the Typings registry as an experiment.

enlight commented 8 years ago

I've used Typings to pull in React type definitions, seems to work OK though it does create a bunch of unnecessary .d.ts that had to be added to .gitignore. Since all necessary type definitions are committed to the repository there isn't any rush to migrate from DT to Typings, I'll probably do it bit by bit whenever I need to update the existing typings or add new ones.

enlight commented 8 years ago

Typings are history, long live DT, closing in favor of #37.