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

Core: Support the jQuery slim build #346

Merged
merged 1 commit into from May 4, 2020
Merged

Conversation

mgol
Copy link
Member

@mgol mgol commented May 3, 2020

While it'd be hard for Migrate to support all the possible jQuery builds,
the slim build is special as it's officially maintained by the jQuery team,
published to npm & uploaded to CDNs.

This commit adds support for the jQuery slim build in jQuery 3.0.0 & newer.
The slim build is now tested next to the regular one.

Fixes #345

While it'd be hard for Migrate to support all the possible jQuery builds,
the slim build is special as it's officially maintained by the jQuery team,
published to npm & uploaded to CDNs.

This commit adds support for the jQuery slim build in jQuery 3.0.0 & newer.
The slim build is now tested next to the regular one.

Fixes jquery#345
@mgol mgol requested a review from dmethvin May 3, 2020 22:24
@mgol
Copy link
Member Author

mgol commented May 3, 2020

Note that this currently doesn't pass slim builds with jQuery master because apparently the .show() & .hide() methods are erroneously excluded from it - because they were just imported in the effects module and the new Rollup-based build system follows the module dependency graph when excluding modules. I'll submit an issue to jQuery; this PR helped me found a bug there!

This issue shouldn't block us from landing this PR, though - slim tests are isolated so it's easy to see the regular ones worked. Also, jQuery 4.x is not out yet and all tests pass with both full & slim builds for all tested jQuery 3.x builds.

@mgol mgol added this to the 3.3.0 milestone May 3, 2020
Copy link
Member

@dmethvin dmethvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems pretty straightforward. I wonder how commonly the slim build is used?

@mgol
Copy link
Member Author

mgol commented May 4, 2020

@dmethvin It's hard to tell, especially that 3.x itself is still way less popular than 1.x/2.x. But I've seen enough people trying it in various places on GitHub, including it in bug reports, etc. that I think it may be more popular than we'd think! Many projects already include a Promise polyfill & they have their own AJAX library, the slim build makes a lot of sense then.

@mgol mgol changed the title Core: Support jQuery slim build Core: Support the jQuery slim build May 4, 2020
@mgol mgol merged commit ea0fc04 into jquery:master May 4, 2020
@mgol mgol deleted the jquery-slim branch May 4, 2020 08:22
mgol added a commit to jquery/jquery that referenced this pull request May 5, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the jQuery slim build
2 participants