Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
docs: update readme
白熱5c9c9c16ed84
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex b2ff2187ba..4b409a493d 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -53,6 +53,8 @@ pnpm devPlease refer to [Architecture](https://docs.univer.ai/guides/recipes/architecture/univer), and also [ISOMORPHIC.md](./docs/ISOMORPHIC.md) for more guidance on how to set up plugins.+For public API compatibility expectations, experimental APIs, internal APIs, and deprecation rules, read [API_STABILITY.md](./docs/API_STABILITY.md).+### Source code organizationThe structure of the repository is as follows:@@ -233,8 +235,9 @@ Please refer to [How to Contribute to Facade API](./docs/CONTRIBUTING-FACADE.md)### Deprecate API-If you are going to deprecate an API, please follow the steps below:+If you are going to deprecate an API, follow the [API Stability Policy](./docs/API_STABILITY.md) and the steps below:1. Mark the API as deprecated in the JSDoc, and use `{@link}` to refer to the new API.2. In the implementation, call `deprecate` of `ILogService` to log a deprecation message.-3. Remove the API in the next minor version. If the API is considered heavily used, you can remove it in the next major version, e.g. 1.0.0.+3. Document the migration path in the relevant guide, README, changelog, or release notes when the API is broadly used.+4. Deprecated stable APIs should remain available until the next major release unless the API is unsafe, broken, or impossible to preserve. In pre-1.0 releases, removals may happen in a minor release, but they should be documented as breaking changes.diff --git a/README.md b/README.mdindex 78e2040f5c..2fe7f64c11 100644--- a/README.md+++ b/README.md@@ -230,6 +230,8 @@ Learn more in the [Installation & Basic Usage guide](https://docs.univer.ai/guidKeep all `@univerjs/*` packages on the same version. If you use Univer Pro packages, keep `@univerjs-pro/*` versions aligned as well.+For API compatibility expectations, experimental APIs, internal APIs, and deprecation rules, see the [API Stability Policy](./docs/API_STABILITY.md).+## 🧭 Compatibility- **Browser runtime**: Univer is compiled with a Chrome 70 target and aims to work on Edge `>=70`, Firefox `>=63`, Chrome `>=70`, Safari `>=12.0`, and Electron `>=5`.@@ -266,6 +268,13 @@ This repository contains Univer's open-source core and first-party OSS plugins.Pro features are documented in the [Univer Pro guide](https://docs.univer.ai/guides/pro). They are intentionally separated here so the OSS package surface is clear.+Boundary principles:++- OSS packages in this repository are intended to be useful on their own under the Apache-2.0 license. Univer Pro is optional and is not required to use the public OSS SDK APIs.+- Bugs, regressions, and security issues in OSS packages should be reported and fixed in the OSS repository, even when a related Pro feature exists.+- OSS documentation should not imply that Pro-only capabilities are available in public `@univerjs/*` packages. Pro-only APIs, packages, and deployment paths should be named explicitly.+- When an OSS feature has a Pro enhancement, the OSS behavior should remain documented independently so users can evaluate the open-source surface without reading commercial docs first.+## 🌐 Ecosystem- **Core SDK**: [`dream-num/univer`](https://github.com/dream-num/univer), this monorepo.@@ -322,7 +331,8 @@ Read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a pull request.Repository-local notes worth reading before deeper changes:-- [Building Isomorphic Univer](./docs/ISOMOPHIC.md): how to split browser, Node.js, UI, and shared plugin logic.+- [Building Isomorphic Univer](./docs/ISOMORPHIC.md): how to split browser, Node.js, UI, and shared plugin logic.+- [API Stability Policy](./docs/API_STABILITY.md): stable, experimental, internal, deprecated, and breaking-change expectations.- [Contributing to Facade API](./docs/CONTRIBUTING-FACADE.md): API design expectations for `FUniver`, `FWorkbook`, `FRange`, and related Facade classes.- [Naming Convention](./docs/NAMING_CONVENTION.md): file, folder, interface, plugin, command, and dependency injection token conventions.- [Fixing Memory Leaks](./docs/FIX_MEMORY_LEAK.md): common leak patterns and debugging workflow for Univer instances.diff --git a/docs/API_STABILITY.md b/docs/API_STABILITY.mdnew file mode 100644index 0000000000..73653ff3ea--- /dev/null+++ b/docs/API_STABILITY.md@@ -0,0 +1,94 @@+# API Stability Policy++This document defines how Univer treats public APIs, experimental APIs, internal APIs, deprecations, and breaking changes.++Univer is currently pre-1.0, so the project can still make breaking changes when they are needed for architecture, correctness, or long-term maintainability. Even in pre-1.0 releases, the project should make API risk visible before users depend on it.++## Stability Levels++### Stable++Stable APIs are intended for application and plugin developers.++An API is stable when it is exported from a public package entry point and is documented in the generated API reference, package README, guide, or examples without an experimental warning.++Examples include:++- Public package entry points such as `@univerjs/core`, `@univerjs/sheets`, and `@univerjs/presets`.+- Documented Facade APIs such as workbook, worksheet, range, formula, and document APIs.+- Public plugin classes, configuration types, commands, and service interfaces documented for extension authors.++Stable APIs should not be removed or changed incompatibly without a deprecation path.++### Experimental++Experimental APIs are usable, but their behavior, names, parameters, or package location may change.++An API is experimental when any of the following is true:++- It is documented as experimental, alpha, beta, preview, or under active development.+- It belongs to a product surface that is explicitly marked as under active development.+- It is exposed for early integration feedback before the project has committed to its final shape.++Experimental APIs should include a short note in docs or JSDoc that explains the instability. Breaking changes to experimental APIs should still be called out in release notes when they affect users.++### Internal++Internal APIs are implementation details and are not covered by compatibility guarantees.++An API should be treated as internal when it is:++- Not documented for application or plugin authors.+- Located under implementation folders such as controllers, render controllers, models, views, utilities, or test helpers without a public export contract.+- Exported only to support package composition inside the monorepo.+- Marked `@internal`, `@private`, or described as implementation-only.++Avoid depending on internal APIs in user applications. If an internal API is needed for real integrations, open an issue or discussion so it can be promoted to a public API intentionally.++### Deprecated++Deprecated APIs are still available for compatibility, but users should migrate away from them.++When deprecating an API:++1. Mark it with `@deprecated` in JSDoc and link to the replacement when one exists.+2. Log a deprecation warning through `ILogService` when runtime usage can be detected without excessive noise.+3. Add migration guidance in the relevant guide, README, or release notes when the API is broadly used.++Deprecated stable APIs should remain available until the next major release unless the API is unsafe, broken, or impossible to preserve. In pre-1.0 releases, removals may happen in a minor release, but they should be documented as breaking changes.++## Breaking Changes++A change is breaking when it requires users to modify application code, plugin code, build configuration, package versions, persisted data assumptions, or runtime integration behavior.++Breaking changes should be documented in the changelog or release notes with:++- The affected package or feature area.+- What changed.+- Why the change was necessary.+- The migration path or replacement API.++Pull requests that introduce breaking changes should include a `BREAKING CHANGE:` section in the PR description.++## Package Version Alignment++Keep all `@univerjs/*` packages on the same version. If an application uses Univer Pro packages, keep all `@univerjs-pro/*` packages aligned with the matching Univer release line as well.++Mixing package versions can bypass compatibility checks and produce runtime failures, especially around plugin registration, Facade API composition, locales, commands, and shared data models.++## Public API Checklist++Before exposing a new public API, confirm that:++- The API has a clear owner package and entry point.+- The name follows the repository naming convention.+- The API works in the intended runtime: browser, Node.js, worker, or shared.+- Facade APIs are registered by the correct package or preset.+- The API has tests for expected behavior and at least one usage example or reference entry.+- Experimental status is explicitly documented if the design is not final.++## User Expectations++Users can rely on documented stable APIs as the preferred integration surface. Users should expect experimental APIs to evolve and internal APIs to change without notice.++If the documentation and package exports disagree, treat the documentation as the intended public contract and report the mismatch.diff --git a/docs/ISOMOPHIC.md b/docs/ISOMORPHIC.mdsimilarity index 100%rename from docs/ISOMOPHIC.mdrename to docs/ISOMORPHIC.mddiff --git a/docs/readme/es-ES.md b/docs/readme/es-ES.mdindex 4d3304ecee..9fac356f69 100644--- a/docs/readme/es-ES.md+++ b/docs/readme/es-ES.md@@ -230,6 +230,8 @@ Consulta más detalles en la [guía de instalación y uso básico](https://docs.Mantén todos los paquetes `@univerjs/*` en la misma versión. Si usas paquetes de Univer Pro, mantén también alineadas las versiones de `@univerjs-pro/*`.+Para expectativas de compatibilidad de API, APIs experimentales, APIs internas y reglas de deprecación, consulta la [política de estabilidad de API](../API_STABILITY.md).+## 🧭 Compatibilidad- **Runtime de navegador**: Univer se compila con objetivo Chrome 70 y busca funcionar en Edge `>=70`, Firefox `>=63`, Chrome `>=70`, Safari `>=12.0` y Electron `>=5`.@@ -266,6 +268,13 @@ Este repositorio contiene el núcleo open source de Univer y plugins OSS de primLas funciones Pro están documentadas en la [guía de Univer Pro](https://docs.univer.ai/guides/pro). Se separan aquí intencionalmente para que el alcance OSS sea claro.+Principios de separación:++- Los paquetes OSS de este repositorio están pensados para ser útiles por sí mismos bajo la licencia Apache-2.0. Univer Pro es opcional y no se requiere para usar las APIs públicas del SDK OSS.+- Los bugs, regresiones y problemas de seguridad en paquetes OSS deben reportarse y corregirse en el repositorio OSS, incluso cuando exista una función Pro relacionada.+- La documentación OSS no debe sugerir que capacidades Pro-only están disponibles en los paquetes públicos `@univerjs/*`. Las APIs, paquetes y rutas de despliegue Pro-only deben nombrarse explícitamente.+- Cuando una función OSS tenga una mejora Pro, el comportamiento OSS debe seguir documentado de forma independiente para que los usuarios puedan evaluar el alcance open source sin leer primero documentación comercial.+## 🌐 Ecosistema- **Core SDK**: [`dream-num/univer`](https://github.com/dream-num/univer), este monorepo.@@ -322,7 +331,8 @@ Lee [CONTRIBUTING.md](../../CONTRIBUTING.md) antes de abrir un pull request.Notas locales del repositorio que vale la pena leer antes de cambios profundos:-- [Building Isomorphic Univer](../ISOMOPHIC.md): cómo separar lógica de navegador, Node.js, UI y plugins compartidos.+- [Building Isomorphic Univer](../ISOMORPHIC.md): cómo separar lógica de navegador, Node.js, UI y plugins compartidos.+- [Política de estabilidad de API](../API_STABILITY.md): expectativas sobre stable, experimental, internal, deprecated y breaking changes.- [Contributing to Facade API](../CONTRIBUTING-FACADE.md): expectativas de diseño para `FUniver`, `FWorkbook`, `FRange` y clases Facade relacionadas.- [Naming Convention](../NAMING_CONVENTION.md): convenciones para archivos, carpetas, interfaces, plugins, comandos y tokens de inyección de dependencias.- [Fixing Memory Leaks](../FIX_MEMORY_LEAK.md): patrones comunes de fugas de memoria y flujo de depuración para instancias Univer.diff --git a/docs/readme/ja-JP.md b/docs/readme/ja-JP.mdindex dc4f23b8d5..7a1b5ba2ab 100644--- a/docs/readme/ja-JP.md+++ b/docs/readme/ja-JP.md@@ -231,6 +231,8 @@ univerAPI.createWorkbook({})すべての `@univerjs/*` パッケージは同じバージョンに揃えてください。Univer Pro パッケージを使う場合も、`@univerjs-pro/*` のバージョンを揃えてください。+API 互換性、experimental API、internal API、deprecation rules については [API Stability Policy](../API_STABILITY.md) を参照してください。+## 🧭 互換性- **ブラウザ実行環境**:Univer は Chrome 70 をターゲットとしてコンパイルされており、Edge `>=70`、Firefox `>=63`、Chrome `>=70`、Safari `>=12.0`、Electron `>=5` で動作することを目指しています。@@ -267,6 +269,13 @@ univerAPI.createWorkbook({})Pro 機能は [Univer Pro guide](https://docs.univer.ai/guides/pro) に記載されています。ここでは OSS パッケージの範囲を明確にするため、意図的に分けて説明しています。+Boundary principles:++- このリポジトリの OSS パッケージは Apache-2.0 license の下で単独利用できることを意図しています。Univer Pro は任意であり、公開 OSS SDK API の利用に Pro は不要です。+- OSS パッケージの bugs、regressions、security issues は、関連する Pro 機能がある場合でも OSS リポジトリで報告・修正されるべきです。+- OSS documentation は、Pro-only capabilities が公開 `@univerjs/*` packages に含まれるかのように示すべきではありません。Pro-only APIs、packages、deployment paths は明示的に名前を出してください。+- OSS feature に Pro enhancement がある場合でも、OSS behavior は独立して文書化し、commercial docs を先に読まなくても open-source surface を評価できるようにします。+## 🌐 エコシステム- **Core SDK**:[`dream-num/univer`](https://github.com/dream-num/univer)、この monorepo です。@@ -323,7 +332,8 @@ Pull request を作成する前に [CONTRIBUTING.md](../../CONTRIBUTING.md) をより深い変更を行う前に読む価値のあるリポジトリ内メモです。-- [Building Isomorphic Univer](../ISOMOPHIC.md):ブラウザ、Node.js、UI、共有プラグインロジックの分離方針。+- [Building Isomorphic Univer](../ISOMORPHIC.md):ブラウザ、Node.js、UI、共有プラグインロジックの分離方針。+- [API Stability Policy](../API_STABILITY.md):stable、experimental、internal、deprecated、breaking-change expectations。- [Contributing to Facade API](../CONTRIBUTING-FACADE.md):`FUniver`、`FWorkbook`、`FRange` などの Facade API 設計方針。- [Naming Convention](../NAMING_CONVENTION.md):ファイル、フォルダ、インターフェース、プラグイン、コマンド、DI token の命名規則。- [Fixing Memory Leaks](../FIX_MEMORY_LEAK.md):Univer インスタンスでよくあるメモリリークパターンとデバッグ手順。diff --git a/docs/readme/ko-KR.md b/docs/readme/ko-KR.mdindex 08df83bbfe..328f9c2803 100644--- a/docs/readme/ko-KR.md+++ b/docs/readme/ko-KR.md@@ -231,6 +231,8 @@ univerAPI.createWorkbook({})모든 `@univerjs/*` 패키지는 같은 버전으로 유지하세요. Univer Pro 패키지를 사용하는 경우 `@univerjs-pro/*` 버전도 맞춰야 합니다.+API 호환성 기대치, experimental APIs, internal APIs, deprecation rules는 [API Stability Policy](../API_STABILITY.md)를 참고하세요.+## 🧭 호환성- **브라우저 런타임**: Univer는 Chrome 70을 대상으로 컴파일되며 Edge `>=70`, Firefox `>=63`, Chrome `>=70`, Safari `>=12.0`, Electron `>=5`에서 잘 동작하도록 노력합니다.@@ -267,6 +269,13 @@ Sheets는 현재 가장 성숙한 제품 영역입니다. Docs와 Slides는 UnivPro 기능은 [Univer Pro guide](https://docs.univer.ai/guides/pro)에 문서화되어 있습니다. 여기서는 OSS 패키지의 범위를 명확히 하기 위해 의도적으로 분리했습니다.+Boundary principles:++- 이 저장소의 OSS 패키지는 Apache-2.0 license 아래에서 독립적으로 유용하게 사용할 수 있도록 의도되었습니다. Univer Pro는 선택 사항이며, 공개 OSS SDK API를 사용하는 데 필요하지 않습니다.+- OSS 패키지의 bugs, regressions, security issues는 관련 Pro 기능이 있더라도 OSS 저장소에서 보고하고 수정해야 합니다.+- OSS documentation은 Pro-only capabilities가 공개 `@univerjs/*` packages에 포함된 것처럼 암시해서는 안 됩니다. Pro-only APIs, packages, deployment paths는 명확히 이름을 표시해야 합니다.+- OSS feature에 Pro enhancement가 있더라도 OSS behavior는 독립적으로 문서화되어야 하며, 사용자가 commercial docs를 먼저 읽지 않고도 open-source surface를 평가할 수 있어야 합니다.+## 🌐 생태계- **Core SDK**: [`dream-num/univer`](https://github.com/dream-num/univer), 이 monorepo입니다.@@ -323,7 +332,8 @@ Pull request를 열기 전에 [CONTRIBUTING.md](../../CONTRIBUTING.md)를 읽어더 깊은 변경을 하기 전에 읽어볼 만한 저장소 내부 문서입니다.-- [Building Isomorphic Univer](../ISOMOPHIC.md): 브라우저, Node.js, UI, 공유 플러그인 로직을 나누는 방법.+- [Building Isomorphic Univer](../ISOMORPHIC.md): 브라우저, Node.js, UI, 공유 플러그인 로직을 나누는 방법.+- [API Stability Policy](../API_STABILITY.md): stable, experimental, internal, deprecated, breaking-change expectations.- [Contributing to Facade API](../CONTRIBUTING-FACADE.md): `FUniver`, `FWorkbook`, `FRange` 등 Facade API의 설계 기준.- [Naming Convention](../NAMING_CONVENTION.md): 파일, 폴더, 인터페이스, 플러그인, 명령, DI token naming 규칙.- [Fixing Memory Leaks](../FIX_MEMORY_LEAK.md): Univer 인스턴스의 흔한 memory leak 패턴과 디버깅 흐름.diff --git a/docs/readme/zh-CN.md b/docs/readme/zh-CN.mdindex 3e1ce7006a..58fdc3733d 100644--- a/docs/readme/zh-CN.md+++ b/docs/readme/zh-CN.md@@ -230,6 +230,8 @@ univerAPI.createWorkbook({})请保持所有 `@univerjs/*` 包版本一致。如果使用 Univer Pro 包,也请保持 `@univerjs-pro/*` 版本一致。+关于 API 兼容性预期、实验性 API、内部 API 和废弃规则,请阅读 [API 稳定性政策](../API_STABILITY.md)。+## 🧭 兼容性- **浏览器运行时**:Univer 的编译目标是 Chrome 70,并尽力支持 Edge `>=70`、Firefox `>=63`、Chrome `>=70`、Safari `>=12.0` 和 Electron `>=5`。@@ -266,6 +268,13 @@ Sheets 是目前最成熟的产品界面。Docs 和 Slides 共享 Univer 的架Pro 功能请参考 [Univer Pro 指南](https://docs.univer.ai/guides/pro)。这里将其单独列出,是为了清晰区分 OSS 包的能力边界。+边界原则:++- 本仓库中的 OSS 包应能在 Apache-2.0 许可证下独立使用。Univer Pro 是可选的,使用公开 OSS SDK API 不需要依赖 Pro。+- OSS 包中的 bug、回归和安全问题应在 OSS 仓库中报告和修复,即使存在相关的 Pro 功能。+- OSS 文档不应暗示 Pro-only 能力已经包含在公开的 `@univerjs/*` 包中。Pro-only API、包和部署路径应被明确命名。+- 当某个 OSS 功能存在 Pro 增强时,OSS 行为仍应被独立记录,便于用户在不先阅读商业文档的情况下评估开源能力。+## 🌐 生态- **核心 SDK**:[`dream-num/univer`](https://github.com/dream-num/univer),也就是当前 monorepo。@@ -322,7 +331,8 @@ pnpm dev深入修改前,建议阅读这些仓库内说明:-- [Building Isomorphic Univer](../ISOMOPHIC.md):如何拆分浏览器、Node.js、UI 与共享插件逻辑。+- [Building Isomorphic Univer](../ISOMORPHIC.md):如何拆分浏览器、Node.js、UI 与共享插件逻辑。+- [API 稳定性政策](../API_STABILITY.md):stable、experimental、internal、deprecated 和破坏性变更预期。- [Contributing to Facade API](../CONTRIBUTING-FACADE.md):`FUniver`、`FWorkbook`、`FRange` 等 Facade API 的设计约定。- [Naming Convention](../NAMING_CONVENTION.md):文件、目录、接口、插件、命令和依赖注入 token 的命名规则。- [Fixing Memory Leaks](../FIX_MEMORY_LEAK.md):Univer 实例常见内存泄漏模式和调试流程。diff --git a/docs/readme/zh-TW.md b/docs/readme/zh-TW.mdindex 5124c713da..0e8002898e 100644--- a/docs/readme/zh-TW.md+++ b/docs/readme/zh-TW.md@@ -230,6 +230,8 @@ univerAPI.createWorkbook({})請保持所有 `@univerjs/*` 套件版本一致。如果使用 Univer Pro 套件,也請保持 `@univerjs-pro/*` 版本一致。+關於 API 相容性預期、實驗性 API、內部 API 和棄用規則,請閱讀 [API 穩定性政策](../API_STABILITY.md)。+## 🧭 相容性- **瀏覽器執行時**:Univer 的編譯目標是 Chrome 70,並盡力支援 Edge `>=70`、Firefox `>=63`、Chrome `>=70`、Safari `>=12.0` 和 Electron `>=5`。@@ -266,6 +268,13 @@ Sheets 是目前最成熟的產品介面。Docs 和 Slides 共享 Univer 的架Pro 功能請參考 [Univer Pro 指南](https://docs.univer.ai/guides/pro)。這裡將其單獨列出,是為了清楚區分 OSS 套件的能力邊界。+邊界原則:++- 本倉庫中的 OSS 套件應能在 Apache-2.0 授權下獨立使用。Univer Pro 是選用的,使用公開 OSS SDK API 不需要依賴 Pro。+- OSS 套件中的 bug、回歸和安全問題應在 OSS 倉庫中回報和修復,即使存在相關的 Pro 功能。+- OSS 文件不應暗示 Pro-only 能力已包含在公開的 `@univerjs/*` 套件中。Pro-only API、套件和部署路徑應被明確命名。+- 當某個 OSS 功能存在 Pro 增強時,OSS 行為仍應被獨立記錄,方便使用者在不先閱讀商業文件的情況下評估開源能力。+## 🌐 生態- **核心 SDK**:[`dream-num/univer`](https://github.com/dream-num/univer),也就是目前的 monorepo。@@ -322,7 +331,8 @@ pnpm dev深入修改前,建議閱讀這些倉庫內說明:-- [Building Isomorphic Univer](../ISOMOPHIC.md):如何拆分瀏覽器、Node.js、UI 與共享外掛邏輯。+- [Building Isomorphic Univer](../ISOMORPHIC.md):如何拆分瀏覽器、Node.js、UI 與共享外掛邏輯。+- [API 穩定性政策](../API_STABILITY.md):stable、experimental、internal、deprecated 和破壞性變更預期。- [Contributing to Facade API](../CONTRIBUTING-FACADE.md):`FUniver`、`FWorkbook`、`FRange` 等 Facade API 的設計約定。- [Naming Convention](../NAMING_CONVENTION.md):檔案、目錄、介面、外掛、命令和依賴注入 token 的命名規則。- [Fixing Memory Leaks](../FIX_MEMORY_LEAK.md):Univer 實例常見記憶體洩漏模式和除錯流程。