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

Commit 80077f3

Browse files
authored
docs(faq): clarify the versioning strategy
- When do breaking changes appear - Relationship with Semver - Compatibility of modules Closes #15845
1 parent 32f38a3 commit 80077f3

File tree

1 file changed

+64
-24
lines changed

1 file changed

+64
-24
lines changed

docs/content/misc/faq.ngdoc

+64-24
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,30 @@ So it's definitely not a plugin or some other native browser extension.
2525
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 AngularJS.
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 AngularJS, 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 AngularJS 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
AngularJS.
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

@@ -99,8 +139,8 @@ Yes. See instructions in {@link downloading}.
99139
### 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,

0 commit comments

Comments
 (0)