Live data from Hacker News

Stepping Backwards from AngularJS to JQuery – An Experiment

hundredminutehack.blogspot.com

51–60 of 68 posts

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#51
post #7

Next time, try dropping jQuery, too, and just using vanilla JavaScript. Just for fun. Simple DOM manipulation is now as simple in vanilla JavaScript as jQuery, with the only big advantage jQuery has now is if you're animating. You may find you're not missing much. You'd have to get used to slightly more involved Ajax syntax, unless you can target only new browsers, in which case the `fetch` API is just as convenient…

Using vanilla js is still a massive pita even with ES6.

Nowt's going to beat $(".thing") vs:

    document.getElementByClassNameWhichWordsDidIForgetToCapitalizeThisTimeManVanillaJavascriptSucks
Or

    document.querySelectorWhoopsNoIMeantQuerySelectorAllGodVanillaJavascriptSucks
Design by committee, you get crap. Ease of use is incredibly important. And don't even get me started on on the fly dom manipulation, vanilla js really sucks for that.

    let div = document.createElement("div");
    div.iMAlreadyBoredTyping = "Yes";
    node.appendChild(div);
vs

    $(node).append($("").data("quick", 1"));

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#52
post #47
post #38

Earlier quoted context omitted.

Actually, looking over the new Web Animation API, it looks like jQuery doesn't even offer much of an advantage for animations as long as you're targeting new browsers that have the Web Animation API (yes, I was referring to the animation support built into jQuery).

Ah, ok. Yes, there are much better options out there than using the animation jQuery offers. At minimum you can use CSS3 transitions and animations before even getting to the Web Animation API. They would likely serve most needs nicely for regular day-to-day sites. If one really wants to use the jQuery animation options, there are plugins that will try to shift them to CSS3 options instead, but keeping the same synta…

> Yes, there are much better options out there than using the animation jQuery offers.

No doubt. I haven't used jQuery to speak of in the past 2 years, and the only time I've found myself missing it was when I needed to do some simple animation and wasn't using a library like d3 that could do it just as easily or easier.

And yes, I mentioned CSS animations in this same thread. It's what I've been using in production for animation for the past 2+ years, although it sometimes feels wrong to animate things in JS by adding and removing classes from an element.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#53

Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…

FYI, none of the code on your site works for me, possibly because I have cookies and localStorage disabled in my browser. Not sure if this is specific to your framework or a quirk of the website itself (hopefully not the whole framework, as I don't understand why this requirement would be imposed if not actually needed by the app that's using it... since the fundamental premise of the framework seems to be "it's ligh…

Can you give me your browser/OS combo?

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#54
post #41

Earlier quoted context omitted.

Personally I welcome useful mentions of relevant alternatives in HN discussions, even if it's someone's own project. I would encourage you to tone down your rhetoric a bit, though. Intercooler looks like a good lightweight tool for projects with lightweight requirements, but based on your own documentation, the claim that it covers most of what is needed for most modern web apps just hurts your credibility.

Carson is in a bit of a bind in terms of marketing Intercooler. There is a huge mass of community support for frameworks that he feels are taking fundamentally the wrong approach. If he doesn't make a strong case for pushing the pendulum in the other direction then he'll just get drowned out by the echo chamber. Sometimes the plucky underdog has to shout a bit more loudly than is considered polite. Maybe one could ar…

Well, everyone's entitled to their opinion on the best way to do things, and in the right context it makes for interesting discussions. As I said before, I find the mention of a potentially useful alternative a valuable contribution to such discussion.

However, frequent and obviously excessive claims about the merits someone's personal preferences tend to fall somewhere between noise and trolling, and IMHO they are much less welcome.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#55
post #52
post #47

Earlier quoted context omitted.

Ah, ok. Yes, there are much better options out there than using the animation jQuery offers. At minimum you can use CSS3 transitions and animations before even getting to the Web Animation API. They would likely serve most needs nicely for regular day-to-day sites. If one really wants to use the jQuery animation options, there are plugins that will try to shift them to CSS3 options instead, but keeping the same synta…

> Yes, there are much better options out there than using the animation jQuery offers. No doubt. I haven't used jQuery to speak of in the past 2 years, and the only time I've found myself missing it was when I needed to do some simple animation and wasn't using a library like d3 that could do it just as easily or easier. And yes, I mentioned CSS animations in this same thread. It's what I've been using in production…

I understand. Just look at it as controlling the state of the element, not the animation directly, and the browser animates between them for you.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#56

Earlier quoted context omitted.

Angular is difficult to grok because it makes computer programming second class and limited to what you can cram into HTML tags. Angular isnt really a Google product - Misko Hevery and another guy (both Google SW Engineers) developed in their free time. Dart is a Google product and I would say is much easier to grok than Angular.

> Angular is difficult to grok because it makes computer programming second class and limited to what you can cram into HTML tags. ...say what? I've done a lot of work with Angular, and a lot of work without it, and it's possible that I might agree with what you're saying here if I understood it, but I don't. Can you elaborate?

I'm just saying that everything that Angular makes convenient via the hints it throws in HTML is handled behind the scenes by calling Javascript libraries.

I would much rather the QooxDoo approach of writing apps in pure Javascript and using Javascript libraries instead of the HTML/JS/CSS soup that Angular tries to serve up to me as convenience.

It might be more convenient for someone who cant write computer programs. But for me it insults my ability to read, extend and use well-documented APIs.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#58

Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…

Appreciate the shill. Hadn't heard of intercooler, but looks very interesting. At our company we've recently been pondering whether to fully embrace the client heavy approach of frameworks like Angular - which we've found frustrating in many ways (mixing server and client templating, localization, duplicated validation logic etc). We've used PJAX in the past and this looks like a suitably modern replacement.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#59

Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…

Appreciate the shill. Hadn't heard of intercooler, but looks very interesting. At our company we've recently been pondering whether to fully embrace the client heavy approach of frameworks like Angular - which we've found frustrating in many ways (mixing server and client templating, localization, duplicated validation logic etc). We've used PJAX in the past and this looks like a suitably modern replacement.

If you enjoy REST, intercooler dovetails really nicely with it: http://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.ht...

Happy to help you evaluate it for more advanced stuff (e.g. triggering client-side events from the server) just hit me up on the newsgroup.

Re: Stepping Backwards from AngularJS to JQuery – An Experiment

#60

Earlier quoted context omitted.

FYI, none of the code on your site works for me, possibly because I have cookies and localStorage disabled in my browser. Not sure if this is specific to your framework or a quirk of the website itself (hopefully not the whole framework, as I don't understand why this requirement would be imposed if not actually needed by the app that's using it... since the fundamental premise of the framework seems to be "it's ligh…

Can you give me your browser/OS combo?

Mac OSX El Capitan, Chrome 52
Post reply on HN