Skip to content
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

fix: exporting common types #28963

Merged
merged 7 commits into from
Jan 24, 2021
Merged

fix: exporting common types #28963

merged 7 commits into from
Jan 24, 2021

Conversation

chenshuai2144
Copy link
Contributor

@chenshuai2144 chenshuai2144 commented Jan 21, 2021

[English Template / 英文模板]

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

语言 更新描述
🇺🇸 英文 Export common typescript type definitions by default
🇨🇳 中文 默认导出常用的 typescript 类型定义

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jan 21, 2021

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2021

Size Change: +15 B (0%)

Total Size: 834 kB

Filename Size Change
./dist/antd-with-locales.min.js 336 kB -2 B (0%)
./dist/antd.min.js 296 kB +17 B (0%)
ℹ️ View Unchanged
Filename Size Change
./dist/antd.compact.min.css 66.9 kB 0 B
./dist/antd.dark.min.css 68.2 kB 0 B
./dist/antd.min.css 66.9 kB 0 B

compressed-size-action

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 21, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1d1f5e5:

Sandbox Source
antd reproduction template Configuration

@chenshuai2144 chenshuai2144 changed the title exporting common types fix: exporting common types Jan 21, 2021
@chenshuai2144
Copy link
Contributor Author

顺便支持了 import type 的 eslint 规则,以为包能小一点,没想到大了几 b

@afc163
Copy link
Member

afc163 commented Jan 21, 2021

建议先不动,不然有些 TS 没升上来会挂:#28819

@chenshuai2144
Copy link
Contributor Author

chenshuai2144 commented Jan 22, 2021

好,我回滚掉

@chenshuai2144 chenshuai2144 requested a review from afc163 January 24, 2021 01:28
@afc163
Copy link
Member

afc163 commented Jan 24, 2021

ci 挂了,请检查。

@codecov
Copy link

codecov bot commented Jan 24, 2021

Codecov Report

Merging #28963 (1d1f5e5) into master (abd31cc) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master    #28963   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          393       393           
  Lines         7465      7466    +1     
  Branches      2152      2152           
=========================================
+ Hits          7465      7466    +1     
Impacted Files Coverage Δ
components/calendar/index.tsx 100.00% <ø> (ø)
components/index.tsx 100.00% <ø> (ø)
components/menu/index.tsx 100.00% <ø> (ø)
components/statistic/index.tsx 100.00% <ø> (ø)
components/config-provider/index.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abd31cc...1d1f5e5. Read the comment docs.

@afc163
Copy link
Member

afc163 commented Jan 24, 2021

/rebase

// jest.mock('react', () => ({
// ...jest.requireActual('react'),
// useLayoutEffect: jest.requireActual('react').useEffect,
// }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该删掉。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个应该打开的,这样就没有 warning 了

不过执行顺序会有一点问题

components/index.tsx Outdated Show resolved Hide resolved
components/index.tsx Outdated Show resolved Hide resolved
chenshuai2144 and others added 3 commits January 24, 2021 20:35
Co-authored-by: 偏右 <afc163@gmail.com>
@afc163 afc163 merged commit 0afdbe4 into master Jan 24, 2021
@afc163 afc163 deleted the fix-bug branch January 24, 2021 15:24
@pr-triage pr-triage bot added the PR: merged label Jan 24, 2021
export { default as Cascader } from './cascader';

export type { CheckboxProps, CheckboxOptionType } from './checkbox';
Copy link
Contributor

@dr2009 dr2009 Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckboxChangeEvent应该也要导出

Radio 就有RadioChangeEvent导出

ColumnGroupType as TableColumnGroupType,
ColumnType as TableColumnType,
ColumnProps as TableColumnProps,
} from './table';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ColumnsType 没有导出... 官网示例用的就是这个

import type { ColumnsType } from 'antd/es/table';

export { default as Comment } from './comment';

export { default as ConfigProvider } from './config-provider';

export type { DatePickerProps } from './date-picker';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺少 RangePickerProps 导出

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants