Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vanilla UJS #447

Closed
bbenezech opened this issue Dec 3, 2015 · 10 comments
Closed

Vanilla UJS #447

bbenezech opened this issue Dec 3, 2015 · 10 comments

Comments

@bbenezech
Copy link

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.

@rafaelfranca
Copy link
Member

Thank you so much for the issue but we don't take feature request on the issue tracker. We recommend you to ask in Rails Core mailing list for feedback.

@Ximik
Copy link

Ximik commented Dec 3, 2015

Just in case someone is interested in it.

Current gem code has two possible issues about old browsers. FormData and querySelector.

http://caniuse.com/#feat=xhr2
http://caniuse.com/#feat=queryselector

@bbenezech
Copy link
Author

@rafaelfranca Really sorry about this, I forgot about the mailing list, no excuse, thanks for your time.

@Ximik Thanks for passing by! Do you think you can fix the document.create typo, add a Browser support section to your Readme, bump a 1.0.0 gem version and announce it on http://www.rubyflow.com? That would be terrific. 👍

@Ximik
Copy link

Ximik commented Dec 4, 2015

@bbenezech In my repo everything should be fixed and updated to current Rails version (so it should support all features). Please test the gem in your project if you can.

The only issue about my the gem is it hasn't tests. I thought about copying them from original Rails code, however they are hardcoded to jquery. However this guy @kirushik was interested in creating the tests. Don't know if he had time for it.

Anyway, i'll try to recheck everything and post it before the end of the month.

@bbenezech
Copy link
Author

@kirushik
Copy link

kirushik commented Dec 7, 2015

@Ximik I've checked — and it would be simpler (at least for me) just to implement a complete new set of tests, not to backport existing ones from either hauleth/vanilla-ujs or rails/jquery-ujs.

I'd like to do that (no end-date promised, though) — if the work is actually needed.
What's the status of this feature request — has anybody actually taken it to the rails mailing list?

@bbenezech
Copy link
Author

@kirushik I haven't. Is it needed?

@kirushik
Copy link

kirushik commented Dec 7, 2015

@bbenezech It looks like this issue hasn't been even considered because it originates from the Github, not from the mailing list (see the issue-closing message from @rafaelfranca).

@Ximik
Copy link

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

@bbenezech
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants