Live data from Hacker News

Drop jQuery as a dependency from Rails

github.com

51–60 of 123 posts

Re: Drop jQuery as a dependency from Rails

#51

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.

It is completely optional, just pass the --skip-javascript option when you generate a new app.

Re: Drop jQuery as a dependency from Rails

#52

There was an article about a week ago that makes the claim that Rails is tailor-made for Basecamp. This single comment absolutely confirms that point of view: https://github.com/rails/rails/issues/25208#issuecomment-222...

Do you have a link to the article?

Re: Drop jQuery as a dependency from Rails

#53
post #27

Earlier quoted context omitted.

Sure, except in this case the Rails defaults are totally at odds with how the larger JS ecosystem has evolved. CoffeeScript was basically the logical complement to Haml (Ruby-like syntax for HTML) and Sass (Ruby-like syntax for CSS) -- although Sass has since dropped its original syntax and moved on with the CSS-like SCSS. Since then CS has lost a lot of popularity outside the Rails community. Babel and TypeScript pr…

I agree it's not the complete solution, but I think rails does a pretty good job at providing tools for making a progressive webapp. Many of us see the apps that have a blank page until data is loaded and the front end JS then renders. It's just a yuck experience. I dislike the fact that it happens in one of my own projects. While I find the concept of turbo links weird with pulling raw html over XHR and then renderi…

The "blank page" argument was once fairly compelling, but both React and Ember (that I know of) have been increasingly successful at solving that issue.

Re: Drop jQuery as a dependency from Rails

#54

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.

And asset-pipeline altogether. Replace it with a simple optional gem to integrate with Webpack.

Re: Drop jQuery as a dependency from Rails

#55

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.

Rails philosophy is a full stack framework. Not having to make decisions about your first web app is a huge draw to the framework.

> Rails philosophy is a full stack framework. Not having to make decisions about your first web app is a huge draw to the framework.

But you still have to make a lot of decisions. How do you handle user management ? ACL in a Rails app ? AFAIK Rails doesn't come with a default solution to these problems. What do you think is more important for an application ? User management or turbolinks by default ? The former would make more sense in a full stack framework. In fact both Django and Symfony 2 come with default solutions for this use case.

Finally, the JS ecosystem is moving so fast that decoupling JS from Ruby would make Rails maintenance a lot easier, Rails can't keep up with the front-end ecosystem and its avalanche of "good practice du jour". It's not like RDBMS which are fairly stable and didn't change in 10 years.

Re: Drop jQuery as a dependency from Rails

#56

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.

It is completely optional, just pass the --skip-javascript option when you generate a new app.

> It is completely optional, just pass the --skip-javascript option when you generate a new app.

This option should be opt in, not opt out which is the whole point of my comment.

Re: Drop jQuery as a dependency from Rails

#57

There was an article about a week ago that makes the claim that Rails is tailor-made for Basecamp. This single comment absolutely confirms that point of view: https://github.com/rails/rails/issues/25208#issuecomment-222...

Sure, DHH said it himself. Rails is for basecamp like apps. Whats the deal?

Re: Drop jQuery as a dependency from Rails

#58

As a web dev for the last 15 years or so, this is amazing news. The browsers are finally getting to a point where the pain jQuery solved, is going away.

jQuery helps with browser quirks, though. Search the below file for the string "// Support" to see what I mean. Yes, there are a lot of entries for older browsers, but there are also a lot of entries for relatively recent browsers too. https://github.com/jquery/jquery/blob/3.0.0-rc1/dist/jquery....

Reading the Jquery source code is fun. It seems like they're doing some really clever stuff there. For example, look at isEmptyObject in the code you linked.

Re: Drop jQuery as a dependency from Rails

#59

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 agree. It's just cruft I have to work around or rip out.

Re: Drop jQuery as a dependency from Rails

#60

There was an article about a week ago that makes the claim that Rails is tailor-made for Basecamp. This single comment absolutely confirms that point of view: https://github.com/rails/rails/issues/25208#issuecomment-222...

Do you have a link to the article?

http://www.akitaonrails.com/2016/05/23/rails-has-won-the-ele...

HN discussion: https://news.ycombinator.com/item?id=11757993

Post reply on HN