Serious question : Why are SPA frameworks so popular these days? When someone asks "What should I use for web development?", It's now all about React/Angular/Ember/etc. But when I look at how are built the sites I like and visit frequently, I'd say 95% of them are not SPA, they are classic sites where the server generate each page (sometimes with one or two Ajax requests)! The Single Page pattern is great for desktop…
SPA frameworks are not all-encompassing tools for buildong all web pages. Notably, trying to SEO a SPA is frustrating at best and impossible at worst. However, in b2b use cases where SEO isn't an issue, SPA frameworks are ideal for coordinating a static-site dynamic-api system.
Angular 2 Final Released
361–370 of 452 posts
Re: Angular 2 Final Released
#362I've been using Angular 2 in a major enterprise project since RC1. Even with some of the headaches between RC releases; all of the reasoning behind those changes is technically sound.
It's easy to write components and wire everything, and even small things like async validators are fluid and easy to implement.
I'm loving it, and while the entire build system is still a bit of a dumpster fire; we're doing great on things like testing, code coverage; etc.
There are a lot of problems with lazy developers hoping a blog will tell them how to do every little thing. The source code is on Github. If you can't get something working right; maybe go read the source code of the classes you are interacting with. I've found 99% of the time now that simply reading through the code gives me not only the transparency needed, but a clear path to a better solution. Kudos to them on the new forms; they're awesome.
Re: Angular 2 Final Released
#363Earlier quoted context omitted.
Apologises if I'm miss reading this > Angular and Ember allows state and logic inside HTML. State updates do not occur in Ember templates. Templates specify the follow data from one component to another, as well as callbacks which are names of actions defined in a javascript portion of a component, or a parent component. But it does not allow you to specify how state is updated within the template. In terms of Logic,…
That is exactly what I meant, sorry for not being clear. State mutation definitely happen only in code everywhere, and not in templates (if we exclude two-way binding). But by logic I meant all sorts of control structures, which though looks light-weight at first, needs a large number of language elements to function. To name a few: variables, expressions (which in turn need operator precedence rules), scoping, and e…
All good, I'm probably tired (Australian time).
Maybe it's my inherit bias as an Ember user, but I'd argue Ember's templating language is alot simpler than you're suggesting
> But by logic I meant all sorts of control structures, which though looks light-weight at first, needs a large number of language elements to function. To name a few: variables, expressions (which in turn need operator precedence rules), scoping, and even composition if we count partials/templates with it.
Admittedly partials are a little weird, while I don't see them very often, it's still a fair point, however Ember templates don't deal with operator precedence as it doesn't have binary operators (entirely polish notation).
> Loops on the other hand requires not just simple array iteration syntax
Iteration doesn't have a blessed syntax, but instead utilises syntax that can be utilised by other components, and a better way to think of it is, the block inside the component is actually a function being passed to the component, which the component calls with every item of the collection.
> but also over hashes, and it also needs other constructs like filtering (`todo in todos | filter:search`)
It doesn't have pipes/filters, as that's easily expressed as a computed property in the js portion of a component. And I personally think scoping is pretty predictable imo.
Maybe you're just making a general remark about templates in general & i've read too far into it, then fair enough but in the case of Ember some of those don't apply, imo.
> behind the apparent simplicity there is always an entire language
Technically this is true, but I'm not sure why this matters, especially if it's trivial to learn? Because flip side of the argument, technically JSX is a different language to JS & HTML with even more complex semantics than a templating language because it carries the semantics of JS on top of it. You could make the same argument in favour of css over SASS/LESS, so I don't really see this as a big deal
Re: Angular 2 Final Released
#364Serious question : Why are SPA frameworks so popular these days? When someone asks "What should I use for web development?", It's now all about React/Angular/Ember/etc. But when I look at how are built the sites I like and visit frequently, I'd say 95% of them are not SPA, they are classic sites where the server generate each page (sometimes with one or two Ajax requests)! The Single Page pattern is great for desktop…
Because today there are websites and there are are web apps. Sometimes there's a combination of both - for example a blog - it's front end (user facing) part could be rendered by the server page by page and it's backend (admin access) is a single page web app. Each is used where appropriate - website - mostly static content, SEO and web app - a lot of user interaction.
Re: Angular 2 Final Released
#365Earlier quoted context omitted.
>The HTML template in Angular 2 is stored in a string. This has several disadvantages This is patently false. Just use "templateUrl" instead of "template". This allows you to specify a file instead. This is the way I always did it in angular 1 as well. I don't really understand why style guides & general practice recommend embedding html in the javascript though. It's horrible.
If you're using TypeScript + templateUrl, you won't get static checking of templates. With React + TypeScript, you will.
Re: Angular 2 Final Released
#366Earlier quoted context omitted.
Obtuse error logging is my biggest problem. A lot of the times you have no idea what's going wrong.
That's a general javascript problem though as soon as you involve any third party library. Something funky going wrong when jQuery's involved? Good luck stepping through that.
Re: Angular 2 Final Released
#367Serious question : Why are SPA frameworks so popular these days? When someone asks "What should I use for web development?", It's now all about React/Angular/Ember/etc. But when I look at how are built the sites I like and visit frequently, I'd say 95% of them are not SPA, they are classic sites where the server generate each page (sometimes with one or two Ajax requests)! The Single Page pattern is great for desktop…
What's with the "serious question", "genuine question", etc? Mostly I see this mannerism prefacing questions that could not reasonably be taken as a joke or provocation. Serious question: are people so touchy these days that you have to assure them that you are not being hostile before even saying something?
Re: Angular 2 Final Released
#368Re: Angular 2 Final Released
#369Earlier quoted context omitted.
That is exactly what I meant, sorry for not being clear. State mutation definitely happen only in code everywhere, and not in templates (if we exclude two-way binding). But by logic I meant all sorts of control structures, which though looks light-weight at first, needs a large number of language elements to function. To name a few: variables, expressions (which in turn need operator precedence rules), scoping, and e…
> That is exactly what I meant, sorry for not being clear. All good, I'm probably tired (Australian time). Maybe it's my inherit bias as an Ember user, but I'd argue Ember's templating language is alot simpler than you're suggesting > But by logic I meant all sorts of control structures, which though looks light-weight at first, needs a large number of language elements to function. To name a few: variables, expressi…
SASS and LESS both add language semantics over CSS and suffer from the same problem. So does for example Jekyll's templating language. But in case of CSS, the language additions are a practical necessity - it lacks even basic abstractions, which the pre-processors provide.
So there - trade-offs.
I've written in more detail about this topic at http://www.jasimabasheer.com/posts/evolution-of-view-templat..., if you are interested.
Re: Angular 2 Final Released
#370Is there a definitive angular versus react versus ember (or others) pros/cons/community status page out there somewhere?