4 ms·
This is part of what v5 is fixing by enabling AOT by default in development (and production). AOT compilation converts an Angular template to TypeScript that i
by rickcnagy 9y ago
This is part of what v5 is fixing by enabling AOT by default in development (and production).
AOT compilation converts an Angular template to TypeScript that is then type-checked. So on v4+, an `ng build --aot` performs type-checking.
But since that's not great developer ergonomics, v5 has included enough performance improvements on AOT that it's reasonable to enable in development (see "TypeScript Transforms"). And then that means that development includes the type-checking compilation step!
- interlocutor 9y agoThat'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 https://github.com/wisercoder/uibuilder )
- btown 9y agoNot 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 https://github.com/angular/angular/issues/7482 and the demo gif here: https://github.com/microsoft/typescript/issues/6508 https://github.com/microsoft/typescript/issues/6508 display all those features.
- tashoecraft 9y ago...webstorm provides all that, I'd also bet some plugins for vscode and atom do as well.
- d2kx 9y agoThat'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.ng-template https://marketplace.visualstudio.com/items?itemName=Angular....
- hccampos 9y agoAs 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.
- afromobile 9y agocan i get an amen?! https://github.com/angular/angular/issues/17976 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.