-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix(tree-shaking): object spread transform should go before deconstructing #1598
Conversation
Walkthrough此次更改增强了 Changes
Possibly related PRs
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
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: 0
Outside diff range and nitpick comments (3)
e2e/fixtures/tree-shaking.import_namespace/src/index.tsx (3)
8-10
: 代码看起来不错!数组声明和打印到控制台的逻辑是正确的。
建议删除第 8 行的注释,因为它可能只是一个占位符,对代码的理解没有帮助。
13-14
: 使用扩展运算符复制数组的逻辑是正确的使用扩展运算符
...
创建数组副本的逻辑是正确的,打印到控制台的语句也没有问题。建议将变量
copieArray
重命名为copiedArray
,因为当前的名称有拼写错误。Tools
GitHub Check: Spell Check
[warning] 13-13:
"copie" should be "copied" or "copier" or "copies" or "copy".
[warning] 14-14:
"copie" should be "copied" or "copier" or "copies" or "copy".
20-21
: 使用扩展运算符复制对象的逻辑是正确的使用扩展运算符
...
创建对象副本的逻辑是正确的,打印到控制台的语句也没有问题。建议将变量
copieObject
重命名为copiedObject
,因为当前的名称有拼写错误。Tools
GitHub Check: Spell Check
[warning] 20-20:
"copie" should be "copied" or "copier" or "copies" or "copy".
[warning] 21-21:
"copie" should be "copied" or "copier" or "copies" or "copy".
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- crates/mako/src/plugins/tree_shaking/remove_useless_stmts.rs (2 hunks)
- e2e/fixtures/tree-shaking.import_namespace/src/index.tsx (1 hunks)
Additional context used
GitHub Check: Spell Check
e2e/fixtures/tree-shaking.import_namespace/src/index.tsx
[warning] 13-13:
"copie" should be "copied" or "copier" or "copies" or "copy".
[warning] 14-14:
"copie" should be "copied" or "copier" or "copies" or "copy".
[warning] 20-20:
"copie" should be "copied" or "copier" or "copies" or "copy".
[warning] 21-21:
"copie" should be "copied" or "copier" or "copies" or "copy".
Additional comments not posted (9)
e2e/fixtures/tree-shaking.import_namespace/src/index.tsx (3)
11-12
: 解构赋值逻辑正确将数组解构为第一个元素和其余元素的逻辑是正确的,打印到控制台的语句也没有问题。
16-17
: 对象声明和打印逻辑正确使用对象字面量语法声明具有 3 个属性的对象,并将其打印到控制台的逻辑是正确的。
18-19
: 对象解构赋值逻辑正确将对象解构为第一个属性和其余属性的逻辑是正确的,打印到控制台的语句也没有问题。
crates/mako/src/plugins/tree_shaking/remove_useless_stmts.rs (6)
10-10
: LGTM!引入
object_rest_spread
转换以支持对象 rest/spread 语法是正确的。
272-272
: LGTM!创建
IdExplicitPropAccessCollector
的新实例以收集显式属性访问是正确的。
273-273
: LGTM!克隆
module
变量以避免修改原始模块是正确的。
274-274
: LGTM!在
destructuring
转换之前应用object_rest_spread
转换是正确的。
275-275
: LGTM!在
object_rest_spread
转换之后应用destructuring
转换是正确的。
276-276
: LGTM!使用
IdExplicitPropAccessCollector
实例v
访问转换后的模块以收集显式属性访问是正确的。
0aef8b8
to
0ae9e80
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1598 +/- ##
==========================================
- Coverage 62.11% 62.11% -0.01%
==========================================
Files 129 129
Lines 15559 15561 +2
==========================================
Hits 9665 9665
- Misses 5894 5896 +2 ☔ View full report in Codecov by Sentry. |
will panic with
Summary by CodeRabbit
新功能
无变化