question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

According 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:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Ximikcommented, Dec 13, 2015

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

0reactions
bbenezechcommented, Dec 14, 2015

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

hauleth/vanilla-ujs: UJS without jQuery dependency - GitHub
Vanilla UJS. Build Status Dependency Status. It is implementation of Rails jQuery UJS in pure JavaScript. No extra dependencies.
Read more >
vanilla-ujs | RubyGems.org | your community gem host
vanilla -ujs 1.3.0. This gem provides Rails UJS features without jQuery library. Versions: 1.3.0 - November 06, 2016 (11 KB); 1.2.0 - July...
Read more >
vanilla-ujs - npm Package Health Analysis | Snyk
It is implementation of Rails jQuery UJS in pure JavaScript. No extra dependencies. Installation using the vanilla-ujs gem. For automated installation in Rails, ......
Read more >
vanilla-ujs · Version Badge for Ruby
Version Badge provides a consistent way for the Ruby community to learn about the RubyGem associated with a particular Github repository and other...
Read more >
Migrating from jquery-ujs to rails-ujs - DEV Community ‍ ‍
In 2016, the Rails team decided to drop the jQuery dependency and rewrite the library into a vanilla-JS one, named rails-ujs .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found