News for hackers. Stuff that matters.
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by pixie_ on Friday June 17, 2016 @02:27AM (#11921005)
It is pretty much impossible to have any sort of inferred structure from plain javascript. The reason you can use super powerful tools to refactor, rename, and find all references across files in typescript is because the IDE can build a 100% accurate data model of your code base when it's written in typescript.
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by chc on Friday June 17, 2016 @03:42AM (#11921176)
You can do that kind of stuff in dynamic languages like JavaScript, Python and Ruby. Check out JetBrains' editors.
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by DCoder on Friday June 17, 2016 @05:04AM (#11921457)
To do things like that in a dynamic language, you need to either infer types somehow, or rely on metadata like JSDoc, beyond the language itself, and that sucks – if another developer works on the project with a dumber IDE, their code will probably lack such metadata or it will not be entirely correct.

I have been using IntelliJ daily for the last five years for PHP, JS and TS development. For PHP, I write typehints and PHPDoc wherever possible to help the IDE make sense of things. For JS, I tried doing the same with jsdoc but it didn't work out, and I have decided to avoid any automated refactoring or even autocomplete, it's far too fragile. For TS, using the types in my code makes the IDE smart and reliable, although IntelliJ's support for type inference in TS is still far behind VSCode.

Special mention here goes to Magento developers, whose PHPDoc, 98% of the time, is either lacking or outright incorrect (referencing classes that don't exist – incredibly frustrating).

Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by domlebo70 on Friday June 17, 2016 @03:53AM (#11921198)
Yeah, but at the end of the day it's a guess. Nothing more. The IDE cannot prove that it's change all instances of the "thing" being passed into a function, for it's just using names and heuristics to correlate them and derive meaning, not an actual mapping.
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by pyrale on Friday June 17, 2016 @04:42AM (#11921346)
Jetbrains' editors for e.g. Python help me significantly less than their editors for e.g. java.

Not that it's a bad thing, but basically Pycharm is an editor with some nice-to-have Python env integration, linter, etc. IntelliJ has significantly better refactoring tools.

Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by lkitching on Friday June 17, 2016 @04:01AM (#11921214)
I use IntelliJ when writing Ruby, and the navigation and refactoring tools are much less reliable than those for Java. Finding symbol references can return a lot of false positives since it cannot use the type of the receiver, and a lot of the refactoring operations are not available.
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by caseymarquis on Saturday June 18, 2016 @11:12AM (#11928941)
I agree with everyone else, I don't find Webstorm's js refactoring to be anywhere near Jetbrain's static offerings. And the js auto-completion is about the same as Atom's autocomplete-plus applied to generic text (which is really great, but nothing like static type tooling).
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by lloyd-christmas on Friday June 17, 2016 @10:02AM (#11922659)
I use Webstorm. When we switched to Typescript, it made navigating and error checking dramatically faster.