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(postcss): use default stage 2 #4577

Merged
merged 1 commit into from
Dec 9, 2024
Merged

fix(postcss): use default stage 2 #4577

merged 1 commit into from
Dec 9, 2024

Conversation

weareoutman
Copy link
Member

@weareoutman weareoutman commented Dec 9, 2024

依赖检查

组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。

请勾选以下两组选项其中之一:

  • 本次 MR 没有使用上游组件(例如框架、后台组件等)的较新版本提供的特性。

或者:

  • 本次 MR 使用了上游组件(例如框架、后台组件等)的较新版本提供的特性。
  • 在对应的文件中更新了该上游组件的依赖版本(或确认了当前声明的依赖版本已包含本次 MR 使用的新特性)。

提交信息检查

Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。

破坏性变更是针对于下游使用者而言,可以通过本次改动对下游使用者的影响来识别变更类型:

  • 下游使用者不做任何改动,仍可以正常工作时,那么它属于普通变更。
  • 反之,下游使用者不做改动就无法正常工作时,那么它属于破坏性变更。

例如,构件修改了一个属性名,小产品 Storyboard 中需要使用新属性名才能工作,那么它就是破坏性变更。
又例如,构件还没有任何下游使用者,那么它的任何变更都是普通变更。

破坏性变更:

  • ⚠️ 本次 MR 包含破坏性变更的提交,请继续确认以下所有选项:
  • 没有更好的兼容方案,必须做破坏性变更。
  • 使用了 feat 作为提交类型。
  • 标注了 BREAKING CHANGE: 你的变更说明
  • 同时更新了本仓库中所有下游使用者的调用。
  • 同时更新了本仓库中所有下游使用者对该子包的依赖为即将发布的 major 版本。
  • 同时为其它仓库的 Migrating 做好了准备,例如文档或批量改动的方法。
  • 手动验证过破坏性变更在 Migrate 后可以正常工作。
  • 破坏性变更所在的提交没有意外携带其它子包的改动。

新特性:

  • 本次 MR 包含新特性的提交,且该提交不带有破坏性变更,并使用了 feat 作为提交类型。
  • 给新特性添加了单元测试。
  • 手动验证过新特性可以正常工作。

问题修复:

  • 本次 MR 包含问题修复的提交,且该提交不带有新特性或破坏性变更,并使用了 fix 作为提交类型。
  • 给问题修复添加了单元测试。
  • 手动验证过问题修复得到解决。

杂项工作:

即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:

  • 本次 MR 包含杂项工作的提交,且该提交不带有问题修复、新特性或破坏性变更,并使用了 chore, docs, test 等作为提交类型。

Summary by CodeRabbit

  • 新功能

    • MessageDispatcher 类中的 onMessage 方法现在返回一个 Promise,支持异步工作流的更好集成。
  • 配置更新

    • 简化了 PostCSS 加载器的配置,使用默认设置。
    • 对 Webpack 配置中的 publicPath 属性进行了轻微调整。

Copy link

coderabbitai bot commented Dec 9, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/build-next-bricks/src/build.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "@next-core/eslint-config-next" to extend from. Please check that the name of the config is correct.

The config "@next-core/eslint-config-next" was referenced from the config file in "/.eslintrc".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Walkthrough

此次更改主要集中在两个文件中。首先,在 packages/build-next-bricks/src/build.js 中,PostCSS 加载器的配置进行了简化,移除了 postcssPresetEnv 加载器选项中的 stagefeatures 属性,同时对 Webpack 配置中的 publicPath 属性进行了轻微调整。其次,在 packages/easyops-runtime/src/websocket/MessageDispatcher.ts 中,MessageDispatcher 类的 onMessage 方法的返回类型由 void 更改为 Promise,以支持异步处理。

Changes

文件路径 更改摘要
packages/build-next-bricks/src/build.js 简化 getCssLoaders 函数中的 PostCSS 加载器配置,移除 stagefeatures 属性;调整 Webpack 配置中的 publicPath 属性。
packages/easyops-runtime/src/websocket/MessageDispatcher.ts 修改 onMessage 方法的返回类型,从 void 更改为 Promise,以支持异步处理。

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7b3b28a and 5fa5df5.

