Live data from Hacker News

Drop jQuery as a dependency from Rails

github.com

101–110 of 123 posts

Re: Drop jQuery as a dependency from Rails

#101

Earlier quoted context omitted.

But is it "for Basecamp like apps". Or is it "for the Basecamp app"? I honestly can't believe a back end framework has minimum supported browser requirements that are basically "use the latest or GTFO".

It is for "most web apps" because most web apps are like basecamp, and it isn't "use the latest or GTFO". It is "use the latest by default or add a single line to your gem file if you want to support older browsers." Most web apps are only tested on the latest browsers anyway, even if they claim to support older browsers. This is true unless you have a very popular app and a very large team.

> This is true unless you have a very popular app and a very large team.

Or you have very important and lucrative clients in government, healthcare, or some other crusty large organization with horribly dated browsers they're not going to replace any time soon. That quickly makes you throw away the latest React-* solution and reach for jQuery, however much you rage inside.

Re: Drop jQuery as a dependency from Rails

#102

For everyone who thinks rails installs too much by default, and hasn't ever tried `rails -h` - here are some options: --skip-gemfile --skip-git --skip-keeps --skip-active-record --skip-sprockets --skip-spring --skip-javascript --skip-turbolinks --skip-test-unit

The --skip options are handy. For reuse, they can be put into ~/.railsrc, e.g.

    --skip-gemfile
    --skip-git
    --skip-keeps

Re: Drop jQuery as a dependency from Rails

#103

The github thread itself is a nice example of a vibrant open source community. They're thinking about whether the project can be a good entry point for others into OSS, considering adopting outside libraries rather than re-writing it themselves, and generally operating in a pretty positive manner.

Helping newcomers find an entry point really helps them feel like they are contributing and helps them get involved. It's also important to be understanding when their code fails CI tests a few times.

Re: Drop jQuery as a dependency from Rails

#104
post #58

Earlier quoted context omitted.

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.

What's the particular cleverness in that? It seems it would also fail for objects with non-enumerable properties and properties with ES6 Symbols for names.

Re: Drop jQuery as a dependency from Rails

#105
post #82

Earlier quoted context omitted.

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....

It does help with browser quirks, but if you aren't supporting <IE10, then you really don't need it. I've made it a point to pull out jQuery from every project I have. Nowadays, I can test in Chrome as I develop and then test any other browsers at the very end and I rarely have any browser specific bugs. Crazy how far web dev has come.

You do really need it, at least for me. I'd rather write $ sign calls instead of getElementByID or querySelector just to start with. The sizzle library in jQuery is so advanced, that you can't do complex queries on the dom yet with today's browser.

Re: Drop jQuery as a dependency from Rails

#107

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.

You're missing the central point of default rails stack. http://david.heinemeierhansson.com/2012/rails-is-omakase.htm...

I prefer Giles Bowkett's dramatic reading version: https://www.youtube.com/watch?v=E99FnoYqoII

Re: Drop jQuery as a dependency from Rails

#108

Earlier quoted context omitted.

It is for "most web apps" because most web apps are like basecamp, and it isn't "use the latest or GTFO". It is "use the latest by default or add a single line to your gem file if you want to support older browsers." Most web apps are only tested on the latest browsers anyway, even if they claim to support older browsers. This is true unless you have a very popular app and a very large team.

> This is true unless you have a very popular app and a very large team. Or you have very important and lucrative clients in government, healthcare, or some other crusty large organization with horribly dated browsers they're not going to replace any time soon. That quickly makes you throw away the latest React-* solution and reach for jQuery, however much you rage inside.

Which is not true. Most frameworks have good support for legacy browsers.

And when some library fails in an old browser is always something so small that I end up making a PR and getting it fixed the same day.

Re: Drop jQuery as a dependency from Rails

#109

Earlier quoted context omitted.

This is one of the best things about Django - outside the admin interface it's not opinionated about your frontend setup.

Of course "not opinionated" in this case is an euphemism and really means that Django doesn't help you at all and so you have to suffer the incomplete and abandoned middleware of others to have something that resembles an asset pipeline. And that's actually odd, because both Rails and Django are frameworks born for building frontends to MySQL databases, which means these frameworks really are about HTTP 1.1 frontend…

Django models and migrations are very nice to work with. The Django Rest Framework and new Channels (aka sockets) functionality are quite nice. Getting usable, free user accounts and admin is a pleasure. Why not use Django?

Re: Drop jQuery as a dependency from Rails

#110
post #49

Earlier quoted context omitted.

What was your experience with Ext? I had to use it for a few years, and was never a huge fan. We ran into a lot of obscure bugs in their code which resulted in a number of hackaround "Ext.Overrides," and their support forums (Mitch Simmeons in particular) is a joke.

Which version did you use? I only used ExtJS 4 and 4.1 I liked their API documentation and the xtypes that allowed for declarative Views. React reminded me of this later.

I started on 3(.5?) and helped with a migration to 4 (which was a disgusting mistake of a process on our end). I like the format of their docs -- JSDuck was my favorite docset for a quite a while. I also enjoyed their methodology for constructing views and view hierarchies. Ultimately, I'd say I was a fan of what they were doing, I just think the implementation was rather shoddy, and the docs were frequently wrong or outdated, and (as mentioned) support was not good. When I got to React, it actually did bring back some memories of Ext, but without the full MVC hierarchy around views.
Post reply on HN