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: disable parallel less loader when on linux ant node version < 20.12.0 #1184

Merged
merged 7 commits into from
May 21, 2024

Conversation

xusd320
Copy link
Contributor

@xusd320 xusd320 commented May 21, 2024

暴露 less loader parallel 参数,用于控制是否通过 worker_thread 并行处理 less 文件。
在 linux 环境下,如果使用的 node 版本低于 20,基于 worker_thread 的并行版 less loader 可能会挂掉。框架层需要能手动关闭。
image

Copy link
Contributor

coderabbitai bot commented May 21, 2024

Warning

Rate Limit Exceeded

@xusd320 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 26 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 027e59f and 4682e1e.

Walkthrough

整体变更概述:bundler-mako 包的 index.js 文件中添加了 parallel 属性到 lessLoader 配置选项中。mako 包的 index.ts 文件的 build 函数新增了一个名为 parallel 的参数。mako 包的 lessLoader 模块经历了一系列调整,包括引入新的 parallel 选项、根据该选项条件性地使用不同模块,以及在某些条件下禁用 Linux 上的并行处理。lessLoader.worker.tsparallelLessLoader.ts 文件也有相应的修改。

Changes

文件 摘要
packages/bundler-mako/index.js lessLoader 配置选项中添加了 parallel 属性。
packages/mako/src/index.ts build 函数新增了一个 parallel 参数。
packages/mako/src/lessLoader/index.ts 添加了新的 parallel 选项,根据条件使用不同模块,并在某些条件下禁用并行处理。
packages/mako/src/lessLoader/lessLoader.worker.ts 重构了 lessLoader 函数,使用了 render 函数,替换了部分导入语句。
packages/mako/src/lessLoader/parallelLessLoader.ts compile 函数重命名为 render,修改了返回语句。
packages/mako/src/lessLoader/render.ts render 函数现在包含了渲染 Less 文件为 CSS 的功能。
packages/mako/package.json 版本更新为 "0.4.18-canary.20240521.1"。

Poem

代码更新如春风拂面,兔子编程快乐无边,
新功能如诗般婉转,技术日新月异盼未来。 🐇📦🌟

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @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.

packages/mako/src/lessLoader/index.ts Show resolved Hide resolved
packages/mako/package.json Outdated Show resolved Hide resolved
@xusd320 xusd320 changed the title feat: add param "parallel" for less loader fix: disable parallel less loader when on linux ant node version < 20 May 21, 2024
@xusd320 xusd320 requested a review from PeachScript May 21, 2024 07:55
@xusd320 xusd320 changed the title fix: disable parallel less loader when on linux ant node version < 20 fix: disable parallel less loader when on linux ant node version < 20.12.0 May 21, 2024
@sorrycc sorrycc merged commit 168f1d7 into master May 21, 2024
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the feat/less-loader-parallel-config branch May 21, 2024 08:49
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