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

能不能处理好版本兼容问题??? #10293

Closed
china-liji opened this Issue Apr 28, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@china-liji

china-liji commented Apr 28, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.4.3

Environment

antd 3.4.1 与 antd 3.4.3

Reproduction link

https://ant.design/components/upload-cn/

Steps to reproduce

Upload 的 onChange 事件!!!
本来 3.4.1 之前返回的是 { file, fileList },其中 file 是 window.File 实例,可用于 file instanceOf File,
3.4.1 居然 file 改成了 object, 还给一个 originFileObj ???
这样算了,我改了一次兼容问题
结果 3.4.3 fileList 里面的也改成了 object , 但 3.4.1 却没有一起改!!!
有问题能统一处理吗?? 只改一部分?分2个版本???

What is expected?

看我描述

What is actually happening?

看我描述

@ant-design-bot

This comment has been minimized.

ant-design-bot commented Apr 28, 2018

Translation of this issue:


Can I handle version compatibility issues? ? ?

  • [] I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.4.3

Environment

Antd 3.4.1 and antd 3.4.3

Reproduction link

[https://ant.design/components/upload-en/] (https://ant.design/components/upload-cn/)

Steps to reproduce

Upload's onChange event! ! !
Originally, what was returned before 3.4.1 was { file, fileList }, where file is a window.File instance and can be used for file instanceOf File,
3.4.1 Actually file is changed to object and given to originFileObj ? ? ?
This way, I changed a compatibility issue
Result 3.4.3 fileList also changed to object, but 3.4.1 did not change! ! !
Is there a problem that can be handled in a unified way? ? Only changed part? Divided into 2 versions? ? ?
Can you be professional? ! !

What is expected?

See me description

What is actually happening?

See me description

@afc163

This comment has been minimized.

Member

afc163 commented Apr 28, 2018

#10059

这里搞错了,我改一下。

cc @whtsky

@afc163

This comment has been minimized.

Member

afc163 commented Apr 28, 2018

@china-liji 你使用了 beforeUpload 并 return 了 false 是么?

@afc163 afc163 referenced this issue Apr 28, 2018

Merged

fix typing for `Upload.beforeUpload` #10059

10 of 10 tasks complete

@afc163 afc163 closed this in e97977b Apr 28, 2018

@afc163

This comment has been minimized.

Member

afc163 commented Apr 28, 2018

我今天会发个 patch

@china-liji

This comment has been minimized.

china-liji commented Apr 28, 2018

是,使用了 beforeUpload 并 return 了 false,并自己弥补了兼容情况

wx20180428-124539

我们在上传API处理的时候,会判断是否为 window.File ,所以这次版本改动导致我们线上的整个文件系统崩掉了...
wx20180428-124959

@afc163 afc163 referenced this issue Apr 28, 2018

Merged

Release 3.4.4 #10296

afc163 added a commit that referenced this issue Apr 28, 2018

Release 3.4.4 (#10296)
* add `lib/**/style/*` as sideEffects (#10217)

* Fix upload onChange arg type when beforeUpload return false, close #10293

* 3.4.4

* Fix ts error temporarily, DefinitelyTyped/DefinitelyTyped#25342
@superlbr

This comment has been minimized.

superlbr commented Apr 28, 2018

文档没更新?file的name位置变了
before:

{
  file: { name: 'xxx'},
  fileList: [ /* ... */ ],
  event: { /* ... */ },
}

now:

{
  file: { originFileObj: {name: 'xxx'}},
  ....
}
@superlbr

This comment has been minimized.

superlbr commented May 2, 2018

果然妹子头像好使。。。#10319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment