Hacker News new | ask | show | jobs
by interlocutor 3154 days ago
That's an improvement, but what about syntax coloring, intellisense suggestions and instant squiggly-lines when you make a typo? These are all important for productivity. You get all this when you use .tsx templates (which by the way, are not limited to React, see https://github.com/wisercoder/uibuilder )
4 comments

That's what you get with the @angular/language-service. Enabled by defaut in WebStorm, and an official extension for VSCode: https://marketplace.visualstudio.com/items?itemName=Angular....
As others have mentioned, this is all possible with Angular >=4, both in WebStorm and VSCode. The main issue is with performance and debugging. Using Angular's AoT compilation is still extremely slow and your squiggly lines take several seconds to show up after you modify a template in your editor. And no stepping through templates either when trying to debug why something isn't rendering properly.

But, imho, the biggest problem with Angular, by far, are it's NgModules. You can't just import a component normally and use it in your template. You need to also add it to an NgModule to make it available in the templates of the components inside that NgModule. And if for some reason you stop using a component, you need to remember to clean up the module as well since nothing will warn you about unused declarations or imports in NgModules.

And then there is also the fact that you can't directly import a function/constant and use it directly in the template because, like Components, the template engine needs to be told about it. So you need to add properties to your component class which are just providing access to things you imported above. So. Much. Pain.

Some people really like templating languages but imho just using TSX (which is just mapping to function calls) and normal ES modules is the best solution by far.

can i get an amen?!

https://github.com/angular/angular/issues/17976.

ngmodule makes no sense. why can't the components, providers etc get automatically discovered. ngmodules should not be necessary.

Not an Angular user so I don't know how well (or if) this is currently fully working, or is still in development, but: https://github.com/angular/angular/issues/7482 and the demo gif here: https://github.com/microsoft/typescript/issues/6508 display all those features.
...webstorm provides all that, I'd also bet some plugins for vscode and atom do as well.