Skip to content

Commit 9bf2153

Browse files
GOODBOY008psxjoy
andauthored
docs: Add migration guide from FastExcel to Apache Fesod (#710)
* docs: Add migration guide from EasyExcel/FastExcel to Apache Fesod * docs: Add migration guide for transitioning from FastExcel to Apache Fesod * docs: Update migration guide to add 'Incubating' --------- Co-authored-by: Shuxin Pan <[email protected]>
1 parent 43eedd6 commit 9bf2153

File tree

3 files changed

+274
-0
lines changed

3 files changed

+274
-0
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
sidebar_position: 1
3+
title: From FastExcel
4+
description: Complete migration guide for transitioning from cn.idev FastExcel to Apache Fesod (Incubating)
5+
keywords: [fesod, migration, fastexcel, apache, excel, upgrade]
6+
---
7+
8+
# Migration Guide: FastExcel to Apache Fesod (Incubating)
9+
10+
## Overview
11+
12+
This guide provides a comprehensive roadmap for migrating applications from cn.idev FastExcel library to Apache Fesod (Incubating). Apache Fesod (Incubating) is the evolution of this project, now under the Apache Software Foundation (Incubating), offering the same high-performance Excel processing capabilities with enhanced community support and long-term sustainability.
13+
14+
### Why Migrate?
15+
16+
- **Apache Foundation Support**: Apache Fesod (Incubating) is now part of the Apache Software Foundation, ensuring long-term maintenance and community-driven development
17+
- **Seamless Transition**: The API remains virtually identical, requiring minimal code changes
18+
- **Enhanced Branding**: Unified naming conventions under the Apache Fesod (Incubating) umbrella
19+
- **Continued Innovation**: Access to future enhancements and features under active Apache governance
20+
- **Backward Compatibility**: Deprecated aliases (FastExcel) are temporarily maintained for gradual migration
21+
22+
### Migration Scope
23+
24+
This migration primarily involves:
25+
26+
1. Updating Maven/Gradle dependencies
27+
2. Replacing deprecated class names with FesodSheet
28+
3. Updating package imports
29+
4. Verifying functionality through comprehensive testing
30+
31+
The core API, annotations, and processing logic remain unchanged, ensuring a low-risk migration path.
32+
33+
---
34+
35+
## Migration Steps
36+
37+
### Step 1: Update Dependencies
38+
39+
Replace your existing dependency with Apache Fesod (Incubating):
40+
41+
| Source | GroupId | ArtifactId | Version |
42+
|--------|---------|------------|----------|
43+
| **cn.idev FastExcel** | cn.idev.excel | fastexcel | 1.3.0 |
44+
| **Apache Fesod (Incubating)**| org.apache.fesod | fesod | 1.3.0+ |
45+
46+
**Maven:**
47+
```xml
48+
<dependency>
49+
<groupId>org.apache.fesod</groupId>
50+
<artifactId>fesod</artifactId>
51+
<version>1.3.0</version>
52+
</dependency>
53+
```
54+
55+
**Gradle:**
56+
```gradle
57+
implementation 'org.apache.fesod:fesod:1.3.0'
58+
```
59+
60+
### Step 2: Package Import Updates
61+
62+
Update all import statements to use the new Apache Fesod (Incubating) package structure.
63+
64+
| Old Package (Deprecated) | New Package (Required) |
65+
|--------------------------|--------------------------|
66+
| cn.idev.excel.* | org.apache.fesod.sheet.* |
67+
68+
**Common Import Replacements:**
69+
70+
| Before | After |
71+
|--------------------------------------------------|-----------------------------------------------------------|
72+
| import cn.idev.excel.FastExcel; | import org.apache.fesod.sheet.FesodSheet; |
73+
| import cn.idev.excel.FastExcelFactory; | import org.apache.fesod.sheet.FesodSheet; |
74+
| import cn.idev.excel.ExcelReader; | import org.apache.fesod.sheet.ExcelReader; |
75+
| import cn.idev.excel.ExcelWriter; | import org.apache.fesod.sheet.ExcelWriter; |
76+
| import cn.idev.excel.annotation.ExcelProperty; | import org.apache.fesod.sheet.annotation.ExcelProperty; |
77+
| import cn.idev.excel.context.AnalysisContext; | import org.apache.fesod.sheet.context.AnalysisContext; |
78+
| import cn.idev.excel.read.listener.ReadListener; | import org.apache.fesod.sheet.read.listener.ReadListener; |
79+
80+
### Step 3: Class Name Migration
81+
82+
Replace deprecated entry point classes with FesodSheet.
83+
84+
#### Migration from FastExcel/FastExcelFactory
85+
86+
| Operation | Before (FastExcel) | After (FesodSheet) |
87+
|-----------------------|--------------------------------------------|---------------------------------------------|
88+
| **Simple Read** | FastExcel.read(file, Data.class, listener) | FesodSheet.read(file, Data.class, listener) |
89+
| **Simple Write** | FastExcel.write(file, Data.class) | FesodSheet.write(file, Data.class) |
90+
| **Read Sheet** | FastExcelFactory.readSheet(0) | FesodSheet.readSheet(0) |
91+
| **Write Sheet** | FastExcelFactory.writerSheet("Sheet1") | FesodSheet.writerSheet("Sheet1") |
92+
| **Read with Stream** | FastExcel.read(inputStream) | FesodSheet.read(inputStream) |
93+
| **Write with Stream** | FastExcel.write(outputStream) | FesodSheet.write(outputStream) |
94+
95+
---
96+
97+
## Migration Strategies
98+
99+
### Gradual Migration (Recommended)
100+
101+
Utilize the deprecated alias classes for a phased migration approach.
102+
103+
**Phase 1: Dependency Update Only**
104+
- Update Maven/Gradle dependency to Apache Fesod (Incubating)
105+
- Keep using FastExcel classes (now deprecated aliases)
106+
- Update package imports only
107+
- Run comprehensive tests to verify compatibility
108+
109+
**Phase 2: Class Name Migration**
110+
- Progressively replace deprecated classes with FesodSheet
111+
- Use IDE refactoring tools for bulk renaming
112+
- Migrate module by module or feature by feature
113+
- Maintain thorough test coverage throughout
114+
115+
**Phase 3: Cleanup**
116+
- Remove all references to deprecated classes
117+
- Resolve deprecation warnings
118+
- Update documentation and code comments
119+
120+
**Benefits:**
121+
- Lower risk through incremental changes
122+
- Easier rollback if issues arise
123+
- Minimal disruption to ongoing development
124+
- Allows time for thorough testing at each phase
125+
126+
---
127+
128+
## Conclusion
129+
130+
Migrating from cn.idev FastExcel to Apache Fesod (Incubating) is a straightforward process due to the high degree of API compatibility and backward-compatible deprecated aliases. The primary effort involves updating dependency declarations and package imports, with minimal to no logic changes required.
131+
132+
The gradual migration strategy, supported by the temporary deprecated aliases (FastExcel, FastExcelFactory), allows teams to migrate at their own pace while maintaining full functionality.
133+
134+
By following this guide, organizations can seamlessly transition to Apache Fesod (Incubating) and benefit from the long-term sustainability and community support of the Apache Software Foundation ecosystem.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
sidebar_position: 1
3+
title: 从 FastExcel 迁移
4+
description: 从 cn.idev FastExcel 迁移到 Apache Fesod (Incubating) 的完整指南
5+
keywords: [fesod, 迁移, fastexcel, apache, excel, 升级]
6+
---
7+
8+
# 迁移指南:从 FastExcel 迁移到 Apache Fesod (Incubating)
9+
10+
## 概述
11+
12+
本指南为从 cn.idev FastExcel 迁移到 Apache Fesod (Incubating) 提供全面的迁移路线。Apache Fesod (Incubating) 是该项目的演进版本,现已成为 Apache 软件基金会(孵化中)的一部分,提供同样的高性能 Excel 处理能力,并具有更强的社区支持和长期可持续性。
13+
14+
### 为什么要迁移?
15+
16+
- **Apache 基金会支持**: Apache Fesod (Incubating) 现已成为 Apache 软件基金会的一部分,确保长期维护和社区驱动的开发
17+
- **无缝过渡**: API 几乎完全相同,只需最少的代码更改
18+
- **统一品牌**: 在 Apache Fesod (Incubating) 下统一的命名规范
19+
- **持续创新**: 在 Apache 治理下获得未来的增强和功能
20+
- **向后兼容**: 暂时保留已废弃的别名(FastExcel)以便逐步迁移
21+
22+
### 迁移范围
23+
24+
本次迁移主要涉及:
25+
26+
1. 更新 Maven/Gradle 依赖
27+
2. 将已废弃的类名替换为 FesodSheet
28+
3. 更新包导入
29+
4. 通过全面测试验证功能
30+
31+
核心 API、注解和处理逻辑保持不变,确保低风险的迁移路径。
32+
33+
---
34+
35+
## 迁移步骤
36+
37+
### 步骤 1: 更新依赖
38+
39+
将现有依赖替换为 Apache Fesod (Incubating):
40+
41+
| 来源 | GroupId | ArtifactId | 版本 |
42+
|-----------------------|------------------|------------|--------|
43+
| **cn.idev FastExcel** | cn.idev.excel | fastexcel | 1.3.0 |
44+
| **Apache Fesod (Incubating)**| org.apache.fesod | fesod | 1.3.0+ |
45+
46+
**Maven 配置:**
47+
```xml
48+
<dependency>
49+
<groupId>org.apache.fesod</groupId>
50+
<artifactId>fesod</artifactId>
51+
<version>1.3.0</version>
52+
</dependency>
53+
```
54+
55+
**Gradle 配置:**
56+
```gradle
57+
implementation 'org.apache.fesod:fesod:1.3.0'
58+
```
59+
60+
### 步骤 2: 更新包导入
61+
62+
更新所有 import 语句以使用新的 Apache Fesod (Incubating) 包结构。
63+
64+
| 旧包名(已废弃) | 新包名(必需) |
65+
|-----------------|--------------------------|
66+
| cn.idev.excel.* | org.apache.fesod.sheet.* |
67+
68+
**常见导入替换:**
69+
70+
| 修改前 | 修改后 |
71+
|--------------------------------------------------|-----------------------------------------------------------|
72+
| import cn.idev.excel.FastExcel; | import org.apache.fesod.sheet.FesodSheet; |
73+
| import cn.idev.excel.FastExcelFactory; | import org.apache.fesod.sheet.FesodSheet; |
74+
| import cn.idev.excel.ExcelReader; | import org.apache.fesod.sheet.ExcelReader; |
75+
| import cn.idev.excel.ExcelWriter; | import org.apache.fesod.sheet.ExcelWriter; |
76+
| import cn.idev.excel.annotation.ExcelProperty; | import org.apache.fesod.sheet.annotation.ExcelProperty; |
77+
| import cn.idev.excel.context.AnalysisContext; | import org.apache.fesod.sheet.context.AnalysisContext; |
78+
| import cn.idev.excel.read.listener.ReadListener; | import org.apache.fesod.sheet.read.listener.ReadListener; |
79+
80+
### 步骤 3: 类名迁移
81+
82+
将已废弃的入口类替换为 FesodSheet。
83+
84+
#### 从 FastExcel/FastExcelFactory 迁移
85+
86+
| 操作 | 修改前 (FastExcel) | 修改后 (FesodSheet) |
87+
|--------------|--------------------------------------------|---------------------------------------------|
88+
| **简单读取** | FastExcel.read(file, Data.class, listener) | FesodSheet.read(file, Data.class, listener) |
89+
| **简单写入** | FastExcel.write(file, Data.class) | FesodSheet.write(file, Data.class) |
90+
| **读取 Sheet** | FastExcelFactory.readSheet(0) | FesodSheet.readSheet(0) |
91+
| **写入 Sheet** | FastExcelFactory.writerSheet("Sheet1") | FesodSheet.writerSheet("Sheet1") |
92+
| **流式读取** | FastExcel.read(inputStream) | FesodSheet.read(inputStream) |
93+
| **流式写入** | FastExcel.write(outputStream) | FesodSheet.write(outputStream) |
94+
95+
---
96+
97+
## 迁移策略
98+
99+
### 渐进式迁移(推荐)
100+
101+
利用已废弃的别名类进行分阶段迁移。
102+
103+
**阶段 1: 仅更新依赖**
104+
- 将 Maven/Gradle 依赖更新为 Apache Fesod (Incubating)
105+
- 继续使用 FastExcel 类(现为已废弃的别名)
106+
- 仅更新包导入
107+
- 运行全面测试以验证兼容性
108+
109+
**阶段 2: 类名迁移**
110+
- 逐步将已废弃的类替换为 FesodSheet
111+
- 使用 IDE 重构工具进行批量重命名
112+
- 逐个模块或逐个功能进行迁移
113+
- 在整个过程中保持全面的测试覆盖
114+
115+
**阶段 3: 清理**
116+
- 删除所有对已废弃类的引用
117+
- 解决废弃警告
118+
- 更新文档和代码注释
119+
120+
**优势:**
121+
- 通过增量更改降低风险
122+
- 如果出现问题更容易回滚
123+
- 对正在进行的开发影响最小
124+
- 允许在每个阶段进行充分测试的时间
125+
126+
---
127+
128+
## 总结
129+
130+
由于高度的 API 兼容性和向后兼容的已废弃别名,从 cn.idev FastExcel 迁移到 Apache Fesod (Incubating) 是一个直接的过程。主要工作涉及更新依赖声明和包导入,几乎不需要或不需要逻辑更改。
131+
132+
渐进式迁移策略得到临时已废弃别名(FastExcel、FastExcelFactory)的支持,允许团队按自己的节奏迁移,同时保持完整功能。
133+
134+
遵循本指南,组织可以无缝过渡到 Apache Fesod (Incubating),并从 Apache 软件基金会生态系统的长期可持续性和社区支持中受益。

website/sidebars.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ const sidebars = {
9999
]
100100
}
101101
]
102+
}, {
103+
type: 'category',
104+
label: 'migration',
105+
items: [
106+
'migration/from-fastexcel'
107+
]
102108
}
103109
]
104110
};

0 commit comments

Comments
 (0)