Skip to content

Commit 6c9e5dd

Browse files
committed
move intro and jquery integration to configuring ember section
1 parent e547b01 commit 6c9e5dd

File tree

8 files changed

+181
-90
lines changed

8 files changed

+181
-90
lines changed

guides/v3.3.0/optional-features/introduction.md renamed to guides/v3.3.0/configuring-ember/optional-features.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
Because major releases of Ember are not supposed to make breaking changes without prior deprecation, the project has been extremely conservative about changing behaviors that don't have a clear deprecation path. As a result, we've had several quirks of the framework linger into the 3.x series.
1+
One of the ways that Ember releases guarantee stability is by following [Semantic Versioning](https://semver.org/) (SemVer).
2+
For the Ember project this means that any feature that is to be removed must first be deprecated,
3+
and only removed when a major version is released.
4+
It also means that new features are introduced in a backwards compatible way.
25

36
To give the project a path forward when a breaking change is mandatory, we've released the [`@ember/optional-features`](https://github.com/emberjs/ember-optional-features) addon.
47

@@ -37,10 +40,9 @@ Available features:
3740
jquery-integration (Default: true)
3841
Adds jQuery to the Ember application.
3942
More information: https://github.com/emberjs/rfcs/pull/294
40-
4143
```
4244

43-
## Enabling or disabling a feature
45+
## Features
4446

4547
Once you see a feature that you would like to toggle for your project you can run one of two commands, `ember feature:enable <feature>` and `ember feature:disable <feature>`.
4648

@@ -53,3 +55,29 @@ Disabled template-only-glimmer-components. Be sure to commit config/optional-fea
5355

5456
As we can see from the warning, `@ember/optional-features` has created a file in `config/optional-features.json` to store the configuration for your project.
5557
We commit it to our repository and we are off to the races!
58+
59+
### jquery-integration
60+
61+
The Ember framework comes by default with jQuery integration.
62+
It is used for event handling, and to provide some APIs like `this.$()` in components.
63+
64+
With the release of ember-source v3.0.0, an optional feature flag was introduced that allows users to opt out of jQuery.
65+
To enable it, run the following command after setting up `@ember/optional-features`:
66+
67+
```shell
68+
ember feature:disable jquery-integration
69+
```
70+
71+
This will remove jQuery from your `vendor.js` bundle and disable any use of jQuery in Ember itself.
72+
Now your app will be about 30KB lighter!
73+
74+
#### Caveats
75+
76+
Without jQuery, any code that still relies on it will break, especially the following usages:
77+
78+
- [`this.$()`](https://www.emberjs.com/api/ember/release/classes/Component/methods/$?anchor=%24) in components
79+
- `jQuery` or `$` directly as a global, through `Ember.$()` or by importing it (`import jQuery from jquery;`)
80+
- global acceptance test helpers like `find()` or `click()`
81+
- `this.$()` in component tests
82+
83+
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/optional-features/removing-jquery.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

guides/v3.3.0/pages.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
- title: "Guides and Tutorials"
2-
url: 'index'
2+
url: "index"
33
skip_toc: true
44
pages:
55
- title: "Ember.js Guides"
66
url: ""
77

88
- title: "Getting Started"
9-
url: 'getting-started'
9+
url: "getting-started"
1010
pages:
1111
- title: "Quick Start"
1212
url: "quick-start"
@@ -18,12 +18,12 @@
1818
url: "js-primer"
1919

2020
- title: "Tutorial"
21-
url: 'tutorial'
21+
url: "tutorial"
2222
pages:
2323
- title: "Creating Your App"
2424
url: "ember-cli"
2525
- title: "Planning Your App"
26-
url: 'acceptance-test'
26+
url: "acceptance-test"
2727
- title: "Routes and Templates"
2828
url: "routes-and-templates"
2929
- title: "The Model Hook"
@@ -46,7 +46,7 @@
4646
url: "deploying"
4747

4848
- title: "The Object Model"
49-
url: 'object-model'
49+
url: "object-model"
5050
pages:
5151
- title: "Objects in Ember"
5252
url: "index"
@@ -63,10 +63,10 @@
6363
- title: "Bindings"
6464
url: "bindings"
6565
- title: "Enumerables"
66-
url: 'enumerables'
66+
url: "enumerables"
6767

6868
- title: "Routing"
69-
url: 'routing'
69+
url: "routing"
7070
pages:
7171
- title: "Introduction"
7272
url: "index"
@@ -88,7 +88,7 @@
8888
url: "asynchronous-routing"
8989

9090
- title: "Templates"
91-
url: 'templates'
91+
url: "templates"
9292
pages:
9393
- title: "Handlebars Basics"
9494
url: "handlebars-basics"
@@ -114,7 +114,7 @@
114114
url: "writing-helpers"
115115

116116
- title: "Components"
117-
url: 'components'
117+
url: "components"
118118
pages:
119119
- title: "Defining a Component"
120120
url: "defining-a-component"
@@ -134,13 +134,13 @@
134134
url: "triggering-changes-with-actions"
135135

136136
- title: "Controllers"
137-
url: 'controllers'
137+
url: "controllers"
138138
pages:
139139
- title: "Introduction"
140140
url: "index"
141141

142142
- title: "Models"
143-
url: 'models'
143+
url: "models"
144144
pages:
145145
- title: "Introduction"
146146
url: "index"
@@ -162,7 +162,7 @@
162162
url: "customizing-serializers"
163163

164164
- title: "Application Concerns"
165-
url: 'applications'
165+
url: "applications"
166166
pages:
167167
- title: "Applications and Instances"
168168
url: "applications-and-instances"
@@ -176,7 +176,7 @@
176176
url: "run-loop"
177177

178178
- title: "Testing"
179-
url: 'testing'
179+
url: "testing"
180180
pages:
181181
- title: "Introduction"
182182
url: "index"
@@ -232,7 +232,7 @@
232232
url: "managing-dependencies"
233233

234234
- title: "Configuring Ember.js"
235-
url: 'configuring-ember'
235+
url: "configuring-ember"
236236
pages:
237237
- title: "Configuring Your App"
238238
url: "configuring-your-app"
@@ -248,19 +248,15 @@
248248
url: "embedding-applications"
249249
- title: "Feature Flags"
250250
url: "feature-flags"
251+
- title: "Optional Features"
252+
url: "optional-features"
251253
- title: "Build targets"
252254
url: "build-targets"
253255
- title: "Debugging"
254256
url: "debugging"
255257

256-
- title: "Optional Features"
257-
url: "optional-features"
258-
pages:
259-
- title: "Removing jQuery"
260-
url: "removing-jquery"
261-
262258
- title: "Contributing to Ember.js"
263-
url: 'contributing'
259+
url: "contributing"
264260
pages:
265261
- title: "Adding New Features"
266262
url: "adding-new-features"

guides/v3.4.0/optional-features/introduction.md renamed to guides/v3.4.0/configuring-ember/optional-features.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
Because major releases of Ember are not supposed to make breaking changes without prior deprecation, the project has been extremely conservative about changing behaviors that don't have a clear deprecation path. As a result, we've had several quirks of the framework linger into the 3.x series.
1+
One of the ways that Ember releases guarantee stability is by following [Semantic Versioning](https://semver.org/) (SemVer).
2+
For the Ember project this means that any feature that is to be removed must first be deprecated,
3+
and only removed when a major version is released.
4+
It also means that new features are introduced in a backwards compatible way.
25

36
To give the project a path forward when a breaking change is mandatory, we've released the [`@ember/optional-features`](https://github.com/emberjs/ember-optional-features) addon.
47

@@ -37,10 +40,9 @@ Available features:
3740
jquery-integration (Default: true)
3841
Adds jQuery to the Ember application.
3942
More information: https://github.com/emberjs/rfcs/pull/294
40-
4143
```
4244

43-
## Enabling or disabling a feature
45+
## Features
4446

4547
Once you see a feature that you would like to toggle for your project you can run one of two commands, `ember feature:enable <feature>` and `ember feature:disable <feature>`.
4648

@@ -53,3 +55,29 @@ Disabled template-only-glimmer-components. Be sure to commit config/optional-fea
5355

5456
As we can see from the warning, `@ember/optional-features` has created a file in `config/optional-features.json` to store the configuration for your project.
5557
We commit it to our repository and we are off to the races!
58+
59+
### jquery-integration
60+
61+
The Ember framework comes by default with jQuery integration.
62+
It is used for event handling, and to provide some APIs like `this.$()` in components.
63+
64+
With the release of ember-source v3.0.0, an optional feature flag was introduced that allows users to opt out of jQuery.
65+
To enable it, run the following command after setting up `@ember/optional-features`:
66+
67+
```shell
68+
ember feature:disable jquery-integration
69+
```
70+
71+
This will remove jQuery from your `vendor.js` bundle and disable any use of jQuery in Ember itself.
72+
Now your app will be about 30KB lighter!
73+
74+
#### Caveats
75+
76+
Without jQuery, any code that still relies on it will break, especially the following usages:
77+
78+
- [`this.$()`](https://www.emberjs.com/api/ember/release/classes/Component/methods/$?anchor=%24) in components
79+
- `jQuery` or `$` directly as a global, through `Ember.$()` or by importing it (`import jQuery from jquery;`)
80+
- global acceptance test helpers like `find()` or `click()`
81+
- `this.$()` in component tests
82+
83+
Note that this also applies to all addons that your app uses, so make sure they support being used without jQuery.

guides/v3.4.0/optional-features/removing-jquery.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)