Html5-boilerplate: Update jQuery to 3.5.1 or... Remove jQuery? Discuss!

Created on 13 Apr 2020  路  10Comments  路  Source: h5bp/html5-boilerplate

Removing jQuery from the project has been suggested to me before, and was suggested as a discussion point for the upcoming 8.0 release by @coliff

I'm open to discussing it. This ticket is the place for that discussion 馃 馃槧 馃槃 馃槩

I'm not going to lay out my thoughts just yet, but I'll share what I think are the two different ways to look at it.

On the one hand- Builtwith's jQuery Usage Statistics usage statistics indicate that it's in use on 76% of the top 1m sites. For many people it's still very much a thing.

On the other hand- For many people who active on GitHub and who stay on the cutting edge of front end development, jQuery is three or four generations old and doesn't have any place at all in their day-to-day development. It may live as a dependency somewhere in some projects, but doing a lot of $() stuff is something from the past.

awaiting feedback has-pr

Most helpful comment

I think that the trend now is to remove jQuery support, and it would be right to support this trend and jQuery shouldn't be included by default in web dev nowadays. Anyway if developer prefer to use jQuery it's very easy to add it, but when it won't be included by default I think it's more likely to make a developer concider is jQuery really needed in his project, when he basically need only to toggle class once..

Optional build the project with/without jQuery where jQuery is off by default seems like the best option to me.

All 10 comments

@coliff said

I made a PR to update to jQuery 3.5.0 today, but it looks like a quick patch release (jquery/jquery#4665) will be released very soon so we'll need to update again - OR we could consider removing jQuery altogether. The way websites are built has changed a lot of the last 10 years and jQuery is no longer an essential inclusion. If folks want to add it, it's easy for them to do it themselves without it being included by default for everyone.

I'm also open to an option where you can optionally build the project with/without jQuery from the command line. I want to have a version that we're happy with that ships in the 8.0 zip, but I am also happy to push some optional stuff into the build-- using static properties in a config file to make it super easy. We could add things like the value for the lang attribute there as well.

UI designer here, frequent user of this project for prototyping website interactions and such.

My initial reaction was: _oh no don't take my jQuery away_. I am stuck in my ways, and I still use it, as it just "makes sense" for simple DOM traversal and manipulation stuff.

But after 2 minutes of consideration: _bundling a third-party library is not a core competency of this project_. It's trivial to add jQuery on your own. In fact, for reasons I don't recall right now, I ripped out the included version and added jQuery Slim in my most recent prototype.

Including jQuery is tremendously simple with their CDN (https://code.jquery.com), and it's easy to download, so, I say it's safe to remove.

I think that the trend now is to remove jQuery support, and it would be right to support this trend and jQuery shouldn't be included by default in web dev nowadays. Anyway if developer prefer to use jQuery it's very easy to add it, but when it won't be included by default I think it's more likely to make a developer concider is jQuery really needed in his project, when he basically need only to toggle class once..

Optional build the project with/without jQuery where jQuery is off by default seems like the best option to me.

Remove it and remove it now! 馃挴

To echo https://github.com/h5bp/html5-boilerplate/issues/2215#issuecomment-615350077 Removing jQuery gives people some flexibility in choosing how and what they may or may not add to enhance their site. At one point, it was a given that jQuery was a necessary part of any site and now it's just one of many tools that developers can use to accomplish a variety of front-end tasks.

Going once.... Going twice...

Just wanted to chime in with my thoughts quickly. I'm a big fan of jQuery and use it in many projects but there are quite a few good reasons why we shouldn't include it by default in the template:

  • Sometimes users may want to use the smaller slim build
  • Self-hosting jQuery rather than using a third-party CDN has many advantages, including longer browser cache life (3rd party assets typically have shorter cache life) and potentially improved performance from not needing to do DNS resolution/TCP/TLS lookup. https://csswizardry.com/2019/05/self-host-your-static-assets/

On the one hand I'm in favor of removing jQuery, for a long time it was the go-to javascript library and it was used in almost every project, however things have changed with more powerful HTML & CSS and a broad variety of other javascript solutions.
But ... I do use javascript libraries within my projects, often from CDN's, so leaving in an example on how to implement one in your code the "best", "correct" or most efficient way is still beneficial. (Remember when we used to stuff almost everything in between the head-tags?)
To avoid the implication that jQuery should be a standard within every project, a fake library could be used or a smaller, single functionality library plus a comment stating it is an example on how to implement.

Removing jQuery from the project has been suggested to me before, and was suggested as a discussion point for the upcoming 8.0 release by @coliff

I'm open to discussing it. This ticket is the place for that discussion 馃 馃槧 馃槃 馃槩

I'm not going to lay out my thoughts just yet, but I'll share what I think are the two different ways to look at it.

On the one hand- Builtwith's jQuery Usage Statistics usage statistics indicate that it's in use on 76% of the top 1m sites. For many people it's still very much a thing.

On the other hand- For many people who active on GitHub and who stay on the cutting edge of front end development, jQuery is three or four generations old and doesn't have any place at all in their day-to-day development. It may live as a dependency somewhere in some projects, but doing a lot of $() stuff is something from the past.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

necolas picture necolas  路  44Comments

sideshowbarker picture sideshowbarker  路  5Comments

gaurav21r picture gaurav21r  路  21Comments

klutchdev picture klutchdev  路  18Comments

roblarsen picture roblarsen  路  5Comments