Skip to content

Commit 7f7f858

Browse files
committed
Remove jQuery from docs/repo.
Some of the snippets need to be updated later.
1 parent 1da5b9f commit 7f7f858

23 files changed

+30
-58
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ includes code changes) and under the terms of the
224224
- 2 spaces (no tabs)
225225
- strict mode
226226
- "Attractive"
227-
- Don't use [jQuery event alias convenience methods](https://github.com/jquery/jquery/blob/master/src/event/alias.js) (such as `$().focus()`). Instead, use [`$().trigger(eventType, ...)`](https://api.jquery.com/trigger/) or [`$().on(eventType, ...)`](https://api.jquery.com/on/), depending on whether you're firing an event or listening for an event. (For example, `$().trigger('focus')` or `$().on('focus', function (event) { /* handle focus event */ })`) We do this to be compatible with custom builds of jQuery where the event aliases module has been excluded.
228227

229228
### Checking coding style
230229

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bootstrap/
101101
└── bootstrap.min.js.map
102102
```
103103

104-
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/).
104+
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/).
105105

106106

107107
## Bugs and feature requests

_config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ cdn:
5555
js_hash: "sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
5656
js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
5757
js_bundle_hash: "sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o"
58-
jquery: "https://code.jquery.com/jquery-3.3.1.slim.min.js"
59-
jquery_hash: "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
6058
popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
6159
popper_hash: "sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
6260

build/generate-sri.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ const fs = require('fs')
1717
const path = require('path')
1818
const sh = require('shelljs')
1919

20-
const pkg = require('../package.json')
21-
2220
sh.config.fatal = true
2321

2422
const configFile = path.join(__dirname, '../_config.yml')
@@ -39,10 +37,6 @@ const files = [
3937
file: 'dist/js/bootstrap.bundle.min.js',
4038
configPropertyName: 'js_bundle_hash'
4139
},
42-
{
43-
file: `site/docs/${pkg.version_short}/assets/js/vendor/jquery-slim.min.js`,
44-
configPropertyName: 'jquery_hash'
45-
},
4640
{
4741
file: 'node_modules/popper.js/dist/umd/popper.min.js',
4842
configPropertyName: 'popper_hash'

nuget/bootstrap.nuspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<copyright>Copyright 2017-2019</copyright>
1717
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1818
<dependencies>
19-
<dependency id="jQuery" version="[3.0.0,4)" />
2019
<dependency id="popper.js" version="[1.14.0,2)" />
2120
</dependencies>
2221
<tags>css mobile-first responsive front-end framework web</tags>

nuget/bootstrap.sass.nuspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<copyright>Copyright 2017-2019</copyright>
1717
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1818
<dependencies>
19-
<dependency id="jQuery" version="[3.0.0,4)" />
2019
<dependency id="popper.js" version="[1.14.0,2)" />
2120
</dependencies>
2221
<tags>css sass mobile-first responsive front-end framework web</tags>

package.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Package.describe({
99

1010
Package.onUse(function (api) {
1111
api.versionsFrom('[email protected]');
12-
api.use('jquery', 'client');
1312
api.addFiles([
1413
'dist/css/bootstrap.css',
1514
'dist/js/bootstrap.js'

site/_layouts/examples.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
{{ content }}
3939

4040
{%- if page.include_js != false -%}
41-
<script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
42-
<script>window.jQuery || document.write('<script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/js/vendor/jquery-slim.min.js"><\/script>')</script>
43-
4441
{%- if jekyll.environment == "production" -%}
4542
<script src="{{ site.baseurl }}/docs/{{ site.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ site.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
4643
{%- else -%}

site/docs/4.3/assets/js/src/application.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@
6767
var exampleModal = document.getElementById('exampleModal')
6868
if (exampleModal) {
6969
exampleModal.addEventListener('show.bs.modal', function (event) {
70-
var button = event.relatedTarget // Button that triggered the modal
70+
var button = event.relatedTarget // Button that triggered the modal
7171
var recipient = button.getAttribute('data-whatever') // Extract info from data-* attributes
7272

73-
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
74-
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
73+
// Update the modal's content.
7574
var modalTitle = exampleModal.querySelector('.modal-title')
7675
var modalBodyInput = exampleModal.querySelector('.modal-body input')
7776

site/docs/4.3/assets/js/vendor/jquery-slim.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

site/docs/4.3/browser-bugs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See also:
1414
* [Chromium issue 536263: [meta] Issues affecting Bootstrap](https://bugs.chromium.org/p/chromium/issues/detail?id=536263)
1515
* [Mozilla bug 1230801: Fix the issues that affect Bootstrap](https://bugzilla.mozilla.org/show_bug.cgi?id=1230801)
1616
* [WebKit bug 159753: [meta] Issues affecting Bootstrap](https://bugs.webkit.org/show_bug.cgi?id=159753)
17-
* [jQuery's browser bug workarounds](https://docs.google.com/document/d/1LPaPA30bLUB_publLIMF0RlhdnPx_ePXm7oW02iiT6o)
1817

1918
<table class="bd-browser-bugs table table-bordered table-hover">
2019
<thead>

site/docs/4.3/components/alerts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ toc: true
1111

1212
## Examples
1313

14-
Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts jQuery plugin](#dismissing).
14+
Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts JavaScript plugin](#dismissing).
1515

1616
{% capture example %}
1717
{% for color in site.data.theme-colors %}

site/docs/4.3/components/collapse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You can use a link with the `href` attribute, or a button with the `data-target`
4141

4242
## Multiple targets
4343

44-
A `<button>` or `<a>` can show and hide multiple elements by referencing them with a JQuery selector in its `href` or `data-target` attribute.
44+
A `<button>` or `<a>` can show and hide multiple elements by referencing them with a selector in its `href` or `data-target` attribute.
4545
Multiple `<button>` or `<a>` can show and hide an element if they each reference it with their `href` or `data-target` attribute
4646

4747
{% capture example %}

site/docs/4.3/components/modal.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ Utilize the Bootstrap grid system within a modal by nesting `.container-fluid` w
498498

499499
### Varying modal content
500500

501-
Have a bunch of buttons that all trigger the same modal with slightly different contents? Use `event.relatedTarget` and [HTML `data-*` attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes) (possibly [via jQuery](https://api.jquery.com/data/)) to vary the contents of the modal depending on which button was clicked.
501+
Have a bunch of buttons that all trigger the same modal with slightly different contents? Use `event.relatedTarget` and [HTML `data-*` attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes) to vary the contents of the modal depending on which button was clicked.
502502

503503
Below is a live demo followed by example HTML and JavaScript. For more information, [read the modal events docs](#events) for details on `relatedTarget`.
504504

@@ -542,8 +542,9 @@ Below is a live demo followed by example HTML and JavaScript. For more informati
542542
$('#exampleModal').on('show.bs.modal', function (event) {
543543
var button = $(event.relatedTarget) // Button that triggered the modal
544544
var recipient = button.data('whatever') // Extract info from data-* attributes
545-
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
546-
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
545+
// If necessary, you could initiate an AJAX request here
546+
// and then do the updating in a callback.
547+
// Update the modal's content.
547548
var modal = $(this)
548549
modal.find('.modal-title').text('New message to ' + recipient)
549550
modal.find('.modal-body input').val(recipient)

site/docs/4.3/components/popovers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Note that for security reasons the `sanitize`, `sanitizeFn` and `whiteList` opti
192192
<td>html</td>
193193
<td>boolean</td>
194194
<td>false</td>
195-
<td>Insert HTML into the popover. If false, jQuery's <code>text</code> method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.</td>
195+
<td>Insert HTML into the popover. If false, <code>innerText</code> property will be used to insert content into the DOM. Use text if you're worried about XSS attacks.</td>
196196
</tr>
197197
<tr>
198198
<td>placement</td>

site/docs/4.3/components/scrollspy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ Navbar links must have resolvable id targets. For example, a `<a href="#home">ho
264264
{% include callout.html content=callout type="danger" %}
265265

