exa-upgrade-migration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExa Upgrade & Migration
Exa SDK升级与迁移
Overview
概述
Guide for upgrading Exa SDK versions and handling breaking changes.
本指南介绍如何升级Exa SDK版本并处理破坏性变更。
Prerequisites
前置条件
- Current Exa SDK installed
- Git for version control
- Test suite available
- Staging environment
- 已安装当前版本的Exa SDK
- 用于版本控制的Git
- 可用的测试套件
- 预发布环境
Instructions
操作步骤
Step 1: Check Current Version
步骤1:查看当前版本
bash
npm list @exa/sdk
npm view @exa/sdk versionbash
npm list @exa/sdk
npm view @exa/sdk versionStep 2: Review Changelog
步骤2:查看更新日志
bash
open https://github.com/exa/sdk/releasesbash
open https://github.com/exa/sdk/releasesStep 3: Create Upgrade Branch
步骤3:创建升级分支
bash
git checkout -b upgrade/exa-sdk-vX.Y.Z
npm install @exa/sdk@latest
npm testbash
git checkout -b upgrade/exa-sdk-vX.Y.Z
npm install @exa/sdk@latest
npm testStep 4: Handle Breaking Changes
步骤4:处理破坏性变更
Update import statements, configuration, and method signatures as needed.
根据需要更新导入语句、配置和方法签名。
Output
输出结果
- Updated SDK version
- Fixed breaking changes
- Passing test suite
- Documented rollback procedure
- 已更新的SDK版本
- 已修复的破坏性变更
- 测试套件全部通过
- 已记录的回滚流程
Error Handling
错误处理
| SDK Version | API Version | Node.js | Breaking Changes |
|---|---|---|---|
| 3.x | 2024-01 | 18+ | Major refactor |
| 2.x | 2023-06 | 16+ | Auth changes |
| 1.x | 2022-01 | 14+ | Initial release |
| SDK版本 | API版本 | Node.js | 破坏性变更 |
|---|---|---|---|
| 3.x | 2024-01 | 18+ | 重大重构 |
| 2.x | 2023-06 | 16+ | 认证方式变更 |
| 1.x | 2022-01 | 14+ | 初始版本 |
Examples
示例
Import Changes
导入语句变更
typescript
// Before (v1.x)
import { Client } from '@exa/sdk';
// After (v2.x)
import { ExaClient } from '@exa/sdk';typescript
// Before (v1.x)
import { Client } from '@exa/sdk';
// After (v2.x)
import { ExaClient } from '@exa/sdk';Configuration Changes
配置变更
typescript
// Before (v1.x)
const client = new Client({ key: 'xxx' });
// After (v2.x)
const client = new ExaClient({
apiKey: 'xxx',
});typescript
// Before (v1.x)
const client = new Client({ key: 'xxx' });
// After (v2.x)
const client = new ExaClient({
apiKey: 'xxx',
});Rollback Procedure
回滚流程
bash
npm install @exa/sdk@1.x.x --save-exactbash
npm install @exa/sdk@1.x.x --save-exactDeprecation Handling
弃用功能处理
typescript
// Monitor for deprecation warnings in development
if (process.env.NODE_ENV === 'development') {
process.on('warning', (warning) => {
if (warning.name === 'DeprecationWarning') {
console.warn('[Exa]', warning.message);
// Log to tracking system for proactive updates
}
});
}
// Common deprecation patterns to watch for:
// - Renamed methods: client.oldMethod() -> client.newMethod()
// - Changed parameters: { key: 'x' } -> { apiKey: 'x' }
// - Removed features: Check release notes before upgradingtypescript
// Monitor for deprecation warnings in development
if (process.env.NODE_ENV === 'development') {
process.on('warning', (warning) => {
if (warning.name === 'DeprecationWarning') {
console.warn('[Exa]', warning.message);
// Log to tracking system for proactive updates
}
});
}
// Common deprecation patterns to watch for:
// - Renamed methods: client.oldMethod() -> client.newMethod()
// - Changed parameters: { key: 'x' } -> { apiKey: 'x' }
// - Removed features: Check release notes before upgradingResources
参考资源
Next Steps
后续步骤
For CI integration during upgrades, see .
exa-ci-integration如需在升级过程中集成CI,请查看。
exa-ci-integration