feat(plugin-less): compatible with Rsbuild v1#7054
Conversation
Summary of ChangesHello @chenjiahan, 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 significantly enhances the Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
The pull request successfully introduces compatibility for @rsbuild/plugin-less with Rsbuild v1. This is achieved through a new version detection mechanism and adaptive rule ID mapping within the plugin's core logic. The package.json updates correctly reflect the new peer dependency requirements, and a dedicated test case has been added to verify the v1 compatibility. The changes are well-aligned with the stated goal of the pull request.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8288f4d1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Deploying rsbuild with
|
| Latest commit: |
681a340
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5ca38076.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://plugin-less-0126.rsbuild-v2.pages.dev |
There was a problem hiding this comment.
Pull request overview
Adds Rsbuild v1 compatibility to @rsbuild/plugin-less by branching on the Rsbuild core version and adjusting how Less/CSS rules are located and composed, plus adding a v1 test setup.
Changes:
- Detect Rsbuild v1 vs v2 and map rule IDs accordingly when wiring Less rules/loaders.
- Add a v1 test dependency (
@rsbuild/core-v1) and a new v1 snapshot test. - Update snapshots and widen the plugin’s
@rsbuild/corepeer dependency minimum to^1.3.0.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds the @rsbuild/core-v1 aliased dependency to support v1 testing. |
| packages/plugin-less/package.json | Adds @rsbuild/core-v1 devDependency and adjusts @rsbuild/core peer range. |
| packages/plugin-less/src/index.ts | Introduces v1/v2 branching and new rule-id mapping logic for Less rules. |
| packages/plugin-less/tests/index.test.ts | Adds a v1-specific test using @rsbuild/core-v1. |
| packages/plugin-less/tests/snapshots/index.test.ts.snap | Updates snapshots to reflect the new rule structure and adds v1 snapshots. |
| packages/core/src/configChain.ts | Removes CHAIN_ID.ONE_OF.LESS_* constants from core’s exported identifiers. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Added support for Rsbuild v1 in
@rsbuild/plugin-lessby detecting the version and mapping rule IDs accordingly, ensuring that Less processing works seamlessly across Rsbuild v1 and v2.Related Links
Checklist