Skip to content

Commit 164152f

Browse files
committed
docs: Add migration guide from EasyExcel/FastExcel to Apache Fesod
1 parent 2070310 commit 164152f

File tree

3 files changed

+302
-0
lines changed

3 files changed

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

0 commit comments

Comments
 (0)