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/symbol conflict special case #1279

Merged
merged 6 commits into from
Jun 17, 2024
Merged

Conversation

stormslowly
Copy link
Member

@stormslowly stormslowly commented Jun 14, 2024

close #1274

top level 的 symbol 重名为 _$m_Symbol

Summary by CodeRabbit

  • 新功能
    • crates/mako/src/ast/tests.rs:修改了gen_js_ast函数,现在接受实现AsRef<str>的泛型类型T,在将输入分配给content字段之前将其转换为字符串,确保与可转换为字符串的不同类型兼容。
    • crates/mako/src/build/transform.rs:在Transform实现中的访问者列表中添加了FixSymbolConflict访问者。
    • crates/mako/src/visitors/fix_symbol_conflict.rs:引入了FixSymbolConflict结构体,处理模块中标识符的冲突。
    • e2e/fixtures/javascript.issue-1274/expect.js:添加了逻辑以解析构建结果、注入Jest测试工具并要求特定文件用于测试。
    • e2e/fixtures/javascript.issue-1274/mako.config.json:引入了配置设置,指定应用程序的目标浏览器为Internet Explorer 11。
    • e2e/fixtures/javascript.issue-1274/src/index.tsx:引入了forOf函数和Symbol类,包括相关测试用例。
    • packages/bundler-mako/package.json:更新了@umijs/mako的版本。
    • packages/mako/npm/darwin-arm64/package.jsondarwin-x64linux-x64-gnulinux-x64-musl:更新了各个平台的@umijs/mako版本和相应依赖。

Copy link
Contributor

coderabbitai bot commented Jun 14, 2024

变更总览

crates/mako/src/ast/tests.rs: 该功能变更修改了impl TestUtils中的gen_js_ast函数,使其接受实现AsRef<str>的泛型类型T,在分配给content字段之前将输入转换为字符串。这个变更确保了与可以转换为字符串的不同类型的兼容性。

crates/mako/src/build/transform.rs: 在crates/mako/src/build/transform.rs文件中:

  • FixSymbolConflict访问者添加到Transform实现的访问者列表中。

crates/mako/src/visitors/fix_symbol_conflict.rs: fix_symbol_conflict.rs新增文件介绍了一种解决特定GitHub问题上符号冲突的方法。定义了一个FixSymbolConflict结构体,其中包含处理模块内标识符符号冲突的方法。

e2e/fixtures/javascript.issue-1274/expect.js: 新文件引入了解析构建结果、注入Jest测试实用工具和为测试目的需要特定文件的逻辑。

e2e/fixtures/javascript.issue-1274/mako.config.json: 新文件mako.config.json引入了一个配置设置,指定应用程序的目标浏览器,具体针对Internet Explorer 11。

e2e/fixtures/javascript.issue-1274/src/index.tsx: 新文件index.tsx引入一个forOf函数,遍历输入数组,逐个元素递增1,并返回修改后的数组。还定义了一个具有返回特定字符串的name方法的Symbol类。包括测试用例来验证forOf函数和Symbol类的功能。

packages/bundler-mako/package.json: 更新了@umijs/mako的版本号从"0.6.0""0.6.1-canary.20240614.1"

packages/mako/npm/darwin-arm64/package.json - @umijs/mako-darwin-arm64的版本号从"0.6.0"更新到"0.6.1-canary.20240614.1"。

packages/mako/npm/darwin-x64/package.json: 将版本从"0.6.0"更新到"0.6.1-canary.20240614.1"。

packages/mako/npm/linux-x64-gnu/package.json: 将版本从"0.6.0"更新到"0.6.1-canary.20240614.1"。

packages/mako/npm/linux-x64-musl/package.json: 更新版本号从"0.6.0"到"0.6.1-canary.20240614.1"。

packages/mako/package.json: 将@umijs/mako包的版本号从0.6.0更新到0.6.1-canary.20240614.1,并更新了相应的可选依赖项版本以匹配这个新版本。

漫步指南

对整体变更的高级总结,在80字内。

变更

文件 变更摘要
crates/mako/src/ast/tests.rs 修改gen_js_ast函数以接受泛型类型T,以便兼容不同类型的转换为字符串。
crates/mako/src/build/transform.rs 添加FixSymbolConflict访问者到Transform实现中。
crates/mako/src/visitors/fix_symbol_conflict.rs 引入处理模块内符号冲突的新方法FixSymbolConflict
e2e/fixtures/javascript.issue-1274/expect.js 引入构建结果解析、Jest测试工具、特定文件需求的逻辑。
e2e/fixtures/javascript.issue-1274/mako.config.json 引入目标浏览器配置指定。
e2e/fixtures/javascript.issue-1274/src/index.tsx 引入forOf函数和Symbol类,包含测试用例。
packages/bundler-mako/package.json 更新@umijs/mako版本号。
packages/mako/npm/darwin-arm64/package.json 更新@umijs/mako-darwin-arm64版本号。
packages/mako/npm/darwin-x64/package.json 更新@umijs/mako-darwin-x64版本号。
packages/mako/npm/linux-x64-gnu/package.json 更新@umijs/mako-linux-x64-gnu版本号。
packages/mako/npm/linux-x64-musl/package.json 更新@umijs/mako-linux-x64-musl版本号。
packages/mako/package.json 更新@umijs/mako版本号和对应的可选依赖项。

诗歌

草地上的兔子跳得欢,
代码中的变更记录全知晓。
符号冲突有解法,
版本更新似春风吹。

希望这个小诗能为你带来一丝喜悦!


Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://coderabbit.ai

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sorrycc sorrycc merged commit 73e29df into master Jun 17, 2024
8 checks passed
@stormslowly stormslowly deleted the feat/symbol_conflict_special_case branch August 9, 2024 06: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.

[bug] Symbol is shallowed when target to chrome 40
2 participants