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

Removing jQuery #2225

Merged
merged 6 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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