Skip to content

Commit ca9af9e

Browse files
simonihmiglocks
authored andcommitted
Add "Remove jQuery" guide
1 parent 832ca86 commit ca9af9e

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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.

guides/v3.3.0/pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@
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'

0 commit comments

Comments
 (0)