-
Notifications
You must be signed in to change notification settings - Fork 73
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: __webpack_public_path__ and __mako_public_path__ should not be replaced when it's defined by user #1442
Conversation
…eplaced when it's defined by user
Walkthrough此次更改引入了 Changes
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 as PR comments)
Additionally, you can add 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- crates/mako/src/build/transform.rs (1 hunks)
- crates/mako/src/visitors/public_path_assignment.rs (2 hunks)
Additional comments not posted (5)
crates/mako/src/visitors/public_path_assignment.rs (4)
1-1
: 导入Mark
是必要的。为了支持新的
unresolved_mark
字段,导入Mark
是合理的。
6-8
: 新增字段unresolved_mark
是合理的。该字段的添加使结构体能够处理未解析的标记上下文,这对于正确转换公共路径至关重要。
15-17
: 更新的逻辑是合理的。此更改确保了
__webpack_public_path__
和__mako_public_path__
的赋值表达式仅在未解析上下文中进行转换,从而防止意外替换。
49-67
: 新增的测试用例是合理的。新测试用例
test_ident_defined
确保了当标识符由用户定义时,赋值表达式能够正确处理。crates/mako/src/build/transform.rs (1)
135-135
: 实例化PublicPathAssignment
时传递unresolved_mark
是合理的。此更改确保
PublicPathAssignment
具有未解析标记上下文的访问权限,这对于其功能至关重要。
#1441 的后续。
Summary by CodeRabbit
新特性
PublicPathAssignment
结构以包含新的unresolved_mark
字段,增强了对特定赋值表达式的处理逻辑。__webpack_public_path__
和__mako_public_path__
的识别条件,提升了公共路径赋值的准确性。test_ident_defined
,确保赋值表达式处理的正确性。修复
unresolved_mark
的上下文。