ember-cli-page-object icon indicating copy to clipboard operation
ember-cli-page-object copied to clipboard

[Feature Request] Remove jQuery dependency

Open leizhao4 opened this issue 8 years ago • 5 comments

Related to #256 but in a broader sense. Since Ember could make jQuery optional, why not we use all vanilla JavaScript instead of relying on jQuery?

leizhao4 avatar Mar 22 '17 14:03 leizhao4

@leizhao4 this would be great! I think it could be an objective for the 2.0

I think right now the main dependency with jQuery are the custom jQuery selectors (:contains, etc.). We need to come up with a migration plan and start deprecating features that relay on jQuery.

san650 avatar Mar 27 '17 03:03 san650

@san650 rather than deprecating those features, it woud be great to have an optin way of using them if you install jQuery. Thoughts?

juanazam avatar Mar 27 '17 15:03 juanazam

We could start reworking the internals to replace jQuery on places where it makes sense first. Like using native events for triggerable and querySelector and querySelectorAll.

san650 avatar Mar 30 '17 22:03 san650

Would it be possible to configure jQuery as a “dev” dependency that’s only used in testing? That fulfills the requirement that we’re not shipping jQuery to production while still be able to use jQuery in tests.

ming-codes avatar Oct 16 '17 06:10 ming-codes

@ming-codes when you enable jQuery then Ember will immediately setup Ember.$. It's also possible to get conflicts with jQuery plugins if they occasionally remained in your app. Then when you disable jQuery for prod mode it would be impropely(I believe so) tested app.

If you are interested in reliable jQuery-less solution I would suggest to test #325. Here I've tried to properly isolate jQuery without a side effects.

ro0gr avatar Oct 16 '17 08:10 ro0gr