News for hackers. Stuff that matters.
Re:Angular 11 by llimos on Thursday November 12, 2020 @06:53AM (#25068834)
I feel like Angular is now where jQuery was a few years ago - used to be huge but no-one is starting new projects in it unless they have to, and they keep releasing new versions for the large existing base. The actual updates here are a bit meh tbh.
Re:Angular 11 by stupidcar on Thursday November 12, 2020 @07:29AM (#25069097)
It's anecdotal, but that SVG path editor that recently made it to the top of HN was a brand new Angular project: https://github.com/Yqnn/svg-path-editor

And on npm it's gaining popularity: https://www.npmjs.com/package/@angular/core

React is still the clear winner in terms of market share, but Vue.js and Angular are very popular and not going anywhere. Fortunately, there's room in the world for more than one front-end framework.

Having used Angular professionally for several years, and React for the past two, I think both have clear strengths and weaknesses, but informed debate is sadly lacking, and instead we have a lot of partisanship and uninformed opinions.

Re:Angular 11 by Cthulhu_ on Thursday November 12, 2020 @07:45AM (#25069210)
I've used both Angular (mainly 1.x) and React, and they both have their place. I like React for its minimalism, but Angular for its modularity and formality. The latter fits well in a Java / OOP organization.
Re:Angular 11 by kotojo on Thursday November 12, 2020 @12:33PM (#25072234)
I'm not sure if the popularity increase is angular getting more popular, or front end development getting more popular.

Vue has a similar track over the last year https://www.npmjs.com/package/vue

React is gaining even more quickly https://www.npmjs.com/package/react

Re:Angular 11 by pritambarhate on Thursday November 12, 2020 @07:11AM (#25068964)
Angular 2+ is a very good framework which has typescript support from ground up. We have dozens of project in it. It's very suitable for enterprise applications with hundreds of screens. Types make it a lot more maintabale. It has been quite easy to keep the applications updated to the latest version of Angular. Mostly it just takes 1-2 days of developer time to bring the application to the latest version of Angular.
Re:Angular 11 by remlov on Thursday November 12, 2020 @07:24AM (#25069048)
Agreed. I've worked in several, what would be considered, "large" projects in "current year popular framework". Angular always felt like it was more "batteries included" and maintainable with larger teams and is still my go to for new projects if given the option. Obviously YMMV on framework preferences if you're into the whole functional ts style vs classes.
Re:Angular 11 by miohtama on Thursday November 12, 2020 @09:06AM (#25069932)
This is true. React/Vue ecosystems are more fragmented with tooling. Angular has one definitive tool chain. It makes it easier for Angular developers to jump between projects. But it also makes it faster, as Angular can optimise for speed with ahead-of-time compilation and stricter templates (also see some comments regarding this on this page).
Re:Angular 11 by phaedryx on Thursday November 12, 2020 @02:25PM (#25073793)
I don't do much Javascript, but I need choose a front-end for a project I'm working on. It looks like Vue has an official router, an official store (Vuex), official testing tools, and an official browser plugin. I assume that everyone just uses the Vue version of things. Where is the fragmentation?
Re:Angular 11 by polyterative on Thursday November 12, 2020 @07:33AM (#25069122)
Same experience in our company. Very manageable.
Re:Angular 11 by Abildtoft on Thursday November 12, 2020 @07:28AM (#25069079)
I think it is an unfortunate consequence of a new (relatively) poorly managed transition from AngularJS to Angular 2+, the latter of which should probably in hindsight have been named something other than Angular.

The fixed release schedule means that, at times, the "what's new" section is a bit meagre in the major releases, but e.g., the recent release of Ivy highlights that this is more of an artificial issue than a real one.

I'm personally very happy working with Angular and have chosen to use it even when provided the option of moving to React or Vue. Each of the major frameworks have their strengths and weaknesses, but I feel that we've reached the point now where their maturity is such that you cannot really make a fatal mistake in selecting either of them. Your use case and your team makeup is much more decisive.

Re:Angular 11 by Cthulhu_ on Thursday November 12, 2020 @07:49AM (#25069247)
Just the Angular 2 announcement lost them so much trust, and a lot of companies just switched to a different framework entirely because it effectively told them that the efforts they put into Angular 1 were wasted.

I get why they felt like they had to do it (the Angular 1 codebase originating in 2009), but they should have gone for a much more smooth and gradual upgrade path.

Re:Angular 11 by k__ on Thursday November 12, 2020 @07:04AM (#25068907)
While I personally prefer React 90% of the time, I would say with its deep RxJS integration Angular has its merits. Sure, it's miles away from Cycle.js, but Angular has a much bigger eco-system.

If I would create a (realtime) data intensive app, I would probably use Angular for it.

Re:Angular 11 by deckard1 on Thursday November 12, 2020 @01:55PM (#25073394)
Maybe every example I've seen of RxJS is doing it wrong, but I've not seen a usage of RxJS that wasn't:

a) Over-engineered and an entirely unnecessary level of abstraction and flow control for a web app

and

b) A total spaghetti mess of event handling code all over the place and no way to tell what the flow of events is and always having to hunt down difficult to debug issues as a result.

RxJS may be neat, but it's definitely architecture astronaut territory.

Re:Angular 11 by IggleSniggle on Thursday November 12, 2020 @04:56PM (#25075644)
I'm sold on the "reactive stream" pattern, and I evangelized RxJS until I discovered cleaner libraries that accomplish much the same thing. Flyd[0] is my current library preference for JS. RxJS just has so many more abstractions than you need to do the job, and it doesn't make it very easy to incorporate whatever your own functional paradigm might be even though you would expect it to excel at this...It forces RxJS conformity, instead of being "just a function" that can itself be easily composed.

(I also think async generator functions are a great tool for reactivity that are underused)

Anyway, there's a huge amount of extra language that you need to develop around RxJS...at first I didn't mind because I thought I was getting multi-language benefits: "Oh! Reactive Extensions are available in a variety of different languages! Sweet!" But the specific patterns and terms learned in one implementation tend to be vastly different than in others. Sure, you're still working with the same patterns at a high level, but don't expect any of the same methods to be present or even the same basic syntax, even if the languages are similar.

[0] - https://github.com/paldepind/flyd

Re:Angular 11 by azangru on Thursday November 12, 2020 @07:20AM (#25069023)
> Sure, it's miles away from Cycle.js

Has cycle got any real-world adoption, apart from Andre writing the Manyverse client in it?

Re:Angular 11 by k__ on Thursday November 12, 2020 @07:28AM (#25069083)
At least 24 companies are sponsoring the development, don't know how high the dark figures are.

But as I wrote in the comment before, while Cycle.js is in my eye the cleaner UI framework implementation with observables (compared to Angular) it has a very small eco-system.

Re:Angular 11 by dmitriid on Thursday November 12, 2020 @07:44AM (#25069208)
> At least 24 companies are sponsoring the development

Is there development though? It looks like since 2018 there have been only minor updates, and major projects like [1] are still just a dream.

On the other hand, "sponsoring the development" could be a strong word. Giving a few bucks every once in a while isn't really sponsorship [2]

[1] https://github.com/cyclejs/cyclejs/issues/851

[2] https://staltz.com/software-below-the-poverty-line.html

Re:Angular 11 by ethbr0 on Thursday November 12, 2020 @07:49AM (#25069246)
> very small eco-system

With comprehensive frameworks, I always think of this as the Smalltalk problem.

In real world use, aggregate framework dev-hours typically trump superior architecture. Sadly.

Re:Angular 11 by WorldMaker on Thursday November 12, 2020 @07:29PM (#25077257)
I used Cycle for a couple years, but the size of the React ecosystem made it much easier to just use React. There were prototypes of embedding React components in Cycle Apps, but more traction was made in embedding Cycle components in React apps, but by this point it rarely seems worth the effort to mix the component types together. (And with hooks eliminating whole sorts of reactivity issues with class components, I don't really miss Cycle much in React work. Though I miss Cycle a great deal when working in Angular, yikes.)
Re:Angular 11 by josteink on Thursday November 12, 2020 @07:44AM (#25069204)
> I would say with its deep RxJS integration Angular has its merits

That’s funny, because for the exact same reason I’ve taken a strong dislike on it.

The rest of NodeJS flows on promises and constantly have to switch between that, and having to use different APIs, and no longer be able to write simple awaitable async code...

It drove me mad. Angular without RxJS would be so much better.

Re:Angular 11 by tashoecraft on Thursday November 12, 2020 @12:01PM (#25071833)
Strongly disagree. Rxjs is such a better async pattern than anything else in the javascript ecosystem. The front end shouldn't care what node is doing, especially since not everyone's front end uses node. What I don't like about async await is it changes the pattern you are seeing, intermingling synchronous and asynchronous code based on the correct placement of a keyword, then using try catch blocks to catch errors are just so ugly. Passing my data through a stream of pure functions that transform the data into what I need just feels pleasant to work with, but I do agree it takes awhile to be proficient in it.
Re:Angular 11 by hckrnwsthrwwy on Thursday November 12, 2020 @04:05PM (#25075032)
Use NestJS, you can have RxJS and Angular in your backend
Re:Angular 11 by k__ on Thursday November 12, 2020 @08:05AM (#25069395)
Doesn't Node.js mainly flow on callbacks?

As far as my experience goes, promises require some extra work too.

Re:Angular 11 by fuzzy2 on Thursday November 12, 2020 @07:26AM (#25069056)
From what I hear, Angular is still relatively popular in enterprise environments. Dunno why though. With my employer specifically it's basically "we've always used Angular". That's not entirely dumb of course, because of the built-up knowledge.

Developers in these environments usually do not take part in these surveys.

Re:Angular 11 by mgechev on Thursday November 12, 2020 @07:50AM (#25069252)
> Developers in these environments usually do not take part in these surveys.

Angular team member here. These are our observations as well. Based on metrics we collect (opt in telemetry, website traffic, language service downloads, etc), there are over 1.7m developers using Angular.

I'd say that many of them are in the enterprise, but there are also a lot of startups that bet on Angular. This is mostly due to the integrated stack where folks need to make fewer decisions and get smooth updates across versions.

Stability is another factor. We validate every commit pushed to the Angular repo with 2600+ projects inside of Google. If any of their tests break we rollout automated migrations or rethink the implementation.

Re:Angular 11 by tashoecraft on Thursday November 12, 2020 @12:06PM (#25071883)
Angular presents patterns for handling complex web applications as well as having a set update and release schedule. It doesn't take the typical javascript ecosystem approach of offloading the majority of package development to the open source community. All the major angular packages are updated every 6 months with breaking changes, insuring these packages all work together. No need to look out for a router, animations library, forms library, etc. A team member can switch teams and expect to work with the same tools.

All the mainstream frameworks are great tools. I'd say if you're looking at React, Vue or Angular and think "Dunno why anyone would use that, must just be the "we've always used x here"" than I'd say rethink your approach to "it's probably a good tool for their use case".

Re:Angular 11 by fuzzy2 on Thursday November 12, 2020 @02:11PM (#25073619)
It’s not “them”, though. It’s me! :D

I have never witnessed an evaluation or discussion of tools for a project. Ever. Neither open-ended nor otherwise. I’ve worked on diverse projects for various clients (since Angular 2 arrived) and Angular was either an explicit requirement by the client or a team decision. There were no arguments, ever.

The people I worked with were never particularly knowledgeable. In fact, for non-trivial use cases, I feel that Angular is actually hostile to young professionals. RxJS in particular is a topic I’ve seen people struggle with a lot.

Can you achieve success with Angular? Absolutely. I don’t feel it’s any easier than with React or even AngularJS though. (No experience with Vue.)

Re:Angular 11 by UlisesAC4 on Friday November 13, 2020 @02:09AM (#25079794)
> I feel that Angular is actually hostile to young professionals

I am not sure about that, it is more that the full stack of technologies for current SPA is daunting for new developers.

When learning react one just go to one part at a time, first rendering, then props, now learn to use the router library. When using angular one can feel overwhelmed because all the panel of tools is presented in one repo.

Re:Angular 11 by Cthulhu_ on Thursday November 12, 2020 @07:47AM (#25069226)
> Dunno why though

Anecdotal: when Angular (1.0) first came out, it felt professional and mature; you could clearly define your components and write a complete unit test on top of that. It fits well in an enterprise environment where developers are taught to do the same with (usually) Java classes.

I've consulted for a company once where they wanted to rewrite their UI in web technology; we did a POC for React, Angular, Vue and Ember. In the end, they went with Angular because they felt the most comfortable with it.

Re:Angular 11 by fuzzy2 on Thursday November 12, 2020 @08:41AM (#25069712)
(I think you mean Angular 2, Angular 1 never existed. AngularJS is something different entirely.)

You could be right, I can see how arguing with component instances etc. can be easier when you come from object-oriented GUI platforms.

Re:Angular 11 by pjmlp on Thursday November 12, 2020 @07:40AM (#25069178)
In the Java and .NET world, Angular is just the go to SPA framework, eventually Vue.

React only gets used when FE devs overweight the full stack ones. At least on the projects I have been involved with.

Re:Angular 11 by WorldMaker on Thursday November 12, 2020 @07:34PM (#25077314)
Funny, anecdotally as a full stack I much prefer React and it is all the front end devs telling me they "know Angular" and prefer it. In my experience, I think that Angular's templates using a .html file extension confuses a lot of front end devs into thinking they know Angular. (And in that same experience, they don't, not really.)
Re:Angular 11 by modernlearner on Thursday November 12, 2020 @11:19AM (#25071401)
We started our project in Angular last year, and the updates are great. It feels like a proper framework a la Ruby on Rails or Django where as with React and Elm and other options it would have been more ad-hoc.
Re:Angular 11 by deeg on Thursday November 12, 2020 @12:01PM (#25071821)
I have a theory that the developers who like Angular have a background in dynamic web frameworks. We're used to having an opinionated structure. Throwing in code that goes against the opinion leads to pain but if you work with it you can create a lot of functionality quickly.
Re:Angular 11 by modernlearner on Thursday November 12, 2020 @01:57PM (#25073424)
My background is Rails, Django and AngularJS. I've worked with everything that came before Angular/React (MooTools, Ember, Backbone) and you're right, I like the idea of an opinionated framework that provides enough tools to get up and running and to maintain for the next few years (at least).

This is why I liked Elm as well because it bakes in a particular structure and adds static typing.

The other advantage is if you're hiring freelancing. From personal experience, anything that was custom and less opinionated cost more billable hours. Dealing with a framework like Laravel, Django, Rails cut costs in a noticeable way and the remaining work was actual hard problems to solve.

Re:Angular 11 by jstummbillig on Thursday November 12, 2020 @07:06AM (#25068925)
"Automatic Inlining of Fonts" seems like a pretty huge deal to me (considering, of course, that the framework is stable and huge stylistic changes like react hooks are in fact not what you want out of a stable framework but mostly a display of its immaturity – even if the feature itself is great). Do any of the competitors include something similar?
Re:Angular 11 by speedgoose on Thursday November 12, 2020 @12:06PM (#25071885)
I'm not sure what they mean about font inlining, I didn't read the code.

But if it's about having the font directly in the bundle encoded in base64 to save a http request, you can do that with webpack for example. But from what I understood, base64 encoded content is often slower to load than the same content served over http 2.

I don't know if others are automatically downloading the fonts to include them in the build. It's a nice feature but you can also install many Google fonts from Npm.

Re:Angular 11 by IggleSniggle on Thursday November 12, 2020 @05:01PM (#25075710)
If the font is already loaded, then inlining is hurting rather than helping. Browsers will cache fonts and external libraries between sites when they are identical, so your users might even already have the font loaded: by inlining, you've forced them to load it again, even if they already had it in their local cache.
Re:Angular 11 by WorldMaker on Thursday November 12, 2020 @07:41PM (#25077369)
Inlining styles is download of a couple files and then a couple lines of webpack config. Almost all the competitors either already support it when you include the download file in your assests or just tell you to make the changes to your webpack config (or eject and do it in the case of something like Create React App).

I guess the "innovation" here is that they also support the download step?

Either way, fonts are bulky binaries that don't gzip well but do cache well in browsers when combined with central CDNs so this seems an anti-feature for reasons other commenters point out. Most common fonts are going to be faster to paint from the cached CDN than letting it bloat your bundle sizes.

Re:Angular 11 by collyw on Thursday November 12, 2020 @07:56AM (#25069318)
I would still choose server side rendering and a bit of jQuery over a SPA app and JS frameowrk for a new project. It would take significantly less code and maintenance and would be fine for most projects out there.
Re:Angular 11 by tored on Thursday November 12, 2020 @08:20AM (#25069524)
Just wrote a small commercial app with SSR in PHP and some jQuery added on top for the more dynamic views. Used JsRender for the frontend templates. Great result.
Re:Angular 11 by jimbob45 on Thursday November 12, 2020 @11:24AM (#25071450)
If you’re going to make a comment like that, at least tell us what you think people are starting projects in please.
Re:Angular 11 by xwdv on Thursday November 12, 2020 @02:22PM (#25073758)
React.
[dead]
Re:Angular 11 by llimos on Thursday November 12, 2020 @07:05AM (#25068918)
https://2019.stateofjs.com/front-end-frameworks/

Look at awareness vs. interest. Lots of people know about it but most of them don't want to use it.

Re:Angular 11 by DJBunnies on Thursday November 12, 2020 @07:03AM (#25068893)
They clearly said feel, not fact.