Vanilla UJS
See original GitHub issueAccording to http://caniuse.com/, IE<11 is going soon below 3% of the user base. According to Twitter, 95% (maybe more, not sure) of new apps are written with a React front-end, that doesn’t ‘invite’ for a jQuery dep. Doesn’t it feel like the right timing to start getting rid of the jQuery dependency?
@JangoSteve does what you say 1 year ago (https://www.reddit.com/r/rails/comments/2fzk5z/what_does_rails_use_jquery_for_it_is_possible_to/ckeduvo) still apply? Can we have 2 versions, jquery and vanilla with limited browser support, leaving side by side for a while?
Someone (@hauleth) gave it a go, https://github.com/hauleth/vanilla-ujs, I tried it.
It looks like it work (I found a typo document.create
instead of document.createElement
but other than that, my app is behaving fine)
Problem is, it is hard to find (no announcement in the Ruby community) no browser support details and it looks unmaintained.
Does someone with a solid JS background (ie not me) can review the code and tell us what can be expected in terms of browser support and maintenance overhead if it was to be officially supported? Does @hauleth or maybe @Ximik (who did a gem out of it) want to talk about it?
Sorry if I’m just polluting, I’m just surprised that there still is no solid solution to get the UJS features I love without a 30k (2.X.X minified&gziped https://mathiasbynens.be/demo/jquery-size) wrapper around querySelectorAll
or createElement
for browsers I probably don’t care about any longer.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:10 (1 by maintainers)
@bbenezech I’ve done the stuff you said it’s good to be done. I’m not really great about understanding how rails community works, but probably i have to write also in mailing list (or it can be done but u, don’t know).
The problem is i didn’t hear any feedback. Like “we need this” or “we don’t give a fuck”. It’s kinda surprising for me.
@kirushik I am not sure anyone on Rails Core would be interested in this problematic. They might dismiss it as premature and unnecessary, which makes sense from a maintenance point of vue. When IE<10 usage really wears off, someone will contribute a PR to chose adapter in
rails new
and offer a vanilla option for the UJS, making the gem more mainstream?@Ximik Good job. I guess the lack of feedback comes from the absence of anything ‘new and exiting’. Developers will consider using it when starting a new project and realizing they don’t need jQuery anymore. Having a reference 1.0 maintained implementation may be all it needs to get the train started!
Thanks a lot for doing it. I’ll use it and PR any issue I may find.
Please feel free to continue the discussion there: https://github.com/Ximik/vanilla-ujs/issues