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

update jQuery plugin to be compatible with ES/CommonJS modules #334

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

WickyNilliams
Copy link
Owner

@WickyNilliams WickyNilliams commented Sep 11, 2019

After this change, the following should be possible:

import $ from "jquery";
import Headroom from "headroom.js"
import registerJQueryHeadroom from "headroom.js/dist/jQuery.headroom.js";

registerJQueryHeadroom($, Headroom);

$("header").headroom();

@WickyNilliams WickyNilliams force-pushed the feature/jquery-module-support branch from 37650e7 to 3b6decd Compare September 16, 2019 15:35
@WickyNilliams
Copy link
Owner Author

Added a tests for jquery, and refactored the test suite so we can run the exact same set of tests for vanilla and jquery solutions.

@WickyNilliams
Copy link
Owner Author

WickyNilliams commented Sep 16, 2019

I'm considering bundling Headroom with the jquery plugin itself, so the above code sample would be reduced to a much less boilerplate-y:

import $ from "jquery";
import registerJQueryHeadroom from "headroom.js/dist/jQuery.headroom.js";

registerJQueryHeadroom($);
$("header").headroom();

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.

1 participant