diff --git a/.bundlewatch.config.json b/.bundlewatch.config.json index 049cf6d7da96..eecba088d307 100644 --- a/.bundlewatch.config.json +++ b/.bundlewatch.config.json @@ -18,11 +18,11 @@ }, { "path": "./dist/css/bootstrap.css", - "maxSize": "25.25 kB" + "maxSize": "25.5 kB" }, { "path": "./dist/css/bootstrap.min.css", - "maxSize": "23.25 kB" + "maxSize": "23.5 kB" }, { "path": "./dist/js/bootstrap.bundle.js", diff --git a/.eslintrc.json b/.eslintrc.json index 78963350af40..d61d2f9d14d2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -174,7 +174,6 @@ "no-underscore-dangle": "off", "no-unneeded-ternary": "error", "no-whitespace-before-property": "error", - "object-curly-newline": ["error", { "minProperties": 1 }], "object-curly-spacing": ["error", "always"], "object-property-newline": "error", "one-var": ["error", "never"], diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0aac36a6b1ae..c371f24beacd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: run: 'echo "gem: --no-document" > ~/.gemrc' - name: Set up Ruby cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: vendor/bundle key: ${{ runner.os }}-ruby-v${{ matrix.ruby }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }} @@ -41,7 +41,7 @@ jobs: ${{ runner.os }}-ruby-v${{ matrix.ruby }}- - name: Set up npm cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ~/.npm key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} diff --git a/Gemfile b/Gemfile index 8d3726c16dcd..5b8c4681a199 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' group :development, :test do - gem 'jekyll', '~> 4.0.1' + gem 'jekyll', '~> 4.1.0' gem 'jekyll-redirect-from', '~> 0.16.0' gem 'jekyll-sitemap', '~> 1.4.0' gem 'jekyll-toc', '~> 0.14.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1dc9fe50cec2..dea960375de7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,23 +10,23 @@ GEM http_parser.rb (~> 0.6.0) eventmachine (1.2.7) eventmachine (1.2.7-x64-mingw32) - ffi (1.12.2) - ffi (1.12.2-x64-mingw32) + ffi (1.13.0) + ffi (1.13.0-x64-mingw32) forwardable-extended (2.6.0) http_parser.rb (0.6.0) i18n (1.8.2) concurrent-ruby (~> 1.0) - jekyll (4.0.1) + jekyll (4.1.0) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) - i18n (>= 0.9.5, < 2) + i18n (~> 1.0) jekyll-sass-converter (~> 2.0) jekyll-watch (~> 2.0) kramdown (~> 2.1) kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) - mercenary (~> 0.3.3) + mercenary (~> 0.4.0) pathutil (~> 0.9) rouge (~> 3.0) safe_yaml (~> 1.0) @@ -50,7 +50,7 @@ GEM listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) + mercenary (0.4.0) mini_portile2 (2.4.0) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) @@ -63,11 +63,11 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.4) - rouge (3.18.0) + rouge (3.19.0) safe_yaml (1.0.5) - sassc (2.3.0) + sassc (2.4.0) ffi (~> 1.9) - sassc (2.3.0-x64-mingw32) + sassc (2.4.0-x64-mingw32) ffi (~> 1.9) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -79,7 +79,7 @@ PLATFORMS x64-mingw32 DEPENDENCIES - jekyll (~> 4.0.1) + jekyll (~> 4.1.0) jekyll-redirect-from (~> 0.16.0) jekyll-sitemap (~> 1.4.0) jekyll-toc (~> 0.14.0) diff --git a/build/babel-helpers.js b/build/babel-helpers.js deleted file mode 100644 index d444628f63e9..000000000000 --- a/build/babel-helpers.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -// These are the babel helpers we whitelist -const helpers = [ - 'createClass', - 'createSuper', - 'defineProperties', - 'defineProperty', - 'inheritsLoose', - 'objectSpread2' -] - -module.exports = helpers diff --git a/build/build-plugins.js b/build/build-plugins.js index 9e4f2e1c3291..00ae91d5dd60 100644 --- a/build/build-plugins.js +++ b/build/build-plugins.js @@ -9,19 +9,18 @@ 'use strict' -const path = require('path') -const rollup = require('rollup') -const babel = require('rollup-plugin-babel') -const banner = require('./banner.js') -const babelHelpers = require('./babel-helpers.js') +const path = require('path') +const rollup = require('rollup') +const { babel } = require('@rollup/plugin-babel') +const banner = require('./banner.js') -const TEST = process.env.NODE_ENV === 'test' +const TEST = process.env.NODE_ENV === 'test' const plugins = [ babel({ // Only transpile our source code exclude: 'node_modules/**', - // Include only required helpers - externalHelpersWhitelist: babelHelpers + // Inline the required helpers in each file + babelHelpers: 'inline' }) ] const bsPlugins = { diff --git a/build/rollup.config.js b/build/rollup.config.js index 2d43194fe9b8..95e412f0e7f7 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,21 +1,20 @@ 'use strict' -const path = require('path') -const babel = require('rollup-plugin-babel') +const path = require('path') +const { babel } = require('@rollup/plugin-babel') const resolve = require('@rollup/plugin-node-resolve') -const banner = require('./banner.js') -const babelHelpers = require('./babel-helpers.js') +const banner = require('./banner.js') -const BUNDLE = process.env.BUNDLE === 'true' +const BUNDLE = process.env.BUNDLE === 'true' -let fileDest = 'bootstrap.js' +let fileDest = 'bootstrap.js' const external = ['jquery', 'popper.js'] const plugins = [ babel({ - // Only transpile our source code + // Only transpile our source code exclude: 'node_modules/**', - // Include only required helpers - externalHelpersWhitelist: babelHelpers + // Include the helpers in the bundle, at most one copy of each + babelHelpers: 'bundled' }) ] const globals = { diff --git a/js/src/modal.js b/js/src/modal.js index 7338ffd376c5..f898d0c46536 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -265,6 +265,7 @@ class Modal { this._element.style.display = 'block' this._element.removeAttribute('aria-hidden') this._element.setAttribute('aria-modal', true) + this._element.setAttribute('role', 'dialog') if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { modalBody.scrollTop = 0 @@ -344,6 +345,7 @@ class Modal { this._element.style.display = 'none' this._element.setAttribute('aria-hidden', true) this._element.removeAttribute('aria-modal') + this._element.removeAttribute('role') this._isTransitioning = false this._showBackdrop(() => { $(document.body).removeClass(CLASS_NAME_OPEN) diff --git a/js/tests/integration/rollup.bundle.js b/js/tests/integration/rollup.bundle.js index f2183e757101..e554d8ce4710 100644 --- a/js/tests/integration/rollup.bundle.js +++ b/js/tests/integration/rollup.bundle.js @@ -2,7 +2,7 @@ const resolve = require('@rollup/plugin-node-resolve') const commonjs = require('@rollup/plugin-commonjs') -const babel = require('rollup-plugin-babel') +const { babel } = require('@rollup/plugin-babel') module.exports = { input: 'js/tests/integration/bundle.js', @@ -14,7 +14,8 @@ module.exports = { resolve(), commonjs(), babel({ - exclude: 'node_modules/**' + exclude: 'node_modules/**', + babelHelpers: 'bundled' }) ] } diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index fefd84fceb9b..5434987d8bfe 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -297,6 +297,23 @@ $(function () { .bootstrapModal('show') }) + QUnit.test('should add role="dialog" attribute when shown, remove it again when hidden', function (assert) { + assert.expect(3) + var done = assert.async() + + $('