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 dependence on jQuery #781

Open
jacobq opened this issue Jan 8, 2020 · 0 comments
Open

Remove dependence on jQuery #781

jacobq opened this issue Jan 8, 2020 · 0 comments

Comments

@jacobq
Copy link
Collaborator

jacobq commented Jan 8, 2020

Is your feature request related to a problem? Please describe.
Since ember, materialize, and velocity do not require jQuery any more, it'd be nice to be able to drop it as a dependency to achieve a smaller payload & simpler codebase.

Describe the solution you'd like
It looks like jQuery is still used in quite a few places, but most have simple, native alternatives. I would like for those be refactored. For example this part of md-tabs.js can be rewritten as

import * as velocity from 'velocity-animate';
// ...
if (!animate) {
  const el = this.element.querySelector('.indicator');
  for (let [key, value] of Object.entries(cssParams)) {
    el.style[key] = value;
  }
} else {
  velocity(this.element.querySelector('.indicator1'), cssParams, {
    duration: 150
  });
  velocity(this.element.querySelector('.indicator2'), cssParams, {
    duration: 150,
    delay: 40
  });
}

Describe alternatives you've considered
The alternative to taking jQuery out is leaving it in, which is what we already have. I suppose an alternative to replacing it with native API calls would be to use another library, but I think that would be missing the point.

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

1 participant