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

feat: browser端,将 is-type-of 包处理为本地 shim #801

Merged
merged 1 commit into from
Jun 4, 2020

Conversation

microJ
Copy link
Contributor

@microJ microJ commented Jun 3, 2020

aliyun-oss-sdk.min.js 体积从 451K 减小到 397K

@PeterRao
Copy link
Collaborator

PeterRao commented Jun 3, 2020

可能会造成node和borwser代码不统一,不利于后续融合代码。看是否能通过package.json 中的browser字段,来替换这部分node的代码。

@microJ
Copy link
Contributor Author

microJ commented Jun 3, 2020

@PeterRao 已经处理了。

另外发现,项目中 isArray 函数单独声明有好几处地方,是否在 client-side 和 server-side 都建议使用 is-type-of 的 is.array 进行判断?

@microJ microJ changed the title feat: browser端,去除 is-type-of 包的依赖 feat: browser端,将 is-type-of 包处理为本地 shim Jun 4, 2020
@PeterRao
Copy link
Collaborator

PeterRao commented Jun 4, 2020

isArray

最终还是想把各个工具函数单独搞成一个文件 所以弄在util 下面了,主要我们在做tree shaking 的改造,后面想尽可能的用tree shanking 的方式去减少使用单个api时的代码体积。
现在如果用这个is-type-of,假如我只想要isArray这个方法,会把const { Stream } = require('stream'); 这个也引入进来,stream这个在浏览器里后面又引入了一大堆的库,因此我们计划一个文件就一个函数可能更好一点。

@PeterRao PeterRao requested a review from weiyie June 4, 2020 03:41
@PeterRao PeterRao merged commit 6f4ae51 into ali-sdk:develop Jun 4, 2020
PeterRao added a commit that referenced this pull request Jun 5, 2020
* fix: _unSupportBrowserTip (#755)

* fix: checkBucketName bug (#749)

* feat: image processing (#744)

close #676

* feat: putBucketWebsite support new parameter (#736)

* feat: support for the latest putBucketLifecycle api features (#757)

* feat: signatureUrl support trafficLimit (#756)

* feat(node): bucket policy (#751)

* test: getBucketTags/getObjectTagging/calculatePostSignature (#739)

* test: getBucketTags/getObjectTagging/calculatePostSignature

* fix: trafficLimit error

* chore: browserify close  debug (#759)

* fix: add successStatus (#762)

* fix: checkBucketName bug (#763)

* fix: add CORS for server-side-encryption

* chore: bump 6.6.0

* fix: proto.put TypeError text (#771)

* refactor: replace is.blob & is.file with isBlob & isFile (#776)

* feat: multiversion (#750)

* chore: bump 6.8.0-beta

* refactor: multiversion (#781)

* fix: browser端,去除没有使用的 sha256.js 文件 (#780)

* chore: change and delete the bucket used for test (#783)

* fix: putBucketWebsite testting (#785)

* chore: fix test case

* fix: getBucketVersions result has no prefixes (#799)

* feat(node): uploadPart support file stream (#798)

* refactor: refactor cleanBucket delete (#803)

* test: add firefox test in browsers (#804)

* feat: browser端,将 is-type-of 包的依赖处理为 shim (#801)

* feat: update mime, use mime/lite replace mime and use shims/debug.js replace debug in browser (#802)

* fix: putStream can not close request when stream destroyed (#782)

* fix: delete unless code and delete invalid Content-Type (#805)

* test: test content-type without MIME (#806)

* chore: merge master fix

* chore: travis fix

Co-authored-by: 冷若霜寒 <912881342@qq.com>
Co-authored-by: microJ <microJ@users.noreply.github.com>
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.

3 participants