Skip to content

feat(plugin): introduce order property for transform hook#5640

Merged
chenjiahan merged 2 commits intomainfrom
transform_order_0721
Jul 21, 2025
Merged

feat(plugin): introduce order property for transform hook#5640
chenjiahan merged 2 commits intomainfrom
transform_order_0721

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Introduce a new order property for the api.transform() hook and deprecate the previous enforce property.

This change is to ensure that Rsbuild plugins can uniformly use the order property to control the execution order of hooks.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings July 21, 2025 06:07
@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 21, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit fb216e2
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/687ddaeabe0e9b0008c1a36e
😎 Deploy Preview https://deploy-preview-5640--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 64
Accessibility: 97
Best Practices: 100
SEO: 100
PWA: 60
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 enforce property with order property in the TransformDescriptor type
  • Adds backward compatibility by keeping the deprecated enforce property
  • Updates implementation to prioritize order over enforce when 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

Comment thread packages/core/src/types/plugin.ts Outdated
@chenjiahan chenjiahan merged commit b959f92 into main Jul 21, 2025
11 checks passed
@chenjiahan chenjiahan deleted the transform_order_0721 branch July 21, 2025 06:15
@chenjiahan chenjiahan mentioned this pull request Jul 22, 2025
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