📒 Files selected for processing (2)
  • packages/build-next-bricks/src/build.js (2 hunks)
  • packages/easyops-runtime/src/websocket/MessageDispatcher.ts (1 hunks)
🔇 Additional comments (3)
packages/easyops-runtime/src/websocket/MessageDispatcher.ts (1)

77-81: ⚠️ Potential issue

返回类型变更为 Promise 需要注意兼容性

这个改动将 onMessage 方法的返回类型从 void 改为 Promise,这是一个突破性的变更。虽然实现正确,但需要确保:

  1. 所有调用此方法的代码都已更新以处理返回的 Promise
  2. 文档中已更新相关的 API 说明
  3. 版本号需要进行主版本升级

让我们验证一下这个改动的影响范围:

packages/build-next-bricks/src/build.js (2)

303-304: 代码格式优化

publicPath 配置中添加了括号,提高了表达式的清晰度。这是一个纯粹的代码格式改进,不会影响功能。


43-43: 验证 PostCSS 默认配置的兼容性

移除了自定义的 stagefeatures 配置,改用 postcss-preset-env 的默认配置。这可能会影响:

  1. CSS 特性的支持范围
  2. 现有样式的编译结果

建议:

  • 在合并前进行完整的样式回归测试
  • 记录在文档中说明此配置变更

让我们检查是否有依赖特定 CSS 特性的样式:

✅ Verification successful

PostCSS 配置变更影响有限

根据代码库分析,移除自定义配置的影响较小:

  1. CSS 文件使用的特性都是基础选择器(如 :not:first-child:last-child:only-child),这些都在 postcss-preset-env 的默认支持范围内
  2. 未发现使用高级或实验性的 CSS 特性
  3. 项目已升级到最新的 postcss-preset-env v10.0.5,默认配置足以支持现代浏览器

建议:

  • 在开发环境进行基本的样式验证即可
  • 无需额外的回归测试
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 搜索可能受影响的 CSS 嵌套规则
rg "@nest|&" -g "*.css" -g "*.less"

Length of output: 37


Script:

#!/bin/bash
# 搜索所有 CSS 和 LESS 文件
fd -e css -e less

# 搜索可能使用高级 CSS 特性的文件
rg ":(where|has|is|not|matches|any|local|global|hover|focus|active|visited|target|lang|nth|first|last|only|empty|checked|disabled|enabled|required|valid|invalid|in-range|out-of-range|read-only|read-write|placeholder-shown|default|indeterminate|valid|invalid|optional|required|user-invalid)" -g "*.css" -g "*.less"

# 检查构建配置中是否有其他 PostCSS 相关配置
rg -A 5 "postcss" -g "*.js" -g "*.json"

Length of output: 3271


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.23%. Comparing base (7b3b28a) to head (5fa5df5).
Report is 2 commits behind head on v3.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##               v3    #4577   +/-   ##
=======================================
  Coverage   95.23%   95.23%           
=======================================
  Files         206      206           
  Lines        8938     8938           
  Branches     1707     1707           
=======================================
  Hits         8512     8512           
  Misses        319      319           
  Partials      107      107           
Files with missing lines Coverage Δ
...easyops-runtime/src/websocket/MessageDispatcher.ts 98.52% <100.00%> (ø)

@panzekun panzekun enabled auto-merge December 9, 2024 10:51
Copy link

cypress bot commented Dec 9, 2024

next-core    Run #10820

Run Properties:  status check passed Passed #10820  •  git commit 35f7757e6d ℹ️: Merge 5fa5df5156ee1799448fbacaeca08242b21bd216 into 7b3b28aeb872b2a0f79fb7871da2...
Project next-core
Branch Review steve/v3-fix-postcss
Run status status check passed Passed #10820
Run duration 00m 23s
Commit git commit 35f7757e6d ℹ️: Merge 5fa5df5156ee1799448fbacaeca08242b21bd216 into 7b3b28aeb872b2a0f79fb7871da2...
Committer Shenwei Wang
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 16
View all changes introduced in this branch ↗︎

@panzekun panzekun merged commit cc73547 into v3 Dec 9, 2024
8 checks passed
@panzekun panzekun deleted the steve/v3-fix-postcss branch December 9, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants