Skip to content

Commit

Permalink
CSS: Include show, hide & toggle methods in the jQuery slim build
Browse files Browse the repository at this point in the history
The `show()`, `hide()` & `toggle()` methods were included in the 3.x jQuery
slim build. The jQuery master build accidentally started to exclude them as
they were only imported in the effects module and the new Rollup-based build
system follows the module dependency graph when excluding modules.

To resolve the issue, import the `css/showHide.js` file directly in the main
`jquery.js` file.

Closes gh-4704
Ref jquery/jquery-migrate#346
  • Loading branch information
mgol committed May 5, 2020
1 parent 3d62d57 commit 297d18d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions src/jquery.js
Expand Up @@ -16,6 +16,7 @@ import "./manipulation/_evalUrl.js";
import "./wrap.js";
import "./css.js";
import "./css/hiddenVisibleSelectors.js";
import "./css/showHide.js";
import "./serialize.js";
import "./ajax.js";
import "./ajax/xhr.js";
Expand Down
5 changes: 0 additions & 5 deletions test/unit/css.js
Expand Up @@ -487,9 +487,6 @@ QUnit.test( "css(Object) where values are Functions with incoming values", funct
jQuery( "#cssFunctionTest" ).remove();
} );

// .show(), .hide(), can be excluded from the build
if ( jQuery.fn.show && jQuery.fn.hide ) {

QUnit.test( "show()", function( assert ) {

assert.expect( 18 );
Expand Down Expand Up @@ -968,8 +965,6 @@ QUnit.test( "show/hide 3.0, inline hidden", function( assert ) {
} );
} );

}

QUnit[ QUnit.jQuerySelectors && jQuery.fn.toggle ? "test" : "skip" ]( "toggle()", function( assert ) {
assert.expect( 9 );
var div, oldHide,
Expand Down

0 comments on commit 297d18d

Please sign in to comment.