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

Remove jQuery dependency #7

Open
jahed opened this issue Aug 9, 2018 · 1 comment
Open

Remove jQuery dependency #7

jahed opened this issue Aug 9, 2018 · 1 comment

Comments

@jahed
Copy link
Contributor

jahed commented Aug 9, 2018

jQuery is currently used for:

  • Event Emission
  • Requesting VAST via AJAX

This seems overkill considering how large jQuery is.

Event Emission

Event Emission can be reimplemented easily, or a smaller library can be used.

AJAX

We can switch over to the Fetch API for requesting VAST. We have multiple options:

  1. Use the Fetch API directly and assume it's on global scope. If an application supports an environment that doesn't have the Fetch API, they're expect to polyfill it on their end (ideally via dynamic imports or targeted bundles).
  2. Use a polyfill like isomorphic-fetch. This will increase the size of library and not all environment will need the polyfill.

I'd go with Option 1 as the Fetch API seems widely supported in most browsers. And IMO, supplying polyfills for certain environments is not the job of a library.

@mrwilson
Copy link
Contributor

mrwilson commented Aug 9, 2018

A quick search for event-emitter libraries gives NanoEvents - small and zero-dependencies, which looks to give the same functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants