feat(plugin): introduce order property for transform hook#5640
Merged
chenjiahan merged 2 commits intomainfrom Jul 21, 2025
Merged
feat(plugin): introduce order property for transform hook#5640chenjiahan merged 2 commits intomainfrom
order property for transform hook#5640chenjiahan merged 2 commits intomainfrom
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new order property for the transform hook in Rsbuild plugins while maintaining backward compatibility by deprecating the existing enforce property. The change standardizes how Rsbuild plugins control hook execution order.
- Replaces
enforceproperty withorderproperty in theTransformDescriptortype - Adds backward compatibility by keeping the deprecated
enforceproperty - Updates implementation to prioritize
orderoverenforcewhen both are present
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/plugins/dev/core.mdx | Updates Chinese documentation to show new order property syntax |
| website/docs/en/plugins/dev/core.mdx | Updates English documentation to show new order property syntax |
| packages/core/src/types/plugin.ts | Adds deprecated enforce property and new order property to TransformDescriptor type |
| packages/core/src/initPlugins.ts | Updates logic to prioritize order property over deprecated enforce property |
| e2e/cases/plugin-api/plugin-transform-order/src/index.js | Adds test source file with placeholder for transformation testing |
| e2e/cases/plugin-api/plugin-transform-order/rsbuild.config.ts | Adds test configuration file for order property testing |
| e2e/cases/plugin-api/plugin-transform-order/myPlugin.ts | Adds test plugin demonstrating new order property usage |
| e2e/cases/plugin-api/plugin-transform-order/index.test.ts | Adds end-to-end test to verify order property functionality |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Introduce a new
orderproperty for theapi.transform()hook and deprecate the previousenforceproperty.This change is to ensure that Rsbuild plugins can uniformly use the
orderproperty to control the execution order of hooks.Related Links
Checklist