填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫Home

Angular 的版本與發佈

Angular versioning and releases

我們知道你希望 Angular 框架具有穩定性(stability)。穩定性可以確保元件與函式庫、課程、工具和現有實踐不會突然被廢棄。穩定性是讓基於 Angular 的生態系統變得繁榮的基石。

We recognize that you need stability from the Angular framework. Stability ensures that reusable components and libraries, tutorials, tools, and learned practices don't become obsolete unexpectedly. Stability is essential for the ecosystem around Angular to thrive.

我們也和你一樣希望 Angular 能持續演進。我們會努力確保這些你用於建構應用的基礎能得到持續的改進,並讓你能及時同步到 Web 生態系統的其它部分的最新進展,使用者需求也是一樣。

We also share with you the desire for Angular to keep evolving. We strive to ensure that the foundation on top of which you are building is continuously improving and enabling you to stay up-to-date with the rest of the web ecosystem and your user needs.

本文件包含一些我們所遵循的實踐,它讓我們能為你提供一個前沿的應用開發平臺,同時兼顧穩定性。我們會努力確保將來的變化總是以一種可預期的方式引入。我們希望每個 Angular 使用者都明白我們將在何時新增以及如何新增新特性,並且為那些將要移除的、準備廢棄的特性提前做好準備。

This document contains the practices that we follow to provide you with a leading-edge app development platform, balanced with stability. We strive to ensure that future changes are always introduced in a predictable way. We want everyone who depends on Angular to know when and how new features are added, and to be well-prepared when obsolete ones are removed.

本文件中提及的這些實踐適用於 Angular 2.0 及以後的版本。如果你正在使用 AngularJS,請參閱從 AngularJS 升級AngularJS專指 Angular 所有的 v1.x 版本。

The practices described in this document apply to Angular 2.0 and later. If you are currently using AngularJS, see Upgrading from AngularJS. AngularJS is the name for all v1.x versions of Angular.

Angular 的版本

Angular versioning

Angular 的版本號表明本次發佈中所引入的變更級別。它使用語義化版本號來幫助你理解升級到新版本時的潛在影響。

Angular version numbers indicate the level of changes that are introduced by the release. This use of semantic versioning helps you understand the potential impact of updating to a new version.

Angular 的版本號包括三個部分:major.minor.patch。比如,版本 7.2.11 表示主版本號是 7,小版本號是 2,補丁版本號是 11。

Angular version numbers have three parts: major.minor.patch. For example, version 7.2.11 indicates major version 7, minor version 2, and patch level 11.

版本號是根據本次發佈中包含的變更的級別進行遞增的。

The version number is incremented based on the level of change included in the release.

  • 主版本包含重要的新特性,其中的部分特性在升級時會需要由開發人員提供少量的協助才能完成。當升級到新的主版本時,你可能需要執行升級指令碼、重構程式碼、執行其它測試以及學習新的 API。

    Major releases contain significant new features, some but minimal developer assistance is expected during the update. When updating to a new major release, you may need to run update scripts, refactor code, run additional tests, and learn new APIs.

  • 小版本包含新的小型特性。小版本是完全向後相容的,在升級期間,不需要開發人員提供協助,但是你可以(可選的)修改你的應用和函式庫,來使用本次發佈中新增的 API、特性和能力。我們會擴充套件函式庫的對等依賴(peer dependency)中的小版本號範圍來更新函式庫同級,但並不需要你的專案也更新那些依賴。

    Minor releases contain new smaller features. Minor releases are fully backward-compatible; no developer assistance is expected during update, but you can optionally modify your apps and libraries to begin using new APIs, features, and capabilities that were added in the release. We update peer dependencies in minor versions by expanding the supported versions, but we do not require projects to update these dependencies.

  • 補丁版本是風險最低的、修 BUG 的版本。在升級期間完全不需要開發人員的協助。

    Patch releases are low risk, bug fix releases. No developer assistance is expected during update.

注意:從 Angular 版本 7 開始,Angular Core 和 CLI 的主要版本已對齊。這意味著在開發 Angular 應用程式時使用的 @angular/core 和 CLI 的版本必須相同。

Note: As of Angular version 7, the major versions of Angular core and the CLI are aligned. This means that in order to use the CLI as you develop an Angular app, the version of @angular/core and the CLI need to be the same.

所支援的升級路徑

Supported update paths

為了和上面所講的版本方案一致,我們承諾支援如下升級路徑:

