Menu icon Foundation
Foundation without jQuery?

Are there plans to get rid of jQuery and make Foundation use vanilla js only? it starts to get pretty annoying...

jqueryvanillajsjavascriptplans

Are there plans to get rid of jQuery and make Foundation use vanilla js only? it starts to get pretty annoying...

Jaziel Tan 7 months ago

I would very much like the idea. Especially with where es6 is going. I think we could really benefit from this. 

Fary Ferris 7 months ago

 I think a lot of people would be interested in a vanilla version as well.

appedology 7 months ago

vanilla js is good idea but what is the problem with jQuery ? There really is no reason why you should not use jQuery.

 

Leading Mobile App Development Company USA

 

Daniel Ruf 7 months ago

jQuery is bloated and not very performant. Foundation 7 will not require jQuery.

Peter 6 months ago

For one, as already mentioned, it is bloated. The next thing I have in mind is that jQuery is a pain in the a** regarding web components and shadow dom. Most of these individual Foundation plugin initializers use non-scoped selectors. In other terms, all initializers are document-based which interferes with the idea of document fragments.

I managed to wrap the jQuery/Sizzle constructor with my own functionality and it kinda works, but nonetheless I'd love to see vanilla in the next major release - with a strict focus on effective selectors, both for plugins and listeners such as resize, scroll etc.

maymiennam 6 months ago

vanilla js is good idea but what is the problem with jQuery ? There really is no reason why you should not use jQuery.

 

Daniel Ruf 6 months ago

See the previous statements / comment and there are more good reasons, for example that many jQuery functions can now be replaced by native JavaScript functions and that jQuery is not as actively developed as in the past.

This is the step that we take in most frameworks, the move away from jQuery, to make integration into new solutions easier (React, Angular, Vue, ...).

Jaziel Tan 6 months ago

Besides performance reasons especially when it comes to animations.

I think it's a good idea for new developers post jquery to actually write proper js instead getting sucked into the jquery syntax bubble. Like I did. 

It's not to hate on it. But I think it's time to move on.

Murray Chapman 6 months ago

I'm on board. jQuery was good when JavaScript was over the top and a bit hard to use. Now with the ECMA standards, it's tighter and better across the board. Besides jQuery loading after the page load and also being another script to load, Vanilla JS just makes sense.

As for Foundation 6, it is awesome and I appreciate what Zurb has done.

Peace all!

Frank Burleigh about 1 month ago

I'm another +1 for removing jQuery from Foundation in favor of either native JS or a lighter, plugin solution. We're well past the time when we needed jQuery to smooth browser differences; it's now a sort of technical debt. Some references may be useful:

  • http://youmightnotneedjquery.com/ has side-by-side use cases
  • https://css-tricks.com/now-ever-might-not-need-jquery/ provides an update to that with an overview