Live data from Hacker News

Angular 9.0

blog.angular.io

241–250 of 308 posts

Re: Angular 9.0

#241
post #116
post #80

Earlier quoted context omitted.

React != redux. I really like react, I really hate redux, so I use react without redux and it works just fine (we actually use tracker+minimongo from meteor for our app state and really like it)

My enjoyment of React grew exponentially once I moved from Redux to MobX.

I second this. In my last largish application, state was getting really messy and I needed a place to keep it all organized. I really tried hard to get Redux to work as at the time it was the tool that everyone was talking about. I struggled and couldn't make sense of it. Eventually I stumbled upon MobX and it just clicked. So easy to work with and checks all of my boxes. Productivity and happiness soared :)

Re: Angular 9.0

#242

Why is Angular so less popular than React?

Because a bunch of college kids and bootcampers only learned React and are afraid of the job market spotlight moving on from where they're standing.

Popularity is not a useful metric when evaluating frameworks. Community engagement and core team motivation are, and some people may use popularity as a proxy for those measurements.

Re: Angular 9.0

#243

Earlier quoted context omitted.

This is a (currently) under-rated approach that would apply well to many sites today.

While I want to agree, at the same time I'm afraid of people creating their own frameworks, re-inventing the wheel, etc. Mind you, Angular feels like a very heavyweight framework, so that would be the other side of the coin. Personally I wouldn't go for a vanilla JS application, not unless the script / application part of it are minimal.

I should have been more clear - my point is not so much that people should use vanilla JS rather than a framework, it’s more that the majority of SPAs I’m forced to interact with could have been implemented just as well with HTML, CSS, and a relatively small amount of JavaScript - small enough to not beg for any kind of framework at all. If the nature of the app really truly demands a full-blown SPA, then by all means go all in on something like React.

Re: Angular 9.0

#244
post #223

After 2 years of Angular madness I will send my resignation and I hope I will never work with it again. My app is a big stack of workaround stuff that might break anytime. Because that is how angular work. Some stuff work in a context and doesn't in an other. Nobody's know why ! They have so much issue on Github that they need a bot to close them after a while. They hope the bug disappear by himself ?

Angular is a framework if you've hack you're way without following best practices you expose yourself to such things. I've been working with Angular2+ for 3 years and I haven't met any bug. Know the concepts, apply them and you'll have an easy trip.

Almost every problem I've seen with Angular involve people not knowing how to implement features correctly or using it for what it wasn't meant to be used for. You know, the same problems people have with all frameworks.

Re: Angular 9.0

#246
post #244
post #223

Earlier quoted context omitted.

Angular is a framework if you've hack you're way without following best practices you expose yourself to such things. I've been working with Angular2+ for 3 years and I haven't met any bug. Know the concepts, apply them and you'll have an easy trip.

Almost every problem I've seen with Angular involve people not knowing how to implement features correctly or using it for what it wasn't meant to be used for. You know, the same problems people have with all frameworks.

Use things like Svelte. It's a framework that lets you hack. You don't need 'best practices'.

Re: Angular 9.0

#247
Can someone here please do a serious overview comparing the latest:

  Angular
  React
  Web Components
Things are changing so quickly, I just wanted to sort of have an overview for those of us who don’t work with these frameworks daily.

https://blog.usejournal.com/web-components-will-replace-your...

Can Web Components pretty much do everything without a framework now? I think Ionic moved to it for example. If we already have our own code for loading and rendering components, using Handlebars templates, what would we need to do to make them into web components instead, or make all of ours compatible with the latest React or Angular?

The specifics for anyone who cares:

When we began our own framework, way before React and Angular, we built our own, kinda “sane” reusable component engine. We called them “tools”. One tool on an element is a component. But you could also add multiple tools on a component, to add or remove behaviors:

https://qbix.com/platform/guide/tools

Basically, we figured it would be easier to just let Templates, HTML, CSS and JS each do what they were intended for.

HTML side

1. We had easily exporting json from php or templating engines, very readable and completely standard (no JSX or custom components). It was just slightly longer to write but provided useful metadata. It used to be called microformats back in the day. Multiple tools can be added on same element this way. The element didnt have to be a div.

2. We had handlebars helpers like {{&tool “Streams/chat” foo=bar}} and Q.Tool.setUpElement(“div”, toolName, options), or pass an element instead of “div” to add a tool on an existing element. We also had a jQuery fn method like $(“foo”).tool(“Streams/chat”, options).activate() .

3. Our users just called var element = Q.activate(Q.Tool.setUpElement(“div”))) in vanilla JS or $(“”).tool(...).activate() if jQuery was loaded.

