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 #1289

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

Jinbao1001
Copy link
Member

@Jinbao1001 Jinbao1001 commented Jun 18, 2024

Summary by CodeRabbit

  • 新功能
    • 更新了App函数中resolve配置,现在使用了alias属性的键值对数组形式。默认值已相应更改。
    • 调整了示例以反映alias用法的更改。

Copy link
Contributor

coderabbitai bot commented Jun 18, 2024

概述

**Walkthrough: 这次变更的总体概要是关于多个代码库的修改,主要涉及到将alias字段的数据结构从HashMap或者对象转换为Vec或者数组的调整。

Changes:

文件路径 简要变更摘要
crates/binding/src/lib.rs BuildParams中的alias字段类型从Record<string, string>更改为Array<[string, string]>
crates/mako/src/config/config.rs ResolveConfig中的alias字段类型由HashMap<String, String>更改为Vec<(String, String)>,默认配置进行了相应更新
crates/mako/src/features/node.rs Node实现中,修改了如何处理别名的方式
crates/mako/src/plugins/ssu.rs SUPlus中修改了从hash_hashmaphash_vec的函数调用
crates/mako/src/resolve/mod.rs 更新了parse_alias函数,接受Vec<(String, String)>而不是HashMap<String, String>
packages/mako/binding.d.ts BuildParams接口中,alias属性的类型从Record<string, string>更改为Array<[string, string]>
packages/mako/src/index.ts 修改了build函数中的别名解析方式
docs/config.md 更新了App函数中的resolve配置,改为使用键值对数组而不是对象
e2e/fixtures/css.alias/mako.config.json JSON配置文件中resolve对象中alias属性值的格式调整为数组
e2e/fixtures/css.css-modules.aliased.failed/mako.config.json 修改了JSON配置文件中resolve.alias中的别名结构
e2e/fixtures/css.dep_aliased/mako.config.json 调整了JSON配置文件中resolve.alias中的别名字段结构
e2e/fixtures/javascript.alias/mako.config.json 修改了mako.config.jsonresolve部分别名定义的格式
e2e/fixtures/javascript.require-dynamic/mako.config.json mako.config.json中,将resolve.alias从对象格式改为数组格式
e2e/fixtures/less.alias/mako.config.json JSON配置文件中resolve节下别名声明格式的更改
examples/config-externals/build.js 修改了config对象中的alias属性
packages/bundler-mako/examples/simple/build.js build.js中的alias属性格式从对象改为数组
packages/bundler-mako/index.js index.js中引入了一个新的generatorAlias数组,更新了配置对象中resolve属性使用此新数组

诗歌

兔子在代码中跳跃,修改别名让它们旋转🐇

JSON配置转换花样多,对象变数组风格走🔄

细节调整如翻篇,别名更新闪耀光🌟

代码世界兔子行,改变注定充满欢🎉


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.

@stormslowly stormslowly changed the title fix: alias use hash_vec instead of hash_map fix: alias use vec instead of hash_map Jun 19, 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.

1、确认 mako.config.json 和 @umijs/mako 层同时传入相同 alias 配置时,后者优先级更高
2、文档 config.md 需要同步修改

@stormslowly stormslowly merged commit 0be15ca into master Jun 20, 2024
8 checks passed
stormslowly added a commit that referenced this pull request Jun 20, 2024
stormslowly added a commit that referenced this pull request Jun 20, 2024
@stormslowly stormslowly deleted the fix/resorve-alias 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