In alignment with the versioning scheme described above, we commit to support the following update paths:

  • 如果你在同一個主版本內升級,那麼你可以跳過任何中間版本,直接升級到目標版本。比如,你可以直接從 7.0.0 升級到 7.2.11。

    If you are updating within the same major version, then you can skip any intermediate versions and update directly to the targeted version. For example, you can update directly from 7.0.0 to 7.2.11.

  • 如果你要從一個主版本升級到另一個主版本,那麼我們建議你不要跳過主版本。要遵循本升級指南,依次升級到下一個主版本,在每一個步驟做完後都測試並驗證一下。比如,如果你要從 6.x.x 升級到 8.x.x,我們建議你先升級到 7.x.x 中的最新版。在成功升級到 7.x.x 後,你就可以升級到 8.x.x 了。

    If you are updating from one major version to another, then we recommend that you don't skip major versions. Follow the instructions to incrementally update to the next major version, testing and validating at each step. For example, if you want to update from version 6.x.x to version 8.x.x, we recommend that you update to the latest 7.x.x release first. After successfully updating to 7.x.x, you can then update to 8.x.x.

參閱保持更新以瞭解把 Angular 專案升級到最新版本的更多資訊。

See Keeping Up-to-Date for more information about updating your Angular projects to the most recent version.

預覽發佈

Preview releases

我們還會透過提供 Next 版和 RC(候選發佈)版來讓你預覽每個即將到來的大版本和小版本。

We let you preview what's coming by providing "Next" and Release Candidates (rc) pre-releases for each major and minor release:

  • Next 版:這是正在活躍開發和測試中的發佈。Next 版的發佈標籤帶有 -next 字尾,比如 8.1.0-next.0

    Next: The release that is under active development and testing. The next release is indicated by a release tag appended with the -next identifier, such as 8.1.0-next.0.

  • RC 版:一個特性已經完成,正在進行最終測試的版本。RC 版的發佈標籤帶有 -rc 標誌,比如 8.1.0-rc.0

    Release candidate: A release that is feature complete and in final testing. A release candidate is indicated by a release tag appended with the -rc identifier, such as version 8.1.0-rc.0.

nextrc 預發佈版的文件位於 next.angular.io

The latest next or rc pre-release version of the documentation is available at next.angular.io.

發佈頻率

Release frequency

我們會定期發佈新版本,以便隨著 Angular 的不斷演進,你可以提前計劃並協調這些升級工作。

We work toward a regular schedule of releases, so that you can plan and coordinate your updates with the continuing evolution of Angular.

免責條款:這些日期僅供參考,如有必要,我們會對其進行調整,以確保提供高品質的平臺。

Disclaimer: Dates are offered as general guidance and will be adjusted by us when necessary to ensure delivery of a high-quality platform.

通常,你可以期待下列發佈週期:

In general, you can expect the following release cycle:

  • 每 6 個月一個主版本

    A major release every 6 months

  • 每個主版本中包含 1~3 個小版本

    1-3 minor releases for each major release

  • 差不多每週一個發行版或預發行版(nextrc)的補丁版本

    A patch release and pre-release (next or rc) build almost every week

這種發佈的節奏能讓渴望新功能的開發者在這些功能開發開發完成並透過我們的程式碼審查和整合測試流程後立即就可以使用,同時為那些喜歡在新功能經過 Google 和其他使用預發佈版本的開發人員的驗證後才採納的生產環境使用者,保持平臺的穩定性和可靠性。

This cadence of releases gives eager developers access to new features as soon as they are fully developed and pass through our code review and integration testing processes, while maintaining the stability and reliability of the platform for production users that prefer to receive features after they have been validated by Google and other developers that use the pre-release builds.

支援策略

Support policy and schedule

所有主版本的支援週期都是 18 個月。

All of our major releases are supported for 18 months.

  • 6 個月的活躍支援,在此期間我們會定期發佈更新和補丁

    6 months of active support, during which regularly-scheduled updates and patches are released.

  • 12 個月的長期支援(LTS),在 LTS 期間,只會發佈關鍵性修復和安全補丁。

    12 months of long-term support (LTS), during which only critical fixes and security patches are released.

下表中提供了目前受支援的 Angular 版本的狀態。

The following table provides the status for Angular versions under support.

版本

Version

狀態

Status

發佈

Released

停止活動

Active Ends

LTS 結束

LTS Ends

^11.0.0

活躍

Active

2020 年 11 月 11 日

Nov 11, 2020

2021 年 5 月 11 日

May 11, 2021

2022 年 5 月 11 日

May 11, 2022

^10.0.0

活躍

LTS

2020 年 6 月 24 日

Jun 24, 2020

2020 年 12 月 24 日

Dec 24, 2020

2021 年 12 月 24 日

Dec 24, 2021

^9.0.0

活躍

LTS

2020 年 2 月 6 日

Feb 06, 2020

2020 年 8 月 6 日

Aug 06, 2020

2021 年 8 月 6 日

Aug 06, 2021

^8.0.0LTS

2019 年 5 月 28 日

May 28, 2019

2019 年 11 月 28 日

Nov 28, 2019

2020 年 11 月 28 日

Nov 28, 2020

不再為 ^4.0.0、^5.0.0、^6.0.0 和 ^7.0.0 版提供支援。

Angular versions ^4.0.0, ^5.0.0, ^6.0.0 and ^7.0.0 are no longer under support.

LTS 修復

LTS fixes

