-
Notifications
You must be signed in to change notification settings - Fork 67
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
revert: import namespace optimize #1606
Conversation
Walkthrough本次更改涉及多个文件的修改和删除,主要集中在 Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (1)
packages/mako/binding.d.ts (1)
6-9
: 新接口TransformOutput
看起来不错这个新的接口定义清晰,结构合理。它似乎与代码转换输出有关,可能用于处理源映射。
建议:
- 考虑为这个接口添加一些注释,解释它的用途和属性的含义,特别是
map
属性的可选性。- 确保在使用这个接口的地方更新相关文档。
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- .github/workflows/ci.yml (0 hunks)
- crates/mako/src/plugins/tree_shaking.rs (0 hunks)
- crates/mako/src/plugins/tree_shaking/collect_explicit_prop.rs (0 hunks)
- crates/mako/src/plugins/tree_shaking/remove_useless_stmts.rs (2 hunks)
- crates/mako/src/plugins/tree_shaking/shake.rs (1 hunks)
- e2e/fixtures/tree-shaking.import_namespace/expect.js (0 hunks)
- e2e/fixtures/tree-shaking.import_namespace/mako.config.json (0 hunks)
- e2e/fixtures/tree-shaking.import_namespace/src/index.tsx (0 hunks)
- e2e/fixtures/tree-shaking.import_namespace/src/mod.js (0 hunks)
- packages/mako/binding.d.ts (1 hunks)
Files not reviewed due to no reviewable changes (7)
- .github/workflows/ci.yml
- crates/mako/src/plugins/tree_shaking.rs
- crates/mako/src/plugins/tree_shaking/collect_explicit_prop.rs
- e2e/fixtures/tree-shaking.import_namespace/expect.js
- e2e/fixtures/tree-shaking.import_namespace/mako.config.json
- e2e/fixtures/tree-shaking.import_namespace/src/index.tsx
- e2e/fixtures/tree-shaking.import_namespace/src/mod.js
Additional comments not posted (6)
crates/mako/src/plugins/tree_shaking/remove_useless_stmts.rs (6)
Line range hint
1-11
: 导入语句的清理很好移除未使用的导入有助于提高代码的清晰度和可维护性。剩余的导入看起来都是必要的,这是一个很好的改进。
Line range hint
13-108
: remove_useless_stmts 函数的修改是合理的函数的主要逻辑保持不变,移除了 optimize_import_namespace 函数的调用,这与整体的重构方向一致。函数仍然能够有效地处理无用语句和说明符的移除。
Line range hint
110-159
: 没有变化,代码保持原样这部分代码没有进行任何修改,保持原样是合适的。
Line range hint
161-233
: 没有变化,代码保持原样这部分代码没有进行任何修改,保持原样是合适的。
Line range hint
235-308
: 建议检查并更新测试套件虽然现有的测试没有变化,但由于移除了 optimize_import_namespace 函数,可能需要相应地调整测试套件。建议检查是否有与被移除功能相关的测试需要删除或修改,以及是否需要为当前实现添加新的测试用例。
Line range hint
1-308
: 总体修改看起来合理,但需要验证功能完整性移除 optimize_import_namespace 函数及其相关导入是这次更改的主要内容。这表明处理导入命名空间的方法发生了变化。虽然修改看起来是合理的,但建议验证这个改动是否会对树摇(tree-shaking)插件的整体功能产生负面影响。
请确保:
- 所有之前由 optimize_import_namespace 处理的场景现在都能被正确处理。
- 这个改动不会导致未使用的导入被错误地保留在代码中。
- 树摇功能在各种复杂的导入场景下仍然能够正常工作。
为了验证这些变更的影响,建议运行以下脚本:
这个脚本将帮助我们确认测试覆盖率是否充分,是否有遗漏的相关代码,以及集成测试是否需要更新。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1606 +/- ##
==========================================
- Coverage 62.11% 61.93% -0.19%
==========================================
Files 129 128 -1
Lines 15561 15405 -156
==========================================
- Hits 9666 9541 -125
+ Misses 5895 5864 -31 ☔ View full report in Codecov by Sentry. |
This reverts commit a485358.
Summary by CodeRabbit
新功能
TransformOutput
,提供更结构化的数据处理。删除
重构
remove_useless_stmts.rs
文件,移除未使用的导入和函数。