Skip to content

Commit

Permalink
Removing jQuery (#2225)
Browse files Browse the repository at this point in the history
* Removing jQuery

Closes #2215

(I'll write up a super great commit message when I merge this in)

Additionally, this commit updates Modernizr (I was in the gulpfile and was reminded that they just released)
  • Loading branch information
roblarsen authored May 4, 2020
1 parent 805d619 commit 1d2b155
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 121 deletions.
30 changes: 27 additions & 3 deletions dist/doc/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ it before the other scripts in the bottom of the page:
```html
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.0.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
Expand All @@ -154,7 +152,33 @@ The only thing Modernizr does regarding polyfills is that the team maintains [a
huge list of cross Browser
polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).

### jQuery CDN for jQuery
### jQuery

As of v8.0.0 we no longer include jQuery by default. Web development has
changed a lot since we started this project and while many millions of sites
still use jQuery there are many sites and applications that don't. 10 years ago
jQuery _was_ JavaScript for most developers. That's not the case any more so
we've made the decision to remove jQuery from the project.

If you're interested in including it, you can easily install jQuery using the
following command:

```
npm install jQuery
```

You can then copy the minified file into the `vendor` folder and add jQuery
to the `index.html` manually.

For reference the last version of the snippet we used to include jQuery looked
like the following:

``` html
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.0.min.js"><\/script>')</script>
```

#### jQuery CDN for jQuery

The jQuery CDN version of the jQuery JavaScript library is referenced towards
the bottom of the page. A local fallback of jQuery is included for rare
Expand Down
2 changes: 1 addition & 1 deletion dist/doc/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function, thus, preventing the browser from throwing an error.

This directory can be used to contain all 3rd party library code.

Minified versions of the latest jQuery and Modernizr libraries are included by
Our custom build of the Modernizr library is included by
default. You may wish to create your own [custom Modernizr build with the online
builder](https://modernizr.com/download/) or [command line
tool](https://modernizr.com/docs#command-line-config).
4 changes: 1 addition & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@

<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.0.min.js"><\/script>')</script>
<script src="js/vendor/modernizr-3.11.0.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>

Expand Down
2 changes: 0 additions & 2 deletions dist/js/vendor/jquery-3.5.0.min.js

This file was deleted.

3 changes: 0 additions & 3 deletions dist/js/vendor/modernizr-3.10.0.min.js

This file was deleted.

3 changes: 3 additions & 0 deletions dist/js/vendor/modernizr-3.11.0.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1d2b155

Please sign in to comment.