instantly-upgrade-migration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInstantly Upgrade & Migration
Instantly SDK升级与迁移
Overview
概述
Guide for upgrading Instantly SDK versions and handling breaking changes.
本文档为升级Instantly SDK版本及处理破坏性变更提供指引。
Prerequisites
前提条件
- Current Instantly SDK installed
- Git for version control
- Test suite available
- Staging environment
- 已安装当前版本的Instantly SDK
- 用于版本控制的Git
- 可用的测试套件
- 预发布(Staging)环境
Instructions
操作步骤
Step 1: Check Current Version
步骤1:检查当前版本
bash
npm list @instantly/sdk
npm view @instantly/sdk versionbash
npm list @instantly/sdk
npm view @instantly/sdk versionStep 2: Review Changelog
步骤2:查看更新日志
bash
open https://github.com/instantly/sdk/releasesbash
open https://github.com/instantly/sdk/releasesStep 3: Create Upgrade Branch
步骤3:创建升级分支
bash
git checkout -b upgrade/instantly-sdk-vX.Y.Z
npm install @instantly/sdk@latest
npm testbash
git checkout -b upgrade/instantly-sdk-vX.Y.Z
npm install @instantly/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 '@instantly/sdk';
// After (v2.x)
import { InstantlyClient } from '@instantly/sdk';typescript
// 之前(v1.x版本)
import { Client } from '@instantly/sdk';
// 之后(v2.x版本)
import { InstantlyClient } from '@instantly/sdk';Configuration Changes
配置变更
typescript
// Before (v1.x)
const client = new Client({ key: 'xxx' });
// After (v2.x)
const client = new InstantlyClient({
apiKey: 'xxx',
});typescript
// 之前(v1.x版本)
const client = new Client({ key: 'xxx' });
// 之后(v2.x版本)
const client = new InstantlyClient({
apiKey: 'xxx',
});Rollback Procedure
回滚流程
bash
npm install @instantly/sdk@1.x.x --save-exactbash
npm install @instantly/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('[Instantly]', 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
// 在开发环境中监控废弃警告
if (process.env.NODE_ENV === 'development') {
process.on('warning', (warning) => {
if (warning.name === 'DeprecationWarning') {
console.warn('[Instantly]', warning.message);
// 记录至追踪系统以便主动更新
}
});
}
// 需要关注的常见废弃模式:
// - 方法重命名:client.oldMethod() -> client.newMethod()
// - 参数变更:{ key: 'x' } -> { apiKey: 'x' }
// - 功能移除:升级前请查看发布说明Resources
相关资源
Next Steps
后续步骤
For CI integration during upgrades, see .
instantly-ci-integration如需在升级过程中集成CI,请查看。
instantly-ci-integration