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: alias use vec instead of hash_map #1299

Merged
merged 7 commits into from
Jun 27, 2024
Merged

fix: alias use vec instead of hash_map #1299

merged 7 commits into from
Jun 27, 2024

Conversation

Jinbao1001
Copy link
Member

@Jinbao1001 Jinbao1001 commented Jun 20, 2024

fix #1289

Summary by CodeRabbit

  • 新功能
    • 转换了配置文件中的别名键,从对象格式改为数组格式。
    • 改变了如何定义模块别名,可能会影响绑定过程中的模块别名的定义和使用。
    • 通过将别名属性从对象改为数组,调整了绑定配置中的结构。

Copy link
Contributor

coderabbitai bot commented Jun 20, 2024

漫游

这一系列更改涉及将别名字段从字符串记录改为字符串对数组,触及配置、解析、插件和文档等结构。代码中的别名从对象形式转变为了更灵活的数组形式,影响了模块路径的定义和解析。

变更

文件路径 变更摘要
crates/binding/src/lib.rs 别名字段在BuildParams结构体中更改为数组形式。
crates/mako/src/config/config.rs ResolveConfig结构体中的alias字段从HashMap改为元组的Vec形式。
crates/mako/src/features/node.rs Node结构体中,修改了别名配置数组的操作方式,从insert改为push
crates/mako/src/plugins/ssu.rs SUPlus结构体中的config_hash方法调整为使用hash_vec函数。
crates/mako/src/resolve/mod.rs parse_alias函数接受了Vec<(String, String)>参数。
docs/config.md 更新配置文件中resolve部分的别名配置。
e2e/fixtures/css.alias/mako.config.json JSON配置文件中resolve对象中alias键的结构更改。
e2e/fixtures/css.css-modules.aliased.failed/mako.config.json 修改了JSON配置文件中resolve.alias的结构。
examples/config-externals/build.js build.js文件中的config对象的alias属性从对象变为数组。
examples/with-umi/mako.config.json mako.config.json中别名配置从对象转为数组形式。
packages/mako/binding.d.ts BuildParams接口中的alias属性改为元组数组形式。
packages/mako/src/index.ts build函数中分配别名时,从对象修改为数组形式。
scripts/mako.js 修改getMakoConfig函数中别名配置从对象为数组,更新数组中的路径。

诗歌

兔子跳动,笨重转为灵活舞蹈,
别名由字典,转变成双串结缘,
代码中行行,路径更新新装,
组织简洁,更多自由漫游。🐇🌟


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/alias use vec instead of hash_map fix: alias use vec instead of hash_map Jun 21, 2024
@umijs umijs deleted a comment from sorrycc Jun 21, 2024
@stormslowly stormslowly merged commit 69a15a9 into master Jun 27, 2024
8 checks passed
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.

2 participants