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

体积问题 #204

Closed
hongbo-miao opened this issue Mar 10, 2018 · 12 comments
Closed

体积问题 #204

hongbo-miao opened this issue Mar 10, 2018 · 12 comments
Labels

Comments

@hongbo-miao
Copy link
Contributor

hongbo-miao commented Mar 10, 2018

现在只用到其中一个chart,也会加载整个包(超过500KB),是否有什么办法可以像lodash用哪个,import哪个吗?

import debounce from 'lodash.debounce';

谢谢!

@weepy3641
Copy link
Member

@hongbo-miao
暂时不可以哦。
bizcharts依赖于 g2,大部分的 size 都是被 g2 占据,g2 目前并不提供按需加载的功能。因此目前 bizcharts 是整个包都打包的。

@hongbo-miao
Copy link
Contributor Author

@weepy3641 谢谢,我在g2那边也新建了个issue。
希望将来有办法优化体积。否则当变得功能更强大时,体积也会更大。

@hongbo-miao
Copy link
Contributor Author

链接到 antvis/G2#364

@weepy3641 weepy3641 added the plan label Mar 15, 2018
@hongbo-miao
Copy link
Contributor Author

@weepy3641 g2 那边已经支持了!antvis/G2#364
这边也请支持,谢谢!This gonna become awesome!

@trexguo
Copy link

trexguo commented Apr 25, 2018

请尽快适配,项目上在等着用。。。

@weepy3641
Copy link
Member

@hongbo-miao @trexguo
好的, bizcharts 这边会尽快适配。

@trexguo
Copy link

trexguo commented May 14, 2018

请问进展如何?使用最新版+require依然没有减小体积。该如何使用?

@weepy3641
Copy link
Member

@trexguo
预计这周会有 beta 版本出来。

@weepy3641
Copy link
Member

@trexguo @hongbo-miao
fix bizcharts@3.1.8
具体见文档 https://github.com/alibaba/BizCharts/blob/master/doc/tutorial/needload.md

@yanaxie
Copy link

yanaxie commented Apr 24, 2019

@trexguo @hongbo-miao
fix bizcharts@3.1.8
具体见文档 https://github.com/alibaba/BizCharts/blob/master/doc/tutorial/needload.md
如果想单独引入intervalStack类型的Geom该怎么使用呢,在typedGeom目录下并没有找到intervalStack文件

@trampboy
Copy link

trampboy commented Jan 6, 2023

@weepy3641
你好,我使用按需加载后,bizcharts 是少下去了(压缩后9.09KB),但 @AntV 仍然有 1.25MB(打包后925.64KB),是否有进一步的提升空间?

使用版本:
bizcharts@3.5.10

使用方式:

Chart = (await import("bizcharts/lib/components/Chart")).default;
Axis = (await import("bizcharts/lib/components/Axis")).default;
Tooltip = (await import("bizcharts/lib/components/Tooltip")).default;
Line = (await import("bizcharts/lib/components/TypedGeom/Line")).default;
Point = (await import("bizcharts/lib/components/TypedGeom/Point")).default;

谢谢。

@1029800858
Copy link

@trexguo @hongbo-miao fix bizcharts@3.1.8 具体见文档 https://github.com/alibaba/BizCharts/blob/master/doc/tutorial/needload.md

按需加载文档打不开了,按照官网的按需加载,包的体积没有变化。参照官网的链接(https://bizcharts.taobao.com/product/bizcharts/category/12/page/23)

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

No branches or pull requests

6 participants