作為一個通用的規則,如果解決了下列問題之一,就會考慮對 LTS 版本進行修復:

As a general rule, a fix is considered for an LTS version if it resolves one of:

  • 一個新發現的安全漏洞。

    a newly identified security vulnerability,

  • LTS 發佈以後,由於第三方更改引起的迴歸性問題,比如瀏覽器的新版本。

    a regression, since the start of LTS, caused by a 3rd party change, such as a new browser version.

棄用策略

Deprecation practices

"重大變更"(比如移除特定的 API 和特性)有時候是必須的,比如創新、讓最佳實踐與時俱進、變更依賴關係甚至來自 Web 平臺自身的變化。

Sometimes "breaking changes", such as the removal of support for select APIs and features, are necessary to innovate and stay current with new best practices, changing dependencies, or changes in the (web) platform itself.

要讓這些轉變儘可能的簡單,我們會給你下列保證:

To make these transitions as easy as possible, we make these commitments to you:

  • 我們會盡量減少重大變更的數量,並儘可能提供遷移工具。

    We work hard to minimize the number of breaking changes and to provide migration tools when possible.

  • 我們會遵循這裡所講的棄用策略,讓你有時間把應用升級到最新的 API 和最佳實踐。

    We follow the deprecation policy described here, so you have time to update your apps to the latest APIs and best practices.

為了保證你能有充足的時間和清晰的路徑進行升級,我們制定瞭如下棄用策略:

To help ensure that you have sufficient time and a clear path to update, this is our deprecation policy:

  • 宣佈棄用: 我們會在變更記錄中宣佈要棄用的那些 API 和特性。啟用的 API 在文件中會顯示成帶刪除線的樣式。當我們宣佈一項棄用時,我們還會宣佈一個建議的升級路徑。為便於查詢,我們在棄用列表中包含一個關於棄用 API 和特性的彙總表。

    Announcement: We announce deprecated APIs and features in the change log. Deprecated APIs appear in the documentation with strikethrough. When we announce a deprecation, we also announce a recommended update path. For convenience, Deprecations contains a summary of deprecated APIs and features.

  • 棄用階段: 當 API 或特性已棄用時,它在接下來的兩個主版本中仍然會存在。再往後,棄用的 API 和特性將會進入候選棄用狀態。可能會在任何一次發佈中宣佈棄用,但是只會在主版本中移除已棄用的 API 或特性。除非已棄用的 API 或特性已被移除,否則我們仍然會根據 LTS 支援策略來維護它,也就是說,只會修復嚴重問題和安全問題。

    Deprecation period: When an API or a feature is deprecated, it will still be present in the next two major releases. After that, deprecated APIs and features will be candidates for removal. A deprecation can be announced in any release, but the removal of a deprecated API or feature will happen only in major release. Until a deprecated API or feature is removed, it will be maintained according to the LTS support policy, meaning that only critical and security issues will be fixed.

  • npm 依賴: 在主版本中,我們只會更新那些需要修改你的應用的那些 npm 依賴項。在次要版本中,我們會透過擴充套件受支援版本範圍的方式來更新對等依賴(peerDependencies),但在下一個主版本到來之前,不會強制要求你升級它們。這意味著,在次要版本中,Angular 應用和函式庫中,npm 依賴項的更新是可選的。

    npm dependencies: We only make npm dependency updates that require changes to your apps in a major release. In minor releases, we update peer dependencies by expanding the supported versions, but we do not require projects to update these dependencies until a future major version. This means that during minor Angular releases, npm dependency updates within Angular applications and libraries are optional.

公共 API

Public API surface

Angular 是很多包、子專案和工具的集合。為了防止你意外使用私有 API(這樣你才能更清楚的理解哪些 API 會被這裡所說的實踐所覆蓋),我們對公開 API 包含以及不包含哪些 API 進行了文件化。要了解詳情,參閱 Angular 的公共 API

Angular is a collection of many packages, sub-projects, and tools. To prevent accidental use of private APIs—and so that you can clearly understand what is covered by the practices described here—we document what is and is not considered our public API surface. For details, see Supported Public API Surface of Angular.

任何對公共 API 的修改都適用於上述這些版本、支援和棄用策略。

Any changes to the public API surface will be done using the versioning, support, and depreciation policies describe above.

Angular 實驗室(Labs)

Angular Labs

Angular 實驗室是一項旨在試驗新特性並快速迭代它們的嘗試。Angular 實驗室為 Angular 團隊提供了一個探索和試驗的安全場所。

Angular Labs is an initiative to cultivate new features and iterate on them quickly. Angular Labs provides a safe place for exploration and experimentation by the Angular team.

Angular 實驗室專案尚未準備好供產品環境使用,並且沒有任何會把它們帶入到產品環境的承諾。本文件中描述的這些策略和實踐都不適用於 Angular 實驗室中的專案。

Angular Labs projects are not ready for production use, and no commitment is made to bring them to production. The policies and practices that are described in this document do not apply to Angular Labs projects.