Removing JQuery #29

Merged
merged 1 commit into from Mar 6, 2014

6 participants

@TheSavior

As I was looking at this code, and wanting to commit, I noticed that half of the listed issues are just with detecting jQuery versions. We also want this to work efficiently with mobile browsers. The answer for speed and ease of development in this case is to just not use jQuery.

Most of the code that was in here was just setting the html or reading the values, nothing that we need to have all of jQuery for. Also, loading this now on pages without jQuery will be significantly faster (again, important for mobile).

More changes will come, but we first need to get off of jQuery.

Closes #1, #3, and #7

@Miserlou
Owner

Oohhhh shiiiiit!

I gotta test this out some more, but if this works, you are a fucking wizard. Sawwwweeeeeeeeeeeeeeet.

@tomByrer

we first need to get off of jQuery

Thank you!

@SeriousM

👍

@SeriousM

For everyone who is not familiar with the non-jquery approach, here is a very good list of "thats jquery, thats without" comparisons. http://youmightnotneedjquery.com/

@jordan112

Ah, @SeriousM I was about the post that same site. A great reference. Looking through the js code, there shouldn't be anything that requires jquery. Make this dependency free.

@TheSavior

Wow, I've never seen that website before. It makes me really happy. It's missing some key things like animations though, which are the biggest thing people seem to do wrong with jQuery. good find.

@jordan112

Here is an example of slideDown animation without jQuery: http://jsfiddle.net/zZgrZ/

@TheSavior

Animating height is one of the worst things you can do in terms of performance. This code even tries to hard code 10 frames a second....

This is more of the correct way to do it, and it will run at 60fps on iphones too since it is GPU accelerated. All the major browsers are supported, just need to use the different prefixes.
http://jsfiddle.net/zZgrZ/95/

@jordan112

@TheSavior You are correct. That is a much better example of animation.

@tomByrer

@TheSavior CSS animation is great, but you're forgetting the prefix-free browsers (Firefox, IE >=10), IE9 -ms-, & IE8 which is not compatible at all (depends on @Miserlou 's requirements).

I have another 4 blog posts like http://youmightnotneedjquery.com/ to help people get off the jQuery addiction. jQ might help to develop faster, but often at the users' expense of needing to download a huge lib & more CPU used. I'm glad that you helped out!

@TheSavior

@tomByrer, the last phrase in my post was that it just needed to have the different prefixes (and prefix-free versions) to fill out browser support. In terms of IE8, my guess is that if someone is going to be using this as a bookmarklet, they know what a bookmarklet is and therefore aren't on IE8, but I agree that it is up to @Miserlou's requirements. :)

@Miserlou Miserlou merged commit dba0192 into Miserlou:master Mar 6, 2014
@tomByrer

last phrase in my post

Ooops, missed that, sorry!
Could use JS as a fallback for IE8 & other incompatible browsers.

@jordan112

So I see that most of jQuery was removed, but still see these in the .js

function show_spritz(){
    $('#spritz_spacer').slideDown();
    $('#spritz_container').slideDown();
    $('#spritz_holder').slideDown();
    $('#spritz_selector').val(0);
}
@TheSavior

Looks like a merge inconsistency from #37

@tomByrer

Looks like a merge inconsistency from #37

Re-merge? Here are the 2 masters currently: http://diffchecker.com/ay8ftfiz

@TheSavior

It's not a merge conflict per se, it's just that the #37 uses the old version, and was merged in after mine, so it uses the old version. It should be merged and then have an additional commit putting it into the right form. Or @jordan112 should merge my master into his, then modify his version so that his pull request has the right form to be merged directly.

@tomByrer

I think you're right, though someone should have suggested that before ;)
So I guess the best bet is to submit a new PR?

@0xE282B0

I think the easiest way is to send a PR to @TheSavior then we don't have the conflicting requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment