Skip to content

fix(pack): ignore invalid pseudo selector error & unpure selector error#2303

Merged
fireairforce merged 1 commit intonextfrom
enable-invalid-pseudo-class
Nov 7, 2025
Merged

fix(pack): ignore invalid pseudo selector error & unpure selector error#2303
fireairforce merged 1 commit intonextfrom
enable-invalid-pseudo-class

Conversation

@fireairforce
Copy link
Member

Summary

Related pr: utooland/next.js#71

issue 相关参考:

#2268 (comment)
#2268 (comment)

测试行为上跟 webpack 对齐了:

image

Test Plan

参考快照测试

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @fireairforce, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and resolves issues related to the pack tool's handling of invalid pseudo-selectors and "unpure" selectors in CSS. The primary goal is to align the system's behavior with Webpack's, ensuring that such selectors are processed without causing errors. The changes are thoroughly validated through the addition of new snapshot tests, which capture the expected output for these specific styling scenarios.

Highlights

  • Selector Error Handling: Implements a fix to correctly ignore errors arising from invalid pseudo-selectors and "unpure" selectors within the packing process.
  • Webpack Alignment: Ensures that the handling of these specific CSS selector errors now aligns with how Webpack processes them, improving compatibility.
  • New Snapshot Tests: Introduces a comprehensive set of new snapshot tests to validate the fix and prevent regressions for invalid pseudo-class and unpure selectors.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这个 PR 旨在修复打包过程中对无效伪选择器和非纯选择器报错的问题,通过忽略这些错误来与 Webpack 的行为对齐。相关的改动主要是新增了一个快照测试(invalid_pseudo_class)来验证这个修复。

整体来看,这个修复方向是正确的,并且新增的快照测试很好地覆盖了 PR 描述中提到的场景。

我有一个建议,旨在增强这个新的快照测试的覆盖范围,使其更加健壮,具体请看我的代码评论。

@fireairforce fireairforce merged commit 15e7c94 into next Nov 7, 2025
17 checks passed
@fireairforce fireairforce deleted the enable-invalid-pseudo-class branch November 7, 2025 02:57
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