* CSS side*

1. We namespaced our CSS by Modulename_toolname_

2, Some tools took advantage of shared CSS classes defined in the module or a module they depend on

Javascript side

1. We just had Q.Tool.define(toolName, constructor, defaultOptions, methods) and the tool.state would be the options merged over the defaultOptions. It was all customizable and merging was done via a smart Q.extend() function that we tweaked to eg combine Q.Event handlers in the best way.

2. Ways to access tools on an element would include Q.Tool.byId() and element.Q.tools etc. The tool ids would be autogenerated so as to establish a hierarchy of which tool was a parent. Then you could do tools.children([filterName]) and tools.parents() and so on. Traverse faster without touching the DOM.

3. We had Q.activate(container, options) to activate tools within a certain container. Javascript for tools would be loaded on demand, and tools would be added/removed on demand. We had Q.Event.prototype.add(callback, key) take a String key or a Q.Tool, so events would be automatically removed when a tool was removed.

4. You could also do Q.Tool.define([toolName1, toolName2], toolName, constructor, defaultOptions, methods) to have tools require that previously named tools already be activated on the element. This is for composability of tools, something more general than inheritance. Let’s say you have a chatroom and you want to add support for @mentions to it and https://linkscraping.com as you type. So you’d make tools that work in top of Streams/chat.

It seems to me that ANYWAY your user will have to load a Javascript file that defined your web components. And ANYWAY they will have to load javascript on demand. And ANYWAY this javascript may be packed into a single file so you’ll have to actually check whether a variable has been set before loading modules dynamically so you dont want static loading. And ANYWAY your tools may want to use shared css so you may as well namespace your CSS. And ANYWAY your default options may include event handlers or other things you can’t serialize easily into attributes of an element. And you may want to compose tools or find them with CSS so what’s wrong with using CSS classes instead of the element name for that? And ANYWAY you will want to render your tools in a readable way so why not stuff JSON into data attributes which were allowed for exactly such purposes? And ANYWAY you may want to use a powerful templating engine like Handlebars. The only part I am not sure of is the last one.

Seems to me - but I am biased - that we have the optimal approach. If something else comes out we can just turn Q.Tool.define into a wrapper around window.customComponents.define. But our users won’t have to change a thing. They can continue to use Q.Tool and Q.Page and Q.exports(arg, arg) and Q.requires(module, callback) without worrying what’s underneath. Isn’t it better and more stable?

But everyone got into Angular and React with its JSX etc. I think the main sell was the dirty checking (the model in Angular, the DOM in React). So you can just render a large chunk. I never saw the benefit of that. You should reason about mutations imho. Components are views with their own viewmodel, that’s all. You can update a bunch of state parameters and then call stateChanged(“a”, “b”) which would requestAnimationFrame() and update stuff. Is it so hard to call stateChanged() after changing state.a and state.b ? Do you really need to instead grok digest cycles or a virtual dom??

Re: Angular 9.0

#248

Is there still a clear path from angularjs 1.x onto angular 9.0? Anyone done it recently? Supporting a large 1.x codebase right now, and would love to start incrementally moving to angular.

No there is no way to go from a donkey-cart to the Star ship USS Enterprise in a incremental way while still travelling forward. I've also had to do it. Just start from scratch. I'm a lot more productive with A6+ than I was with AJS

In addition to being completely accurate, this is one of the funniest things I've read on this site in a long time. Thanks for the laugh.

Re: Angular 9.0

#249
post #244

Earlier quoted context omitted.

Almost every problem I've seen with Angular involve people not knowing how to implement features correctly or using it for what it wasn't meant to be used for. You know, the same problems people have with all frameworks.

Use things like Svelte. It's a framework that lets you hack. You don't need 'best practices'.

>It's a framework that lets you hack.

Translation: It's a framework that does less.

Re: Angular 9.0

#250

Earlier quoted context omitted.

Angular has a lot of unique concepts that people find difficult to wrap their heads around. The Observable pattern, decorators, typescript, etc. When you throw things like NGRX and effective management of state / side-effects in the mix; things get exponentially more complex and difficult to scale. I have personally witnessed companies take guys who have been slapping together "apps" in jQuery / .NET for the past 10…

> Observable pattern, decorators, typescript Neither of those is Angular-specific. In fact, of those you mentioned jQuery is the library with the unusual, idiosyncratic concepts.

They are not Angular-specific, but they are required to know. That undeniably increases the learning curve. And the Observable pattern is decoupled from Angular change detection, so spaghetti coders can find themselves in especially confusing situations. I say this as someone who loves RxJS and typescript.
Post reply on HN