稳定性指标


【Stability index】

在整个文档中都有关于各部分稳定性的说明。有些 API 已经经过充分验证并被广泛依赖,几乎不可能再发生任何改变。另一些则是全新且实验性的,或者已知存在风险。

【Throughout the documentation are indications of a section's stability. Some APIs are so proven and so relied upon that they are unlikely to ever change at all. Others are brand new and experimental, or known to be hazardous.】

稳定性指标如下:

【The stability indexes are as follows:】

稳定性: 0 - 已弃用。此功能可能会发出警告,不保证向后兼容性。

稳定性: 1 - 实验性。该功能不受语义化版本 规则约束。未来的任何版本中都可能发生非向后兼容的更改或删除。不建议在生产环境中使用该功能。 实验性功能被划分为以下阶段:
  • 1.0 - 早期开发。此阶段的实验性功能尚未完成,可能会有重大变动。
  • 1.1 - 积极开发中。此阶段的实验性功能已接近最低可用性。
  • 1.2 - 候选发布版。此阶段的实验性功能希望能够稳定。预计不会有进一步的重大更改,但仍可能根据用户反馈或功能的底层规范发展而发生变化。我们鼓励用户进行测试和反馈,以便我们确认该功能已准备好被标记为稳定。

实验功能通常通过以下方式脱离实验状态:要么升级为稳定版本,要么在没有弃用周期的情况下被删除。

稳定性: 2 - 稳定。与 npm 生态系统的兼容性是优先考虑的事项。

稳定性: 3 - 传统。尽管该功能不太可能被移除,并且仍然受到语义版本保证的覆盖,但它不再被积极维护,而且已有其他可选方案。

如果某些功能的使用没有造成伤害,并且在 npm 生态系统中被广泛依赖,它们会被标记为遗留功能,而不是被弃用。在遗留功能中发现的错误不太可能被修复。

【Features are marked as legacy rather than being deprecated if their use does no harm, and they are widely relied upon within the npm ecosystem. Bugs found in legacy features are unlikely to be fixed.】

在使用实验性功能时要小心,尤其是在编写库时。用户可能不知道使用了实验性功能。当实验性 API 发生修改时,可能会出现错误或行为变化,令用户感到意外。为了避免意外,使用实验性功能可能需要命令行标志。实验性功能也可能发出 警告

【Use caution when making use of Experimental features, particularly when authoring libraries. Users may not be aware that experimental features are being used. Bugs or behavior changes may surprise users when Experimental API modifications occur. To avoid surprises, use of an Experimental feature may need a command-line flag. Experimental features may also emit a warning.】