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: optimize package imports support cache, export * and deep barrel files #810

Merged
merged 4 commits into from
Dec 25, 2023

Conversation

sorrycc
Copy link
Member

@sorrycc sorrycc commented Dec 21, 2023

优化了 Optimize Package Imports 的实现,

1、增加 cache,以避免不必要的 Module Build,但需注意的是 Cache 本身也有消耗,待 Benchmark
2、支持递归找桶文件,这样能增加覆盖率,覆盖率上去后,效果应该会更好一些
3、现在只有项目文件会做这个处理,至于 node_modules 下要不要做这个,需 Benchmark 验证
4、补充相关用例
5、@ant-design/icons 只使用了几个的场景

image

6、antd 只用了 button 的场景

image

一些 TODOs:

  • 验证下 @ant-design/icons
  • 确定 node_modules 下依赖其他文件时要不要做这个优化,或者通过开放配置的方式
  • 继续优化性能,1)桶文件分析依赖也用并行,2)cache 返回值不包含 ast 的重型数据,因为 cache 会做 clone

@sorrycc sorrycc changed the title WIP: feat: optimize package imports support cache, export * and deep barrel files feat: optimize package imports support cache, export * and deep barrel files Dec 25, 2023
@sorrycc sorrycc merged commit 40f4588 into master Dec 25, 2023
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the sorrycc-door branch December 25, 2023 02:00
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.

1 participant