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

Undocumented dependency on JQuery? #22

Open
davidmegginson opened this issue Sep 7, 2015 · 8 comments
Open

Undocumented dependency on JQuery? #22

davidmegginson opened this issue Sep 7, 2015 · 8 comments

Comments

@davidmegginson
Copy link
Contributor

Readme.md doesn't mention a JQuery dependency, but the library is failing when I don't have JQuery loaded.

@rufuspollock
Copy link
Contributor

@davidmegginson are you using this from browser or node? In node should not require jquery.

@davidmegginson
Copy link
Contributor Author

@rgrp I was using it in-browser, for a client-only app.

If that's the only JQuery dependency, then it might make sense to add a couple of extra lines of Javascript to do AJAX the old-fashioned way, and make the library standalone.

@rufuspollock
Copy link
Contributor

@davidmegginson that's definitely a thought :-) - only trouble is that can be a little bit painful (e.g. if you need to add auth headers etc).

What's definitely missing right now is a something in the README about needing jquery - if you have a suggestion there please open a pull request or we can add it at our end :-)

Thanks for flagging this!

@letmaik
Copy link

letmaik commented Oct 9, 2015

I don't think this library should depend on jquery. Maybe there are smaller libraries made just for that purpose (AJAX).

@loleg
Copy link
Contributor

loleg commented May 1, 2020

I agree with @letmaik - and in today's PR #34 proposed to use the lightweight needle-js library. Can we completely remove the need for jQuery, perhaps even abstract the Ajax call to allow the user to use whatever is already part of their stack?

@rufuspollock
Copy link
Contributor

@loleg yes we can completely remove and also happy for us to use what is in people's stack - if there is a clean way to do that.

@loleg
Copy link
Contributor

loleg commented May 5, 2020

On further thought, superagent is the only modern library with JSONP support (albeit undocumented), the reason I've been continuing to use jQuery in ckan-embed.

Would it potentially make sense to abstract away the HTTP request, so the library user can plug in whatever they want, with perhaps just a sensible default? If anyone with experience in the various options out there can weigh in here, please do.

@rufuspollock
Copy link
Contributor

@loleg happy for you to lead here and make a proposal - if superagent seems good to you happy to go for that.

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

No branches or pull requests

4 participants