266266
{% capture callout %}
267-
#### Non-`:visible` target elements ignored
267+
#### Non-visible target elements ignored
268268

269-
Target elements that are not [`:visible` according to jQuery](https://api.jquery.com/visible-selector/) will be ignored and their corresponding nav items will never be highlighted.
269+
Target elements that are not visible will be ignored and their corresponding nav items will never be highlighted.
270270
{% endcapture %}
271271
{% include callout.html content=callout type="info" %}
272272

@@ -310,7 +310,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
310310
<td>method</td>
311311
<td>string</td>
312312
<td>auto</td>
313-
<td>Finds which section the spied element is in. <code>auto</code> will choose the best method get scroll coordinates. <code>offset</code> will use jQuery offset method to get scroll coordinates. <code>position</code> will use jQuery position method to get scroll coordinates.</td>
313+
<td>Finds which section the spied element is in. <code>auto</code> will choose the best method get scroll coordinates. <code>offset</code> will use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect"><code>Element.getBoundingClientRect()</code></a> method to get scroll coordinates. <code>position</code> will use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop"><code>HTMLElement.offsetTop</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetLeft"><code>HTMLElement.offsetLeft</code></a> properties to get scroll coordinates.</td>
314314
</tr>
315315
<tr>
316316
<td>target</td>

site/docs/4.3/components/tooltips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Note that for security reasons the `sanitize`, `sanitizeFn` and `whiteList` opti
188188
<td>false</td>
189189
<td>
190190
<p>Allow HTML in the tooltip.</p>
191-
<p>If true, HTML tags in the tooltip's <code>title</code> will be rendered in the tooltip. If false, jQuery's <code>text</code> method will be used to insert content into the DOM.</p>
191+
<p>If true, HTML tags in the tooltip's <code>title</code> will be rendered in the tooltip. If false, <code>innerText</code> property will be used to insert content into the DOM.</p>
192192
<p>Use text if you're worried about XSS attacks.</p>
193193
</td>
194194
</tr>

site/docs/4.3/getting-started/contents.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: docs
33
title: Contents
4-
description: Discover what's included in Bootstrap, including our precompiled and source code flavors. Remember, Bootstrap's JavaScript plugins require jQuery.
4+
description: Discover what's included in Bootstrap, including our precompiled and source code flavors.
55
group: getting-started
66
toc: true
77
---
@@ -38,7 +38,7 @@ bootstrap/
3838
└── bootstrap.min.js.map
3939
{% endhighlight %}
4040

41-
This is the most basic form of Bootstrap: precompiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/).
41+
This is the most basic form of Bootstrap: precompiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [source maps](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/).
4242

4343
## CSS files
4444

@@ -97,7 +97,6 @@ Similarly, we have options for including some or all of our compiled JavaScript.
9797
<tr>
9898
<th scope="col">JS files</th>
9999
<th scope="col">Popper</th>
100-
<th scope="col">jQuery</th>
101100
</tr>
102101
</thead>
103102
<tbody>
@@ -107,15 +106,13 @@ Similarly, we have options for including some or all of our compiled JavaScript.
107106
<div><code class="font-weight-normal text-nowrap">bootstrap.bundle.min.js</code></div>
108107
</th>
109108
<td class="text-success">Included</td>
110-
<td class="bg-light text-muted">Not included</td>
111109
</tr>
112110
<tr>
113111
<th scope="row">
114112
<div><code class="font-weight-normal text-nowrap">bootstrap.js</code></div>
115113
<div><code class="font-weight-normal text-nowrap">bootstrap.min.js</code></div>
116114
</th>
117115
<td class="bg-light text-muted">Not included</td>
118-
<td class="bg-light text-muted">Not included</td>
119116
</tr>
120117
</tbody>
121118
</table>

site/docs/4.3/getting-started/download.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Download ready-to-use compiled code for **Bootstrap v{{ site.current_version}}**
1313
- Compiled and minified CSS bundles (see [CSS files comparison]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/contents/#css-files))
1414
- Compiled and minified JavaScript plugins
1515

16-
This doesn't include documentation, source files, or any optional JavaScript dependencies (jQuery and Popper.js).
16+
This doesn't include documentation, source files, or any optional JavaScript dependencies like Popper.js.
1717

1818
<a href="{{ site.download.dist }}" class="btn btn-bd-primary" onclick="ga('send', 'event', 'Getting started', 'Download', 'Download Bootstrap');">Download</a>
1919

@@ -37,10 +37,9 @@ Skip the download with [BootstrapCDN](https://www.bootstrapcdn.com/) to deliver
3737
<script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
3838
{% endhighlight %}
3939

40-
If you're using our compiled JavaScript, don't forget to include CDN versions of jQuery and Popper.js before it.
40+
If you're using our compiled JavaScript, don't forget to include Popper.js, via a CDN preferably, before our JS.
4141

4242
{% highlight html %}
43-
<script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
4443
<script src="{{ site.cdn.popper }}" integrity="{{ site.cdn.popper_hash }}" crossorigin="anonymous"></script>
4544
{% endhighlight %}
4645

@@ -56,7 +55,7 @@ Install Bootstrap in your Node.js powered apps with [the npm package](https://ww
5655
npm install bootstrap
5756
{% endhighlight %}
5857

59-
`require('bootstrap')` will load all of Bootstrap's jQuery plugins onto the jQuery object. The `bootstrap` module itself does not export anything. You can manually load Bootstrap's jQuery plugins individually by loading the `/js/*.js` files under the package's top-level directory.
58+
`require('bootstrap')` will load all of Bootstrap's plugins onto the `window` object. The `bootstrap` module itself does not export anything. You can manually load Bootstrap's plugins individually by loading the `/js/*.js` files under the package's top-level directory.
6059

6160
Bootstrap's `package.json` contains some additional metadata under the following keys:
6261

site/docs/4.3/getting-started/introduction.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,16 @@ Copy-paste the stylesheet `<link>` into your `<head>` before all other styleshee
2626

2727
### JS
2828

29-
Many of our components require the use of JavaScript to function. Specifically, they require [jQuery](https://jquery.com/), [Popper.js](https://popper.js.org/), and our own JavaScript plugins. Place the following `<script>`s near the end of your pages, right before the closing `</body>` tag, to enable them. jQuery must come first, then Popper.js, and then our JavaScript plugins.
30-
31-
We use [jQuery's slim build](https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/), but the full version is also supported.
29+
Many of our components require the use of JavaScript to function. Specifically, they require our own JavaScript plugins and [Popper.js](https://popper.js.org/). Place the following `<script>`s near the end of your pages, right before the closing `</body>` tag, to enable them. Popper.js must come first, and then our JavaScript plugins.
3230

3331
{% highlight html %}
34-
<script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
3532
<script src="{{ site.cdn.popper }}" integrity="{{ site.cdn.popper_hash }}" crossorigin="anonymous"></script>
3633
<script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
3734
{% endhighlight %}
3835

39-
Curious which components explicitly require jQuery, our JS, and Popper.js? Click the show components link below. If you're at all unsure about the general page structure, keep reading for an example page template.
36+
Curious which components explicitly require our JavaScript and Popper.js? Click the show components link below. If you're at all unsure about the general page structure, keep reading for an example page template.
4037

41-
Our `bootstrap.bundle.js` and `bootstrap.bundle.min.js` include [Popper](https://popper.js.org/), but not [jQuery](https://jquery.com/). For more information about what's included in Bootstrap, please see our [contents]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/contents/#precompiled-bootstrap) section.
38+
Our `bootstrap.bundle.js` and `bootstrap.bundle.min.js` include [Popper](https://popper.js.org/). For more information about what's included in Bootstrap, please see our [contents]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/contents/#precompiled-bootstrap) section.
4239

4340
<details>
4441
<summary class="text-primary mb-3">Show components requiring JavaScript</summary>
@@ -77,8 +74,7 @@ Be sure to have your pages set up with the latest design and development standar
7774
<h1>Hello, world!</h1>
7875

7976
<!-- Optional JavaScript -->
80-
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
81-
<script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
77+
<!-- Popper.js first, then Bootstrap JS -->
8278
<script src="{{ site.cdn.popper }}" integrity="{{ site.cdn.popper_hash }}" crossorigin="anonymous"></script>
8379
<script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
8480
</body>

0 commit comments

Comments
 (0)