-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: s2-react 移除 antd 的依赖和部分基础组件, 相关分析组件迁移到 s2-react-components 中 #2887
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
中 只保留 drill-down, pagination, tooltip 三个基础能力组件 BREAKING CHANGE: 移除 header props 参数 (不再内置行列切换, 导出, 高级排序), 移除 antd ConfigProvider 包裹
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。 Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it. |
Size Change: +68.5 kB (+17.69%) Total Size: 456 kB
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👀 PR includes
🎨 Enhance
📝 Description
🐜 1. Antd 依赖移除
BREAKING CHANGE: 移除 header props 参数 (不再内置行列切换, 导出, 高级排序), 移除 antd ConfigProvider 包裹
s2-react
render
显式声明 UI 组件,最终效果相同,默认提供菜单配置 (props) , 可以根据项目中实际使用的antd@v4
或antd@v5
不同版本,对使用方式进行调整, 方便老旧项目升级。render
显式声明 UI 组件pagination
属性,表格内部封装了 S2 的内部分页更新逻辑,可以配合任意分页组件使用,如 antd 的<Pagination />
。s2-react-components
(行列切换, 导出, 高级排序, 下钻) 拆分到 s2-react-components 中, 如果有相关诉求, 自行组合使用, 彼此解耦, s2-react 保持轻量化
📦 2. 构建产物调整
使用 tsc 进行打包, 按源码目录生成 bundless ESM 构建产物 (单个大文件 tree shaking 无法生效)
抽取公用打包配置
解决包文件循环依赖问题
@antv/s2-shared 移除, 相关文件移动到 s2-core 中, 作为子目录
ESModule/CommonJS
所有包的
ESModule (esm)
和CommonJS (lib)
构建产物从Bundle
调整为Bundless
, 其所依赖的子模块会被直接拷贝输出,不再做编译,以便于更好的支持代码tree shaking
, 减少包体积。由于
@antv/s2-shared
是未发布的包, 只作用公用模块使用, 所以作为子目录拷贝进s2-(react/react-componnents/vue)
中进行Bundle
构建. 以兼容Bundless
的方式.UMD
所有包的
UMD (dist)
构建产物依然为Bundle
单文件,文件名和全局变量名有所调整:@antv/s2
dist/index.min.js
dist/style.min.css
dist/s2.min.css
dist/s2.min.css
@antv/s2-react
dist/index.min.js
dist/style.min.css
dist/s2-react.min.css
dist/s2-react.min.css
@antv/s2-vue
dist/index.min.js
dist/style.min.css
dist/s2-vue.min.css
dist/s2-vue.min.css
@antv/s2
S2
S2
@antv/s2-react
S2-React
S2React
@antv/s2-vue
S2-Vue
S2Vue
@antv/s2-shared
内部
s2-shared
包移除, 统一在@antv/s2
中导出🖼️ Screenshot
🔗 Related issue link
closes #2404 #2952
🔍 Self-Check before the merge