Live data from Hacker News

Drop jQuery as a dependency from Rails

github.com

11–20 of 123 posts

Re: Drop jQuery as a dependency from Rails

#11

Rails should stop messing with Javascript all together. Drop JQuery, CoffeeScript, TurboLinks and what not and let the users decide what to use, make it optional. Rails shouldn't require a JS engine in order to run.

Yep, I use Rails to host Sidekiq background workers. Have absolutely no use for the front-end stuff.

Re: Drop jQuery as a dependency from Rails

#12
post #8
post #4

Earlier quoted context omitted.

Is this a legacy thing? I'm a web dev for 10 years now and never used jQuery directly. (I used Ember for half a year, which seems to have jQuery as dependency)

So did you do JS development back in 2006 without jQuery?

I started with Prototype. Not sure if it came out before or after the first jQuery, but it was the cool kid for a while. Then the world realized it was a disaster and started moving to jQuery...

Re: Drop jQuery as a dependency from Rails

#13
post #8
post #4

Earlier quoted context omitted.

Is this a legacy thing? I'm a web dev for 10 years now and never used jQuery directly. (I used Ember for half a year, which seems to have jQuery as dependency)

So did you do JS development back in 2006 without jQuery?

I did, then Safari 1.0 happened, and we all went screaming for a solution. Praise jQuery.

Re: Drop jQuery as a dependency from Rails

#14

Rails should stop messing with Javascript all together. Drop JQuery, CoffeeScript, TurboLinks and what not and let the users decide what to use, make it optional. Rails shouldn't require a JS engine in order to run.

I think you might be missing the point, though! The main tradeoff of Rails is that it comes with that default setup in-place, and for most modern apps that will include Javascript. The defaults are there for a quick-start, and can easily be removed if you want to use a different approach.

Re: Drop jQuery as a dependency from Rails

#15
post #8
post #4

Earlier quoted context omitted.

Is this a legacy thing? I'm a web dev for 10 years now and never used jQuery directly. (I used Ember for half a year, which seems to have jQuery as dependency)

So did you do JS development back in 2006 without jQuery?

Yes

Re: Drop jQuery as a dependency from Rails

#17

Rails should stop messing with Javascript all together. Drop JQuery, CoffeeScript, TurboLinks and what not and let the users decide what to use, make it optional. Rails shouldn't require a JS engine in order to run.

Yep, I use Rails to host Sidekiq background workers. Have absolutely no use for the front-end stuff.

You might be interested to know Rails 5 has merged in Rails API[0], which strips out most of the front end stuff

[0] https://github.com/rails-api/rails-api

Re: Drop jQuery as a dependency from Rails

#18
I never understood why rails has javascript helpers at all. It just does not bring any value in the long run, just complicates stuff. Rails should be js libraries agnostic and not provide any js related helpers out of the box in my opinion.

Re: Drop jQuery as a dependency from Rails

#19
post #7
post #4

Earlier quoted context omitted.

Is this a legacy thing? I'm a web dev for 10 years now and never used jQuery directly. (I used Ember for half a year, which seems to have jQuery as dependency)

If you've been a web dev for 10 years then you'll know that the most fundamental tool for scripting is a pain point (document ready), jQuery did a good job of abstracting the nuances away, see: http://stackoverflow.com/questions/799981/document-ready-equ...

And the incompatible ajax interfaces. And the inconsistent element selection. And the...

I'm also not sure I'd call document ready the most fundamental as a lot of people (including me) used to use onclick='' and onload='' directly on elements back then when we all loaded script tags in the head.

Re: Drop jQuery as a dependency from Rails

#20

Rails should stop messing with Javascript all together. Drop JQuery, CoffeeScript, TurboLinks and what not and let the users decide what to use, make it optional. Rails shouldn't require a JS engine in order to run.

I think you're right if Rails was built for "production" applications. However, the way most people tend to use Rails is a prototyping framework. The nature of Ruby and the vast ecosystem of components (gems) makes building something very quick. It is definitely my go-to solution If I want to experiment with an idea.

The problem is if the prototype is successful, it becomes the production system and all the things that helped initial development start to hurt maintenance. That though is a different topic.

My point is having Rails give a good set of starting vectors for all things web development is a big part of why it is so quick to get started, it's what makes it great for prototyping.

Post reply on HN