Skip to content

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

Open
WickyNilliams wants to merge 4 commits intomasterfrom
feature/jquery-module-support
Open

update jQuery plugin to be compatible with ES/CommonJS modules#334
WickyNilliams wants to merge 4 commits intomasterfrom
feature/jquery-module-support

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