Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 6a8c0f5

Browse files
committed
docs(faq): clarify the versioning strategy
- When do breaking changes appear - Relationship with Semver - Compatibility of modules Closes #15845
1 parent 584308f commit 6a8c0f5

File tree

1 file changed

+89
-49
lines changed

1 file changed

+89
-49
lines changed

docs/content/misc/faq.ngdoc

+89-49
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,33 @@ So it's definitely not a plugin or some other native browser extension.
2222

2323
### What is the AngularJS versioning strategy?
2424

25-
In Angular 1 we do not allow intentional breaking changes to appear in versions where only the "patch"
25+
In AngularJS we do not allow intentional breaking changes to appear in versions where only the "patch"
2626
number changes. For example between 1.3.12 and 1.3.13 there can be no breaking changes. We do allow
2727
breaking changes happen between "minor" number changes. For example between 1.3.15 and 1.4.0 there
28-
will be a number of breaking changes. We also allow breaking changes between beta releases of Angular.
28+
are a number of breaking changes. That means AngularJS does not follow
29+
[semantic versioning (semver)](http://semver.org/) where breaking changes are only
30+
allowed when the "major" version changes.
31+
32+
We also allow breaking changes between beta releases of AngularJS.
2933
For example between 1.4.0-beta.4 and 1.4.0-beta.5 there may be breaking changes. We try hard to minimize
3034
these kinds of change only to those where there is a strong use case such as a strongly requested feature
31-
improvement, a considerable simplification of the code or a measurable performance improvement.
32-
33-
When adding new code to branches of Angular, have a very stringent commit policy:
34-
35-
- Every commit must contain tests and documentation updates alongside the code changes and that all the
36-
tests must pass;
37-
- Commit messages must be written in a specific manner that allows us to parse them and extract the changes
38-
for release notes.
39-
40-
The Angular code base has a very large set of unit tests (over 4000) and end to end tests, which are pretty
41-
comprehensive. This means that a breaking change will require one or more tests to be changed to allow the
42-
tests to pass. So when a commit includes tests that are being removed or modified, this is a flag that the
43-
code might include a breaking change. When reviewing the commit we can then decide whether there really is
44-
a breaking change and if it is appropriate for the branch to which it is being merged. If so, then we
45-
require that the commit message contains an appropriate breaking change message.
35+
improvement, a considerable simplification of the code, a measurable performance improvement, or a better
36+
developer experience (especially with regard to upgrading to Angular).
4637

47-
Additionally, when a commit lands in our master repository it is synced to Google where we test it against
48-
over 2000 applications using the test suites of these applications. This allows us to catch regressions
49-
quickly before a release. We've had a pretty good experience with this setup. Only bugs that affect features
50-
not used at Google or without sufficient test coverage, have a chance of making it through.
51-
52-
Lastly, when we are making a release we generate updates to the changelog directly from the commits. This
38+
When we are making a release we generate updates to the changelog directly from the commits. This
5339
generated update contains a highlighted section that contains all the breaking changes that have been
5440
extracted from the commits. We can quickly see in the new changelog exactly what commits contain breaking
5541
changes and so can application developers when they are deciding whether to update to a new version of
5642
Angular.
5743

44+
Features with non-breaking changes can also appear in the "patch" version, e.g. in version 1.6.3 there might
45+
be a feature that is not available in 1.6.2.
46+
47+
Finally, deprecation of features might also appear in "minor" version updates. That means the features
48+
will still work in this version, but sometimes must be activated specifically.
49+
5850
#### When are deprecated features removed from the library?
51+
5952
Most of the time we remove a deprecated feature in a next minor version bump. For example, the
6053
`preAssignBindingsEnabled` `$compileProvider` method was defined in AngularJS `1.5.10`, deprecated in `1.6` and
6154
will be removed in `1.7`.
@@ -65,6 +58,53 @@ is also deprecated but we only remove the feature once it's removed from jQuery
6558
jqLite and jQuery. One such example is the `bind` method, deprecated in favor of `on` but unlikely to be removed
6659
from jqLite any time soon.
6760

61+
#### What is the version compatibility between AngularJS main and optional modules?
62+
63+
AngularJS code is separated into a main module ("angular"), and a few different optional modules
64+
("angular-animate", "angular-route" etc) that are dependant on the main module.
65+
When a new AngularJS version is released, all modules are updated to the new version.
66+
This means that the main module and the optional modules must always have the exact same version,
67+
down to the patch number, otherwise your application might break.
68+
69+
Therefore you must always explicitly lock down your dependencies, for example in the package.json,
70+
the following means that "angular" and "angular-animate" are always updated to the same version:
71+
72+
```
73+
{
74+
"angular": "~1.6.0",
75+
"angular-animate": "~1.6.0"
76+
}
77+
```
78+
79+
If you define exact versions, make sure core and optional modules are the same:
80+
81+
```
82+
{
83+
"angular": "1.6.3",
84+
"angular-animate": "1.6.3"
85+
}
86+
```
87+
88+
89+
#### How does AngularJS ensure code quality and guard against regressions?
90+
91+
When adding new code to AngularJS, we have a very stringent commit policy:
92+
93+
- Every commit must pass all existing tests, contain tests for code changes, and update the documentation
94+
- Commit messages must be written in a specific manner that allows us to parse them and extract the changes
95+
for release notes ([see the contributing guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md))
96+
97+
The AngularJS code base has a very large set of unit tests and end-to-end tests. This means that a breaking change will require one or more tests to be changed to allow the
98+
tests to pass. So when a commit includes tests that are being removed or modified, this is a flag that the
99+
code might include a breaking change. When reviewing the commit we can then decide whether there really is
100+
a breaking change and if it is appropriate for the branch to which it is being merged. If so, then we
101+
require that the commit message contains an appropriate breaking change message.
102+
103+
Additionally, commits are periodically synced to Google where we test it against applications using
104+
the test suites of these applications. This allows us to catch regressions
105+
quickly before a release. We've had a pretty good experience with this setup. Only bugs that affect features
106+
not used at Google or without sufficient test coverage, have a chance of making it through.
107+
68108

69109
### Is AngularJS a templating system?
70110

@@ -96,11 +136,11 @@ Yes. See instructions in {@link downloading}.
96136

97137

98138

99-
### What browsers does Angular work with?
139+
### What browsers does AngularJS work with?
100140

101141
We run our extensive test suite against the following browsers: the latest versions of Chrome,
102-
Firefox, Safari, and Safari for iOs, as well as Internet Explorer versions 9-11. See {@link guide/ie
103-
Internet Explorer Compatibility} for more details on supporting legacy IE browsers.
142+
Firefox, Safari, and Safari for iOS, as well as Internet Explorer versions 9-11. See
143+
{@link guide/ie Internet Explorer Compatibility} for more details on supporting legacy IE browsers.
104144

105145
If a browser is untested, it doesn't mean it won't work; for example, older Android (2.3.x)
106146
is supported in the sense that we avoid the dot notation for reserved words as property names,
@@ -109,7 +149,7 @@ a large part of their codebase with a browser we test, such as Opera > version 1
109149
(uses the Blink engine), or the various Firefox derivatives.
110150

111151

112-
### What's Angular's performance like?
152+
### What's AngularJS's performance like?
113153

114154
The startup time heavily depends on your network connection, state of the cache, browser used and
115155
available hardware, but typically we measure bootstrap time in tens or hundreds of milliseconds.
@@ -124,40 +164,40 @@ illustration, we typically build snappy apps with hundreds or thousands of activ
124164
The size of the file is ~50KB compressed and minified.
125165

126166

127-
### Can I use the open-source Closure Library with Angular?
167+
### Can I use the open-source Closure Library with AngularJS?
128168

129169
Yes, you can use widgets from the [Closure Library](https://developers.google.com/closure/library/)
130-
in Angular.
170+
in AngularJS.
131171

132172

133-
### Does Angular use the jQuery library?
173+
### Does AngularJS use the jQuery library?
134174

135-
Yes, Angular can use [jQuery](http://jquery.com/) if it's present in your app when the
136-
application is being bootstrapped. If jQuery is not present in your script path, Angular falls back
175+
Yes, AngularJS can use [jQuery](http://jquery.com/) if it's present in your app when the
176+
application is being bootstrapped. If jQuery is not present in your script path, AngularJS falls back
137177
to its own implementation of the subset of jQuery that we call {@link angular.element jQLite}.
138178

139-
Angular 1.3 only supports jQuery 2.1 or above. jQuery 1.7 and newer might work correctly with Angular
179+
AngularJS 1.3 only supports jQuery 2.1 or above. jQuery 1.7 and newer might work correctly with AngularJS
140180
but we don't guarantee that.
141181

142182

143-
### What is testability like in Angular?
183+
### What is testability like in AngularJS?
144184

145185
Very testable and designed this way from the ground up. It has an integrated dependency injection
146186
framework, provides mocks for many heavy dependencies (server-side communication). See
147187
{@link ngMock} for details.
148188

149189

150-
### How can I learn more about Angular?
190+
### How can I learn more about AngularJS?
151191

152192
Watch the July 17, 2012 talk
153193
"[AngularJS Intro + Dependency Injection](http://www.youtube.com/watch?v=1CpiB3Wk25U)".
154194

155195

156-
### How is Angular licensed?
196+
### How is AngularJS licensed?
157197

158198
The [MIT License](https://github.com/angular/angular.js/blob/master/LICENSE).
159199

160-
### Can I download and use the Angular logo artwork?
200+
### Can I download and use the AngularJS logo artwork?
161201

162202
Yes! You can find design files in our github repository, under "[angular.js/images/logo](https://github.com/angular/angular.js/tree/master/images/logo)"
163203
The logo design is licensed under a "[Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/)". If you have some other use in mind, contact us.
@@ -178,7 +218,7 @@ For a smaller order, or for other countries, we suggest downloading the logo art
178218

179219
## Common Pitfalls
180220

181-
The Angular support channel (#angularjs on Freenode) sees a number of recurring pitfalls that new users of Angular fall into.
221+
The AngularJS support channel (#angularjs on Freenode) sees a number of recurring pitfalls that new users of AngularJS fall into.
182222
This document aims to point them out before you discover them the hard way.
183223

184224
### DOM Manipulation
@@ -189,13 +229,13 @@ Use built-in directives, or write your own where necessary, to do your DOM manip
189229
See below about duplicating functionality.
190230

191231
If you're struggling to break the habit, consider removing jQuery from your app.
192-
Really. Angular has the $http service and powerful directives that make it almost always unnecessary.
193-
Angular's bundled jQLite has a handful of the features most commonly used in writing Angular directives, especially binding to events.
232+
Really. AngularJS has the $http service and powerful directives that make it almost always unnecessary.
233+
AngularJS's bundled jQLite has a handful of the features most commonly used in writing AngularJS directives, especially binding to events.
194234

195235
### Trying to duplicate functionality that already exists
196236

197237
There's a good chance that your app isn't the first to require certain functionality.
198-
There are a few pieces of Angular that are particularly likely to be reimplemented out of old habits.
238+
There are a few pieces of AngularJS that are particularly likely to be reimplemented out of old habits.
199239

200240
**ng-repeat**
201241

@@ -208,7 +248,7 @@ Store the data from the server in an array on your `$scope`, and bind it to the
208248
**ng-show**
209249

210250
`ng-show` gets this frequently too.
211-
Conditionally showing and hiding things using jQuery is a common pattern in other apps, but Angular has a better way.
251+
Conditionally showing and hiding things using jQuery is a common pattern in other apps, but AngularJS has a better way.
212252
`ng-show` (and `ng-hide`) conditionally show and hide elements based on boolean expressions.
213253
Describe the conditions for showing and hiding an element in terms of `$scope` variables:
214254

@@ -221,7 +261,7 @@ Note especially the powerful `ng-switch` that should be used instead of several
221261

222262
`ng-class` is the last of the big three.
223263
Conditionally applying classes to elements is another thing commonly done manually using jQuery.
224-
Angular, of course, has a better way.
264+
AngularJS, of course, has a better way.
225265
You can give `ng-class` a whitespace-separated set of class names, and then it's identical to ordinary `class`.
226266
That's not very exciting, so there's a second syntax:
227267

@@ -235,22 +275,22 @@ Note also the handy `ng-class-even` and `ng-class-odd`, and the related though s
235275

236276
### `$watch` and `$apply`
237277

238-
Angular's two-way data binding is the root of all awesome in Angular.
278+
AngularJS's two-way data binding is the root of all awesome in AngularJS.
239279
However, it's not magic, and there are some situations where you need to give it a nudge in the right direction.
240280

241-
When you bind a value to an element in Angular using `ng-model`, `ng-repeat`, etc., Angular creates a `$watch` on that value.
281+
When you bind a value to an element in AngularJS using `ng-model`, `ng-repeat`, etc., AngularJS creates a `$watch` on that value.
242282
Then whenever a value on a scope changes, all `$watch`es observing that element are executed, and everything updates.
243283

244284
Sometimes, usually when you're writing a custom directive, you will have to define your own `$watch` on a scope value to make the directive react to changes.
245285

246286
On the flip side, sometimes you change a scope value in some code, but the app doesn't react to it.
247-
Angular checks for scope variable changes after pieces of your code have finished running; for example, when `ng-click` calls a function on your scope, Angular will check for changes and react.
248-
However, some code is outside of Angular and you'll have to call `scope.$apply()` yourself to trigger the update.
287+
AngularJS checks for scope variable changes after pieces of your code have finished running; for example, when `ng-click` calls a function on your scope, AngularJS will check for changes and react.
288+
However, some code is outside of AngularJS and you'll have to call `scope.$apply()` yourself to trigger the update.
249289
This is most commonly seen in event handlers in custom directives.
250290

251291
### Combining `ng-repeat` with other directives
252292

253-
`ng-repeat` is extremely useful, one of the most powerful directives in Angular.
293+
`ng-repeat` is extremely useful, one of the most powerful directives in AngularJS.
254294
However the transformation it applies to the DOM is substantial.
255295
Therefore applying other directives (such as `ng-show`, `ng-controller` and others) to the same element as `ng-repeat` generally leads to problems.
256296

@@ -259,7 +299,7 @@ If you want to apply a directive to each inner piece of the repeat, put it on a
259299

260300
### `$rootScope` exists, but it can be used for evil
261301

262-
Scopes in Angular form a hierarchy, prototypically inheriting from a root scope at the top of the tree.
302+
Scopes in AngularJS form a hierarchy, prototypically inheriting from a root scope at the top of the tree.
263303
Usually this can be ignored, since most views have a controller, and therefore a scope, of their own.
264304

265305
Occasionally there are pieces of data that you want to make global to the whole app.

0 commit comments

Comments
 (0)