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

【BREAK CHANGE】Upgrade svg-sptite-loader #1283

Closed
AvailCat opened this issue May 9, 2017 · 10 comments
Closed

【BREAK CHANGE】Upgrade svg-sptite-loader #1283

AvailCat opened this issue May 9, 2017 · 10 comments
Milestone

Comments

@AvailCat
Copy link

AvailCat commented May 9, 2017

Notice

antd-mobile Icon 所依赖的开源 webpack loader svg-sprite-loader 最近从 0.3 直接升级到了 2.0, 其配置方案发生了 break change.

但由于此 loader 的版本由用户代码控制,而功能被 antd-mobile 和用户代码所共同依赖, antd-mobile 团队只能选择在 2.0 对其进行升级,请各位用户在 antd-mobile@1.x 期间暂时不要升级 svg-sprite-loader,在项目里仍然使用 svg-sprite-loader@0.3.x 即可。#1283


Version

1.1.2

Environment

svg-sprite-loader@2, unrelated to other environments

Steps to reproduce

  1. Use svg-sprite-loader 2.0.0 to
  2. Call Toast.fail('Whoops')
  3. Reproduced

What is expected?

Show toast

What is actually happening?

Browser throw an exception


Variable type in index.web.js with svg-sprite-loader 0.x is string,like "#fail"
It's an object after upgrade to svg-sprite-loader 2.0+, include a default property,with sub property "id", "id" is the real type

@paranoidjk
Copy link
Contributor

right now we haven't upgrade svg-sprite-loader, just use the package.json version
https://github.com/ant-design/ant-design-mobile/blob/master/package.json#L118

@AvailCat
Copy link
Author

AvailCat commented May 9, 2017

So you should tell user to install svg-sprite-loader@0.3.1 in docs

@paranoidjk
Copy link
Contributor

paranoidjk commented May 9, 2017

nope, you do not need to install svg-sprite-loader by yourself, antd-mobile dependencies included it.

@paranoidjk
Copy link
Contributor

@Meeeeow sorry, my mistake, it's devDeps, will not be install when you npm install antd-mobile

@AvailCat
Copy link
Author

AvailCat commented May 9, 2017

Nope, I think devDependencies will not install when package install as a dependency.
I'm using antd-mobile with style: true in babel-plugin-import options, so less file will passed to mine webpack installation

@paranoidjk
Copy link
Contributor

@Meeeeow whould you like to PR to help use upgrade svg-sprite-loader?

@AvailCat
Copy link
Author

AvailCat commented May 9, 2017

Yep, maybe tonight

@paranoidjk
Copy link
Contributor

38e4ae2?diff=unified
已经更新了文档,暂时先别升级,这个升级方案要仔细评估能否向下兼容,业务有太多依赖

-npm install svg-sprite-loader -D
+npm install svg-sprite-loader@0.3.1 -D

@paranoidjk
Copy link
Contributor

@paranoidjk
Copy link
Contributor

close in favor of #1740

lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this issue Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants