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

fix: classic mode import react will be remved use swc.strip #1285

Merged
merged 8 commits into from
Jun 20, 2024

Conversation

Jinbao1001
Copy link
Member

@Jinbao1001 Jinbao1001 commented Jun 17, 2024

Summary by CodeRabbit

  • 新功能
    • 更新了 package.json 文件以包含 "preact": "10.22.0" 依赖项。

Copy link
Contributor

coderabbitai bot commented Jun 17, 2024

漫游

这次变动集中在处理字符串传递的优化,从转换为引用,简化了代码。改动涉及多个模块,统一了传参方式,提升了代码质量。

变动

文件路径 摘要
crates/mako/src/ast/js_ast.rs 传递字符串引用以调用 gen_js_ast 方法。
crates/mako/src/plugins/farm_tree_shake.rs 修改 split_top_decl 以接受字符串引用。
crates/mako/src/plugins/farm_tree_shake/shake/module_concatenate/concatenate_context.rs 精简导出默认类和函数表达式的代码。
crates/mako/src/plugins/farm_tree_shake/shake/module_concatenate/exports_transform.rs 简化对 gen_js_ast() 的调用。
crates/mako/src/visitors/async_module.rs 调整 run 函数以传递字符串引用。
crates/mako/src/visitors/default_export_namer.rs 更新 run 函数中的字符串传递方式。
crates/mako/src/visitors/dep_analyzer.rs 优化 run 函数中的字符串传递逻辑。
crates/mako/src/visitors/dep_replacer.rs 修改 gen_js_ast 以接受字符串引用。
crates/mako/src/visitors/dynamic_import.rs 调整 run 函数中的字符串传递方式。
crates/mako/src/visitors/dynamic_import_to_require.rs 优化 gen_js_ast 的字符串传递方式。
crates/mako/src/visitors/env_replacer.rs 简化 gen_js_ast 调用,传递字符串引用。
crates/mako/src/visitors/fix_helper_inject_position.rs 优化 run 函数中的字符串传递方式。
crates/mako/src/visitors/mako_require.rs 改进 run 函数中对 gen_js_ast 的调用。
crates/mako/src/visitors/meta_url_replacer.rs 更新 run 函数以传递字符串引用。
crates/mako/src/visitors/new_url_assets.rs 优化 run 函数以传递字符串引用。
crates/mako/src/visitors/provide.rs 修改 run 函数中的字符串传递方式。
crates/mako/src/visitors/react.rs 优化 run 函数传参方式,直接传递字符串引用。
crates/mako/src/visitors/try_resolve.rs 更新 run 函数中的字符串传递方式。
crates/mako/src/visitors/virtual_css_modules.rs 优化 gen_js_ast 传参方式,接受字符串引用。

诗篇

代码中兔子跳,优化字符串传递饶。
gen_js_ast 更精简,引用传递变得全。
无需转换腾空顿,简洁化代码燃。


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 changed the title fix:classic mode import react will be remved use swc.strip fix: classic mode import react will be remved use swc.strip Jun 18, 2024
Copy link
Member

@sorrycc sorrycc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e2e/fixtures 下需要补充用例。

@Jinbao1001 Jinbao1001 requested a review from sorrycc June 18, 2024 09:39
@stormslowly stormslowly merged commit 6cdccd9 into master Jun 20, 2024
8 checks passed
@stormslowly stormslowly deleted the fix/tsx-strip 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.

3 participants