This Week in Rails: jQuery no longer part of Rails, and more
121–130 of 143 posts
Re: This Week in Rails: jQuery no longer part of Rails, and more
#122Earlier quoted context omitted.
I have an example to which maybe you or someone else can suggest a better 'vanilla' solution. Would love to hear suggestions. With jQuery I'd often do $( ).on('click', , callback); crucially, because events bubble up, even a click on a child element of will register as a click on the target element. in plain js it doesn't seem to work that way. I'd do .addEventListener(), but I'd run into the problem that the event.t…
> in plain js it doesn't seem to work that way. I'd do .addEventListener(), but I'd run into the problem that the event.target would point at the exact element that was clicked on instead of the parent element that I wanted to register clicks on. Unless I misunderstand, I think you might be looking for "event.currentTarget". event.target is the element that was clicked on, event.currentTarget is the element that has…
Re: This Week in Rails: jQuery no longer part of Rails, and more
#123In a way, it's an end of an era. What jQuery did for the industry when it first came out was amazing. Normalizing differing browser APIs, making cumbersome APIs more palatable, providing powerfully expressive query selectors, enabling fairly trivial plugin development, and the nifty monadic chaining. Some of those issues have been addressed by browsers, making vanilla JS a little less unreasonable. For other bits, ra…
Let's be honest, jQuery was a patch for the IE6 bug.
It also standardized around a plugin architecture making it easy for people to write code others could easily reuse.
If you think there is only one iE6 bug that jQuery helped alleviate you'd be wrong. There are thousands of quirks/bugs/proprietary crap that jQuery handled for web developers.
Reducing it to an IE6 bug fix is out of touch with reality.
Re: This Week in Rails: jQuery no longer part of Rails, and more
#124Earlier quoted context omitted.
Yeah I get flak when I still use jQuery in new projects. Why do I use it? It fucking works, with no need to depend on npm, the application is a lot snappier than using Angular. If I move on from jQuery, it won't be to Angular. I tried React, but I also found it too much boilerplate. I'm trying VueJS next.
I've noticed that the people that ridicule you for using stuff that works (like jQuery) are the same people that have trouble maintaining their own older code, because they'd much rather just start over.
* SystemJS - I don't understand what's the problem a lot of the time
* TypeScript tsc deciding that Promise is not a known entity.
* People telling me not to use SystemJS because it's causing me all my problems.
* People telling me not to use Typescript because it's causing all my problems.
* Taking 3 days to switch to something not causing my problems.
* Technology x causing me another set of problems.
Re: This Week in Rails: jQuery no longer part of Rails, and more
#125I will personally continue to use jQuery for many years to come. It's a lot of power in few concise lines of code and it really makes sense. And it comes at the cost of a single request. For the small amount of JS my sites use its perfect. I don't know why everyone in thread is saying goodbye to jQuery. Are that many people coding in vanilla JS?
Re: This Week in Rails: jQuery no longer part of Rails, and more
#126Funny how people here are saying goodbye to jQuery. I'm saying goodbye to Rails.
Re: This Week in Rails: jQuery no longer part of Rails, and more
#127In a way, it's an end of an era. What jQuery did for the industry when it first came out was amazing. Normalizing differing browser APIs, making cumbersome APIs more palatable, providing powerfully expressive query selectors, enabling fairly trivial plugin development, and the nifty monadic chaining. Some of those issues have been addressed by browsers, making vanilla JS a little less unreasonable. For other bits, ra…
Let's be honest, jQuery was a patch for the IE6 bug.
Re: This Week in Rails: jQuery no longer part of Rails, and more
#128Earlier quoted context omitted.
Let's be honest, jQuery was a patch for the IE6 bug.
It was much more than that. jQuery made difficult things easy and paved the way for future technologies by using browser specific abilities and providing a unified API for developers to use. It also standardized around a plugin architecture making it easy for people to write code others could easily reuse. If you think there is only one iE6 bug that jQuery helped alleviate you'd be wrong. There are thousands of quirk…
Re: This Week in Rails: jQuery no longer part of Rails, and more
#129jQuery was the my first language that got me into coding; I had started javascript but it became very difficult to write a short amount of code for some basic things that I was working with back in 2012. Ruby on Rails was my first framework for developing web applications. I still use it today, but would remove jQuery as a dependency. I thought it was strange how much of dependency it was for certain things like dele…
I will concede its API became so ubiquitous that it morphed into some kind of pseudo-DSL.
Re: This Week in Rails: jQuery no longer part of Rails, and more
#130Earlier quoted context omitted.
I use plain JS. Can you give an example of a typical line of jQuery that you prefer over vanilla?
I have an example to which maybe you or someone else can suggest a better 'vanilla' solution. Would love to hear suggestions. With jQuery I'd often do $( ).on('click', , callback); crucially, because events bubble up, even a click on a child element of will register as a click on the target element. in plain js it doesn't seem to work that way. I'd do .addEventListener(), but I'd run into the problem that the event.t…