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

Minor bugfix and cleanup #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sjoller
Copy link

@sjoller sjoller commented Oct 16, 2020

The `define(...´ part, in the very beginning, was giving me an error, so I fixed it up, to make it work with my current version of jQuery (3.2.1).

The `define(...´ part, in the very beginning, was giving me an error, so I fixed it up, to make it works with my current version of jQuery (3.2.1).
@gardiner
Copy link
Owner

Hi Mads, thanks for your contribution, the effort is much appreciated.

The "define" Part in the beginning is essential for allowing to use the source code as a require.js/AMD Module, so it can't be easily left out without breaking compatibility.

Your changeset encompasses the complete module, almost every other line is changed. This makes it very hard to see what actually has changed and why.

Changing all var statements to let (for what reason?) and switching to jQuery 3.x reduces browser compatibility drastically.

For these reasons I am reluctant to merge your pull request at the moment. However, I am definitely interested in incorporating your work. Do you have an idea how to address these issues?

I think we might:

  • try to make the code compatible for use with and without require.js (e.g. by incorporating a dynamic module header like jQuery or other libraries) or
  • create two branches of the library, a "legacy", highly compatible branch and a clean, "modern browsers" branch

If this seems too much work, I totally understand. In that case I could at least mention your "cleaned" fork in the README.md for interested users.

Thanks for your efforts, enjoy the upcoming weekend,
Ole.

@sjoller
Copy link
Author

sjoller commented Oct 19, 2020

Hi Ole,

I didn't realize it was a require.js thing - I really have no knowledge of require.js, but I guess this pull request makes little sense, then. Feel free to dismiss it.

Making a unified approach to using your plugin both with and without require.js, sounds interesting and probably better than having parallel branches, in my opinion.

I came across this SO answer, that seems promising. I did a quick test of the SO code snippet with your plugin, and it appears to work as expected (without require.js). I currently have no way of testing with require.js, so I can only offer to test the plugin in a standalone context.

On a different (and a bit off-topic) note, would you consider including minified versions of the js and css files?

Anyway - let me know if I can help with anything.

Regards
Mads

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.

2 participants