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(transform): support useDefineForClassFields Config #1181

Merged
merged 10 commits into from
May 29, 2024

Conversation

stormslowly
Copy link
Member

@stormslowly stormslowly commented May 20, 2024

close #1172
and part of #1178
why and ref : #1172 (comment)

implementation reference: https://github.com/swc-project/swc/blob/main/crates/swc/src/config/mod.rs#L293-L297

Summary by CodeRabbit

  • 新功能
    • 在应用程序中添加了搜索功能。
    • 向配置中引入了新的JavaScript转换设置。
    • 引入了用于JavaScript项目测试的测试工具。
    • 为JavaScript转换场景添加了新的配置设置。
    • 为构建项目引入了新的功能。
    • 在bundler-mako包中进行了一些配置更改。
  • 文档
    • 引入了新的mako.config.json文件和base-tsconfig.json文件。
  • 修复
    • 为JavaScript转换场景修复了一些问题。

Copy link
Contributor

coderabbitai bot commented May 20, 2024

Walkthrough

整体变更包括对配置文件和代码的更新,引入了新的结构体和方法。JavaScript项目中添加了测试工具和配置文件,以及类和方法的示例。Bundler工具的配置和构建功能也有所更新。

Changes

文件 变更摘要
crates/mako/src/build/transform.rs transform.rs 中的 Context 实现中添加了 assumptions_for 方法。
crates/mako/src/config/config.rs 添加了 JsConfig 结构体和相关配置更新。更新了 Config 结构体和默认实现。
e2e/fixtures/javascript.transform.use_define_for_class_fields/expect.js 引入了用于测试的实用工具。
e2e/fixtures/javascript.transform.use_define_for_class_fields/mako.config.json 引入了空的 JSON 配置文件。
e2e/fixtures/javascript.transform.use_define_for_class_fields/src/index.tsx 引入了一个类和测试用例。
e2e/fixtures/javascript.transform.use_define_for_class_fields_off/expect.js 引入了与 JavaScript 转换相关的变更。
e2e/fixtures/javascript.transform.use_define_for_class_fields_off/mako.config.json 引入了针对 JavaScript 转换的配置设置。
packages/bundler-mako/.gitignore 添加了对 examples 目录中名为 dist 的目录的排除规则。
packages/bundler-mako/.npmignore .npmignore 文件中添加了对 examples 目录的忽略。
packages/bundler-mako/examples/simple/base-tsconfig.json 引入了一个配置设置。
packages/bundler-mako/examples/simple/build.js 引入了构建项目的功能。
packages/bundler-mako/examples/simple/index.ts 引入了一个类和实例化。
packages/bundler-mako/examples/simple/tsconfig.json 扩展了 base-tsconfig.json 并指定了编译器的输出目录。
packages/bundler-mako/index.js index.js 文件中进行了一系列更改。
packages/bundler-mako/package.json 更新了依赖和版本信息。

Poem

兔子编码忙碌乐,配置更新结构添。
测试工具悄然至,JavaScript舞起新风。
Bundler配置构建新,代码世界变奇妙。


Tip

Early Access Features
  • gpt-4o model for chat

Note

Pull Request 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.

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 full the 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 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.

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.

1、什么场景下一定需要 useDefineForClassFields?
2、如果这种方式更优,为啥不默认开启?
3、配置方式待讨论

@stormslowly stormslowly force-pushed the feat/decorator_and_class_fields branch from 02d3ca8 to 0c5dfbe Compare May 27, 2024 02:29
@sorrycc sorrycc merged commit 36377d9 into master May 29, 2024
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the feat/decorator_and_class_fields branch May 29, 2024 02:30
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] mako doesn't working with @opensumi/di 's example
2 participants