Skip to content

Remove dependence on jQuery #781

@jacobq

Description

@jacobq

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions