File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ Ember relied on jQuery in the past, and it still ships with it by default.
2+ However, in Ember 3.3 it is an optional dependency that you can opt out from.
3+
4+ To do so, install the [ ` @ember/optional-features ` ] ( https://github.com/emberjs/ember-optional-features ) addon
5+ and disable the ` jquery-integration ` flag:
6+
7+ ``` shell
8+ ember install @ember/optional-features
9+ ember feature:disable jquery-integration
10+ ```
11+
12+ This will remove jQuery from your ` vendor.js ` bundle and disable any use of jQuery in Ember itself.
13+ Now your app will be about 30KB lighter!
14+
15+ ## Caveats
16+
17+ Without jQuery, any code that still relies on it will break, especially any usage of
18+
19+ * [ ` this.$() ` ] ( https://www.emberjs.com/api/ember/release/classes/Component/methods/$?anchor=%24 ) in components
20+ * ` jQuery ` or ` $ ` directly as a global, through ` Ember.$() ` or by importing it (` import jQuery from jquery; ` )
21+ * global acceptance test helpers like ` find() ` or ` click() `
22+ * ` this.$() ` in component tests
23+
24+ Note that this also applies to all addons that your app uses, so make sure they support being used without jQuery.
Original file line number Diff line number Diff line change 230230 pages :
231231 - title : " Managing Dependencies"
232232 url : " managing-dependencies"
233+ - title : " Removing jQuery"
234+ url : " removing-jquery"
233235
234236- title : " Configuring Ember.js"
235237 url : ' configuring-ember'
You can’t perform that action at this time.
0 commit comments