Skip to content

Commit 9bde6eb

Browse files
committed
Merge branch 'main' of https://github.com/twbs/bootstrap into main
# Conflicts: # dist/css/bootstrap-grid.css.map # dist/css/bootstrap-grid.min.css.map # dist/css/bootstrap-grid.rtl.css.map # dist/css/bootstrap-grid.rtl.min.css.map # dist/css/bootstrap-reboot.css.map # dist/css/bootstrap-reboot.min.css # dist/css/bootstrap-reboot.min.css.map # dist/css/bootstrap-reboot.rtl.css.map # dist/css/bootstrap-reboot.rtl.min.css # dist/css/bootstrap-reboot.rtl.min.css.map # dist/css/bootstrap-utilities.css # dist/css/bootstrap-utilities.css.map # dist/css/bootstrap-utilities.min.css # dist/css/bootstrap-utilities.min.css.map # dist/css/bootstrap-utilities.rtl.css # dist/css/bootstrap-utilities.rtl.css.map # dist/css/bootstrap-utilities.rtl.min.css # dist/css/bootstrap-utilities.rtl.min.css.map # dist/css/bootstrap.css # dist/css/bootstrap.css.map # dist/css/bootstrap.min.css # dist/css/bootstrap.min.css.map # dist/css/bootstrap.rtl.css # dist/css/bootstrap.rtl.css.map # dist/css/bootstrap.rtl.min.css # dist/css/bootstrap.rtl.min.css.map # dist/js/bootstrap.bundle.js # dist/js/bootstrap.bundle.js.map # dist/js/bootstrap.bundle.min.js # dist/js/bootstrap.bundle.min.js.map # dist/js/bootstrap.esm.js # dist/js/bootstrap.esm.js.map # dist/js/bootstrap.esm.min.js # dist/js/bootstrap.esm.min.js.map # dist/js/bootstrap.js # dist/js/bootstrap.js.map # dist/js/bootstrap.min.js # dist/js/bootstrap.min.js.map # js/dist/alert.js # js/dist/alert.js.map # js/dist/base-component.js # js/dist/base-component.js.map # js/dist/button.js # js/dist/button.js.map # js/dist/carousel.js # js/dist/carousel.js.map # js/dist/collapse.js # js/dist/collapse.js.map # js/dist/dom/data.js # js/dist/dom/data.js.map # js/dist/dom/event-handler.js # js/dist/dom/event-handler.js.map # js/dist/dom/manipulator.js # js/dist/dom/selector-engine.js # js/dist/dropdown.js # js/dist/dropdown.js.map # js/dist/modal.js # js/dist/modal.js.map # js/dist/offcanvas.js # js/dist/offcanvas.js.map # js/dist/popover.js # js/dist/popover.js.map # js/dist/scrollspy.js # js/dist/scrollspy.js.map # js/dist/tab.js # js/dist/tab.js.map # js/dist/toast.js # js/dist/toast.js.map # js/dist/tooltip.js # js/dist/tooltip.js.map # package-lock.json # package.json # scss/_accordion.scss # scss/bootstrap.scss
2 parents 470d621 + 232e392 commit 9bde6eb

File tree

191 files changed

+10607
-10309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+10607
-10309
lines changed

.browserslistrc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ last 2 major versions
55
not dead
66
Chrome >= 60
77
Firefox >= 60
8-
# needed since Legacy Edge still has usage; 79 was the first Chromium Edge version
9-
# should be removed in the future when its usage drops or when it's moved to dead browsers
10-
not Edge < 79
118
Firefox ESR
12-
iOS >= 10
13-
Safari >= 10
14-
Android >= 6
9+
iOS >= 12
10+
Safari >= 12
1511
not Explorer <= 11

.bundlewatch.config.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@
3434
},
3535
{
3636
"path": "./dist/js/bootstrap.bundle.js",
37-
"maxSize": "43 kB"
37+
"maxSize": "41 kB"
3838
},
3939
{
4040
"path": "./dist/js/bootstrap.bundle.min.js",
41-
"maxSize": "22.5 kB"
41+
"maxSize": "22 kB"
4242
},
4343
{
4444
"path": "./dist/js/bootstrap.esm.js",
45-
"maxSize": "28.5 kB"
45+
"maxSize": "27 kB"
4646
},
4747
{
4848
"path": "./dist/js/bootstrap.esm.min.js",
49-
"maxSize": "19 kB"
49+
"maxSize": "18 kB"
5050
},
5151
{
5252
"path": "./dist/js/bootstrap.js",
53-
"maxSize": "29 kB"
53+
"maxSize": "27 kB"
5454
},
5555
{
5656
"path": "./dist/js/bootstrap.min.js",
57-
"maxSize": "16.25 kB"
57+
"maxSize": "15.75 kB"
5858
}
5959
],
6060
"ci": {

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ Our default branch is for development of our upcoming Bootstrap 5 release. Head
4646

4747
Several quick start options are available:
4848

49-
- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.0.0-beta2.zip)
49+
- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.0.0-beta3.zip)
5050
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
5151
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap@next`
5252
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@next`
53-
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.0.0-beta2`
53+
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.0.0-beta3`
5454
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`
5555

5656
Read the [Getting started page](https://getbootstrap.com/docs/5.0/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
@@ -59,7 +59,7 @@ Read the [Getting started page](https://getbootstrap.com/docs/5.0/getting-starte
5959
## Status
6060

6161
[![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com/)
62-
[![Build Status](https://github.com/twbs/bootstrap/workflows/JS%20Tests/badge.svg?branch=main)](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain)
62+
[![Build Status](https://img.shields.io/github/workflow/status/twbs/bootstrap/JS%20Tests/main?label=JS%20Tests&logo=github)](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain)
6363
[![npm version](https://img.shields.io/npm/v/bootstrap)](https://www.npmjs.com/package/bootstrap)
6464
[![Gem version](https://img.shields.io/gem/v/bootstrap)](https://rubygems.org/gems/bootstrap)
6565
[![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue)](https://atmospherejs.com/twbs/bootstrap)

build/build-plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const bsPlugins = {
3535
Collapse: path.resolve(__dirname, '../js/src/collapse.js'),
3636
Dropdown: path.resolve(__dirname, '../js/src/dropdown.js'),
3737
Modal: path.resolve(__dirname, '../js/src/modal.js'),
38-
OffCanvas: path.resolve(__dirname, '../js/src/offcanvas.js'),
38+
Offcanvas: path.resolve(__dirname, '../js/src/offcanvas.js'),
3939
Popover: path.resolve(__dirname, '../js/src/popover.js'),
4040
ScrollSpy: path.resolve(__dirname, '../js/src/scrollspy.js'),
4141
Tab: path.resolve(__dirname, '../js/src/tab.js'),
@@ -72,7 +72,7 @@ const getConfigByPluginKey = pluginKey => {
7272
}
7373
}
7474

75-
if (pluginKey === 'Alert' || pluginKey === 'Tab' || pluginKey === 'OffCanvas') {
75+
if (pluginKey === 'Alert' || pluginKey === 'Tab' || pluginKey === 'Offcanvas') {
7676
return defaultPluginConfig
7777
}
7878

build/change-version.js

Lines changed: 45 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@
99

1010
'use strict'
1111

12-
const fs = require('fs')
12+
const fs = require('fs').promises
1313
const path = require('path')
14-
const sh = require('shelljs')
15-
16-
sh.config.fatal = true
14+
const globby = require('globby')
15+
16+
const VERBOSE = process.argv.includes('--verbose')
17+
const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run')
18+
19+
// These are the filetypes we only care about replacing the version
20+
const GLOB = [
21+
'**/*.{css,html,js,json,md,scss,txt,yml}'
22+
]
23+
const GLOBBY_OPTIONS = {
24+
cwd: path.join(__dirname, '..'),
25+
gitignore: true
26+
}
1727

1828
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
1929
function regExpQuote(string) {
@@ -24,89 +34,48 @@ function regExpQuoteReplacement(string) {
2434
return string.replace(/\$/g, '$$')
2535
}
2636

27-
const DRY_RUN = false
37+
async function replaceRecursively(file, oldVersion, newVersion) {
38+
const originalString = await fs.readFile(file, 'utf8')
39+
const newString = originalString.replace(
40+
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
41+
)
2842

29-
function walkAsync(directory, excludedDirectories, fileCallback, errback) {
30-
if (excludedDirectories.has(path.parse(directory).base)) {
43+
// No need to move any further if the strings are identical
44+
if (originalString === newString) {
3145
return
3246
}
3347

34-
fs.readdir(directory, (err, names) => {
35-
if (err) {
36-
errback(err)
37-
return
38-
}
39-
40-
names.forEach(name => {
41-
const filepath = path.join(directory, name)
42-
fs.lstat(filepath, (err, stats) => {
43-
if (err) {
44-
process.nextTick(errback, err)
45-
return
46-
}
47-
48-
if (stats.isDirectory()) {
49-
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
50-
} else if (stats.isFile()) {
51-
process.nextTick(fileCallback, filepath)
52-
}
53-
})
54-
})
55-
})
56-
}
48+
if (VERBOSE) {
49+
console.log(`FILE: ${file}`)
50+
}
5751

58-
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
59-
original = new RegExp(regExpQuote(original), 'g')
60-
replacement = regExpQuoteReplacement(replacement)
61-
const updateFile = DRY_RUN ?
62-
filepath => {
63-
if (allowedExtensions.has(path.parse(filepath).ext)) {
64-
console.log(`FILE: ${filepath}`)
65-
} else {
66-
console.log(`EXCLUDED:${filepath}`)
67-
}
68-
} :
69-
filepath => {
70-
if (allowedExtensions.has(path.parse(filepath).ext)) {
71-
sh.sed('-i', original, replacement, filepath)
72-
}
73-
}
74-
75-
walkAsync(directory, excludedDirectories, updateFile, err => {
76-
console.error('ERROR while traversing directory!:')
77-
console.error(err)
78-
process.exit(1)
79-
})
52+
if (DRY_RUN) {
53+
return
54+
}
55+
56+
await fs.writeFile(file, newString, 'utf8')
8057
}
8158

82-
function main(args) {
83-
if (args.length !== 2) {
84-
console.error('USAGE: change-version old_version new_version')
59+
async function main(args) {
60+
const [oldVersion, newVersion] = args
61+
62+
if (!oldVersion || !newVersion) {
63+
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
8564
console.error('Got arguments:', args)
8665
process.exit(1)
8766
}
8867

89-
const oldVersion = args[0]
90-
const newVersion = args[1]
91-
const EXCLUDED_DIRS = new Set([
92-
'.git',
93-
'_site',
94-
'node_modules',
95-
'resources'
96-
])
97-
const INCLUDED_EXTENSIONS = new Set([
98-
// This extension allowlist is how we avoid modifying binary files
99-
'',
100-
'.css',
101-
'.html',
102-
'.js',
103-
'.json',
104-
'.md',
105-
'.scss',
106-
'.txt',
107-
'.yml'
108-
])
109-
replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion)
68+
// Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
69+
[oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
70+
71+
try {
72+
const files = await globby(GLOB, GLOBBY_OPTIONS)
73+
74+
await Promise.all(files.map(file => replaceRecursively(file, oldVersion, newVersion)))
75+
} catch (error) {
76+
console.error(error)
77+
process.exit(1)
78+
}
11079
}
11180

11281
main(process.argv.slice(2))

build/rollup.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ if (BUNDLE) {
2828
// Remove last entry in external array to bundle Popper
2929
external.pop()
3030
delete globals['@popperjs/core']
31-
plugins.push(replace({ 'process.env.NODE_ENV': '"production"' }), nodeResolve())
31+
plugins.push(
32+
replace({
33+
'process.env.NODE_ENV': '"production"',
34+
preventAssignment: true
35+
}),
36+
nodeResolve()
37+
)
3238
}
3339

3440
const rollupConfig = {

build/ship.sh

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

config.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ params:
4747
social_image_path: /docs/5.0/assets/brand/bootstrap-social.png
4848
social_logo_path: /docs/5.0/assets/brand/bootstrap-social-logo.png
4949

50-
current_version: "5.0.0-beta2"
51-
current_ruby_version: "5.0.0.beta2"
50+
current_version: "5.0.0-beta3"
51+
current_ruby_version: "5.0.0.beta3"
5252
docs_version: "5.0"
5353
rfs_version: "9.0.3"
5454
github_org: "https://github.com/twbs"
@@ -61,19 +61,19 @@ params:
6161
icons: "https://icons.getbootstrap.com/"
6262

6363
download:
64-
source: "https://github.com/twbs/bootstrap/archive/v5.0.0-beta2.zip"
65-
dist: "https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta2/bootstrap-5.0.0-beta2-dist.zip"
66-
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta2/bootstrap-5.0.0-beta2-examples.zip"
64+
source: "https://github.com/twbs/bootstrap/archive/v5.0.0-beta3.zip"
65+
dist: "https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta3/bootstrap-5.0.0-beta3-dist.zip"
66+
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v5.0.0-beta3/bootstrap-5.0.0-beta3-examples.zip"
6767

6868
cdn:
6969
# See https://www.srihash.org for info on how to generate the hashes
70-
css: "https://cdn.jsdelivr.net/npm/[email protected]beta2/dist/css/bootstrap.min.css"
71-
css_hash: "sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl"
72-
css_rtl: "https://cdn.jsdelivr.net/npm/[email protected]beta2/dist/css/bootstrap.rtl.min.css"
73-
css_rtl_hash: "sha384-4dNpRvNX0c/TdYEbYup8qbjvjaMrgUPh+g4I03CnNtANuv+VAvPL6LqdwzZKV38G"
74-
js: "https://cdn.jsdelivr.net/npm/[email protected]beta2/dist/js/bootstrap.min.js"
75-
js_hash: "sha384-nsg8ua9HAw1y0W1btsyWgBklPnCUAFLuTMS2G72MMONqmOymq585AcH49TLBQObG"
76-
js_bundle: "https://cdn.jsdelivr.net/npm/[email protected]beta2/dist/js/bootstrap.bundle.min.js"
77-
js_bundle_hash: "sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0"
78-
popper: "https://cdn.jsdelivr.net/npm/@popperjs/[email protected].0/dist/umd/popper.min.js"
79-
popper_hash: "sha384-EOlc5FUOsy7obkrpNXqD9DtrephzQpK7DXijDIKexeJT0qfn4dZ7GDid8suWuQHq"
70+
css: "https://cdn.jsdelivr.net/npm/[email protected]beta3/dist/css/bootstrap.min.css"
71+
css_hash: "sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
72+
css_rtl: "https://cdn.jsdelivr.net/npm/[email protected]beta3/dist/css/bootstrap.rtl.min.css"
73+
css_rtl_hash: "sha384-trxYGD5BY4TyBTvU5H23FalSCYwpLA0vWEvXXGm5eytyztxb+97WzzY+IWDOSbav"
74+
js: "https://cdn.jsdelivr.net/npm/[email protected]beta3/dist/js/bootstrap.min.js"
75+
js_hash: "sha384-j0CNLUeiqtyaRmlzUHCPZ+Gy5fQu0dQ6eZ/xAww941Ai1SxSY+0EQqNXNE6DZiVc"
76+
js_bundle: "https://cdn.jsdelivr.net/npm/[email protected]beta3/dist/js/bootstrap.bundle.min.js"
77+
js_bundle_hash: "sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
78+
popper: "https://cdn.jsdelivr.net/npm/@popperjs/[email protected].1/dist/umd/popper.min.js"
79+
popper_hash: "sha384-SR1sx49pcuLnqZUnnPwx6FCym0wLsk5JZuNx2bPPENzswTNFaQU1RDvt3wT4gWFG"

dist/css/bootstrap-grid.css

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/bootstrap-grid.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)